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
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>
Switch to system process before modifying rotation.

Bug: 8218133
Change-Id: Ib44d64d48dbdf3095182c409dd2211f6a3b726ad
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
merge in jb-mr2-release history after reset to master
Add null check to setAppGroupId.

Fix bug 8217929.

Change-Id: I3bd54c32abcf6683c2fa75a85bf5025f47e09398
Update histories simultaneously.

In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I50b675cbedf72f72e547919210187b7e30a4ccb8
Revert "Update histories simultaneously."

Moving to master where it can be cherry-picked.

This reverts commit ce361f5f88d19d192a3ec4a2c369a3050d53aaaa

Change-Id: I0880a28c6fa5588ff2cab7995c90528f36bffd2e
Update histories simultaneously.

In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I9669762ad39b06ab6d401122702b74969d4dc658
merge in jb-mr2-release history after reset to master
Revert "Fix ListView is not scrolled properly with arrows"

This reverts commit db68fac12daa2cf4a7568308995e218aed92728a.
Revert ActivityManager changes for tasks. DO NOT MERGE

Keeping all activity=>task changes in master and removing them
from jb-mr2.

Revert "Update histories simultaneously."
Revert "Add null check to setAppGroupId."
Revert "Fix crashing bug in validator."
Revert "Switch topRunning* and moveTaskTo*"
Revert "Begin switch over to task based history."
Revert "Reset and reuse Iterators and don't new() one."
Revert "Remove AppWindowToken lists."
Revert "Fix build."
Revert "Remove unused App methods."
Revert "Stop using AppToken movement and start using Task."
Revert "Replace access to mAppTokens with AppTokenIterator"
Revert "Refactor setAppOpVisibility implementation."
Revert "Add AppWindowTokens to TaskList."
Revert "Make ActivityStack.mHistory private."
Revert "Migrate AppWindowToken lists into DisplayContent."

Change-Id: I5722c9a4956dccb52864207e2967690bc58e4ebb
MediaCodec: docs: Clarify that audio/mp4a-latm is plain AAC, not in LATM

The mime type name is unfortunate since it implies that the data
should be provided as a LATM bitstream, which it should not.

Change-Id: I3c997025342e3298729db2bfaeace9fcac001af9
merge in jb-mr2-release history after reset to jb-mr2-dev