base: fix public api breakage

Change-Id: Ic25b507e66d42ae172cf031e97d14965d3a54aa0
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
add VoiceWakeup Settings value

Change-Id: I798d1ed9b2bda0fe8a36b8fa2bd17d74d2a09cab
environment: return external dir if secondary is not defined

If the device doesn't define a secondary storage, then return external storage
as secondary storage

Patchset 2: do not break the api

Change-Id: I9d94a01881f47977ef1a26c3648b3da1d8c63b57
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Revert "Keyguard: Fix another derp and check against null"

This reverts commit 4d0fa16b2595230403c02711fe38846266699150.
Revert "Keyguard: Correctly set the visibility"

This reverts commit 8e52208dc32c28e2fb725da8cf3de32e5ff0ce07.
Revert "Keyguard: shuffler - be sure klondikeText is visible if needed and poke a wakelock..."

This reverts commit e59cfd6413db7fd594993a77720307a3a954afa3.
Revert "Frameworks: Policy: implement a pin keypad shuffler [1/2]"

This reverts commit f8291bbf05f5e65b13a3a5e855b7848a25d151be.
Revert "Keyguard: Enable quick unlock (1/2)"

This reverts commit 1876f0d5f396e0a32d51b44dbb4da39f41851837.
Keyguard: Enable quick unlock (1/2)

old way does not work anymore exactly like before. So adapt the idea to new LP code

Thankd DVTonder for the basic idea prior LP

PS:
- do PIN view correctly

Change-Id: I86660afafb8648d36d6c135343c88afcfc5173fc
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	core/java/android/provider/Settings.java
Frameworks: Policy: implement a pin keypad shuffler [1/2]

this is to further prevent people using the tablet guessing your pin based on fingerprints left on the screen
example of the expected outcome - https://www.dropbox.com/sh/r3xb2q53ksaqni9/Oz1Eu8Dm7O

- correct coding style
- added reload button

PatchSet:
- simplify shuffle code
- fix over shifting in some cases
- add reload button functionallity
- add lockscreenutils method to detect only PIN lock
  for settings
- exclude sim and simpuk PIN lock
- add drawables for reload button

PatchSet
- cleanup

PatchSet:
- fix shuffle NumKeyPad even if a theme replaces the xml
  and reload button is not present.

PatchSet:
- add mode disabled/always/on request

PatchSet:
- add nicer drawables

cheers

kufi

Ported to new keyguard package on LP

A bit rewrite of this feature + clean up and shorten aosp code

Conflicts:
	packages/Keyguard/res/layout/keyguard_pin_view.xml
	packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
	packages/Keyguard/src/com/android/keyguard/NumPadKey.java
Correct check of is user running

Before the ActivityManagerService sends an intent or
starts an activity it checks if target user is in
mStartedUsers array.

When removing a non-owner user process the
UserStartedState instance will still be in mStartedUsers
array with mState STOPPING or SHUTDOWN.

This should be checked before sending an intent or start
an activity.

isUserRunningLocked(...) will interpret mState STOPPING
and SHUTDOWN as a non running user.

Change-Id: I1b51bcdb62bdd0f6dbe05dab4d529d4ad40d0d44
Fix NullPointerException in ListView

There is a NullPointerException in `handleHorizontalFocusWithinListItem()`
because `selectedView.findFocus()` returns null and then there is no null
check when when the assigned variable `currentFocus` is used, although
`View.findFocus()` states that it may return null.

Change-Id: I6897027e9a2a238d9283e6b9f5146198989fcac0
Prevent ANR when broadcast receiver is killed

If the process of a BroacastReceiver is dying at the same time
as the system is trying to send an ordered broadcast to the
receiver, the system will try to start the process again. The
BroadcastQueue will store the BroadcastRecord in mPendingBroadcast
to be able to handle it again when the process is awake. A
timeout Message is posted to the handler of the BroadcastQueue.

As part of the shutdown sequence skipCurrentReceiver is called for
the ProcessRecord. This will check if there is a curReceiver set
for the application and make sure to finish the receiver.

Each of the foreground and background BroadcastQueues have their
own handler for managing broadcast timeouts. If the wrong
BroadcastQueue finishes the receiver, the pending timeout Message
will never be cancelled, leading to an ANR report for a receiver
that has already been finished.

