Avoid adding FORWARD_LOCK flag to an updated system app

Consider the following case:
1. An app exists in /system/app or /vendor/app. (i.e, it's a system app)
2. If the app would be updated as a forward-lock app by downloading from
   market(google play), then it would be installed in /data/app-private.
3. Moreover, if it would be updated by the whole system image (i.e, FOTA
   or something like that), then the app would be applied a FORWARD_LOCK
   flag.

The app SHOULD NOT have a FORWARD_LCOK flag. Because the resource path
of such app does not refer to the proper resources to access.

Change-Id: I0750f69a93a3115f4201029796b598507de3555f
Framework/base: Added synchronization block to avoid race condition

Fix for the synchronization issue leading to access of an array
Index out of bounds. Issue occurs due to race condition between
removing the activities of a crashed process from history stack
and resuming a separate activity.

Change-Id: I14bb5834e778c15b674248e46fe93b0ce9f37967
Subclassing AudioTrack considered harmful

This class was not really designed for subclassing to be meaningful,
and some uses could be downright dangerous, for example setState().

Change-Id: I36029e94546c53a47926918e7f667d9e83bd02fe
merge in master-release history after reset to master
fix NPE in updateClientUids

Bug: 8009908
Change-Id: I54d97c587a3fa9d003f654f98fdfdbe21af791d6
merge in master-release history after reset to master
Fixing missing internal link in document.

Change-Id: I80b8712815ac05acfa753cbb40875b869d2e942d
Set foreground priority for shutdown receivers.

The broadcast of ACTION_SHUTDOWN has a timeout of 10 seconds. To
reduce the risk of hitting the timeout and speeding up the
shutdown sequence in ShutdownThread we set the priority of the
BroadcastReceivers to FLAG_RECEIVER_FOREGROUND.

We have seen that this change reduces the shutdown time when
the system is under heavy load.

Change-Id: I22cbf6af8cf6fc4bdefaa1c3da8a7eed7e7b7674
Fix typo in AlertController.java

If whichButtons is BIT_BUTTON_NEGATIVE, the negative button should be centered.

Change-Id: Ia34daf8c80704204a4f1cf71c642114005559d5d
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Add default handlers for brightness keys

Change-Id: Ic57ba8cb159f08e0cde32350cb2d5eb34f68f830
Switch to system process before modifying rotation.

Bug: 8218133
Change-Id: Ib44d64d48dbdf3095182c409dd2211f6a3b726ad
Prevent repeated cursor movements from escaping a TextView

Bug: 4156002
Change-Id: If66a69c404509c75016039156389b6a7b2852154
Begin switch over to task based history.

- Introduce the task history and add to and remove from it with
verification.

Change-Id: If97e74f5a13f85acdb1521fc6d0b066a7e8584ae
    Trying to unregister a semi connected accessibility service.

    When an accessibility service connects we get a callback in
    which we either add the service, if this service is in the list
    of connecting services (we still want the service to connect),
    or we unbind and clear the state, if the service is no longer in
    the list of connecting services (we do not want this service to
    connect because something change between the bind request and
    the connection callback).

    The problem is that when the service connects and it is not in
    the list of connecting services on service connected we called
    the clean up code before the connection was complete. However,
    the clean up code expects fully configured services. Now we
    fully connect the service and in case there is a problem -
    disconnect it.

    bug:8232627

Change-Id: I939e544e31ffc1406035265a012c180f2ca95d7c
Switch topRunning* and moveTaskTo*

- More of the Activity to Task changeover.
- Fix bug in validateAppTokens().
- Improved validation of changeover.
- Eliminated iterator classes.

Change-Id: I934a208eabfc9a2668e5a6162452e1406f2c8d3a
Fix crashing bug in validator.

Change-Id: I649bb7cfc2b42fbeda478edcaa3a56f3c23d4bc8
Added the KeySetManager.

Bug: 7554291
Change-Id: Ic693a544f1e2cab20f6540b3fc4ff673e35bd2c6
Fix sample code error in battery documentation.

The code in the battery documentation uses inconsistent naming for one
of the variables: the intent is first called "batteryStatus" but then
used a just "battery," which causes the sample code to not actually work
if cut-and-pasted into a real project.

Change-Id: I3d8a06ba7e8448061ae162f786fe5c8770f65085
merge in jb-mr2-release history after reset to master
merge in master-release history after reset to master