Change-Id: I960c0d8f1a8b739b54a8f09f496b32a3498b9e9a
Keep deleteIntent when copying Notification attributes

Ensures that any previously registered deleteIntent is retained after a call
to Notification.setLatestEventInfo().

Currently, a call to setLatestEventInfo() effectively erases a previously
registered Notification.deleteIntent, which results in the app never being
notified when the user dismisses the notification.

This issue is described in detail in #73720:
https://code.google.com/p/android/issues/detail?id=73720

Change-Id: Ie58bf6a310058d40beb0d1af6506e9e1f4324b37
Signed-off-by: Sean Barbeau <sjbarbeau@gmail.com>
Consider RTL layout in DPAD navigation in AbsSeekBar

Changes the behavior of onKeyDown for DPAD_LEFT/RIGHT when in RTL
to move the progress in same direction as the DPAD key suggest.

Change-Id: I776a48711571884a10ef9315de78bf4ebffd6e4b
bug fix possible NPE while startProcessLocked()

In case, process doesn't create well while startingProcessLocked().
There is possibility to make NPE.
Setting app's crash handler needs to be assigned after null check routine.

Change-Id: I67fb6427f72d93f79fed36eb44c47d37eafdac31
[ActivityManager] Invalidate last screenshot when activity relaunched

Symptom:
The task thumbnail is not updated when activity relaunched.

Reproduce Steps:
1. Put device in portrait
2. Launch Calculator
3. Launch Recent App (the Calculator's screenshot is correct)
4. Rotate device to landscape
5. Click Calculator in Recent App to return to Calculator (Calculator has relaunched to landsacpe ui)
6. Launch Recent App again (the Calculator's screenshot is not updated)

Change-Id: I92e951ea2ee215c52ca6e50cf6f9e02deb787bce
Avoid capture all black screenshot bitmap

Captured screenshot bitmap is all black one if none of windows is
surface shown.

Change-Id: I651b2ade1865926d61f945167d60219535fa8bf8
Signed-off-by: tingna_sung <tingna_sung@htc.com>
[ActivityManager] Ensure provider external access count will be released.

Sympton: Oom-adj of provider process will be always 0.

Root Cause: Exception happend in openContentUri
may not call removeContentProviderExternalUnchecked.

Flow:
application [MediaPlayer.setDataSource(Context context, Uri uri)]
    uri is invalid, IOException will be caught and below log will appear:
    "Couldn't open file on client side, trying server side"
    Continue to call setDataSource(String path, Map<String, String> headers)
 ->mediaserver [MediaPlayerService::Client::setDataSource]
    setDataSource(httpService, url, headers) calls openContentProviderFile
 ->system_server (ActivityManagerService) [openContentUri]
    Increase externalProcessNoHandleCount for media provider.
    Call [openFile] to media provider.
 ->android.process.media [check permission for openFile]
    enforceReadPermissionInner
 ->system_server [checkComponentPermission]
    Use mediaserver's uid to check READ_EXTERNAL_STORAGE
      -> not granted due to it is pure native process, not a known package.
    Throw security exception then the flow of openContentUri is broke.
    And externalProcessNoHandleCount is unable to decrease.

Application sample code:
 String invalidId = "54321";
 Uri externalUri = MediaStore.Files.getContentUri("external");
 Uri uri = Uri.withAppendedPath(externalUri, invalidId);
 mediaPlayer.setDataSource(mContext, uri);

Solution: Move removeContentProviderExternalUnchecked to finally block.

Change-Id: I75eec1f9631e9c6bb18449946d707d51ac21e8a7
[ActivityManager] Prevent provider from been created twice.

Root Cause:
If a process which contains provider is starting but not
from accessing provider, e.g. service/activity/receiver,
its providers' will be created during handleBindApplication.
And before the process complete publish provider to
ActivityManagerService, if there is an access call to
process provider before the process completes publishing
providers to ActivityManagerService, then the providers
will be created again.

Solution:
Don't schedule install provider if the provider record
already exist and will be published later.

Change-Id: Ic200ceae042c014c86e7edee0acd013b513af334