Check for home activity when switching focus.

When finishing or stopping an activity the code was automatically
refocusing to the next activity on the same stack independent of the
task's onTopOfHome flag. When the activity eventually finished or
stopped it would then honor the onTopOfHome flag.

This fix examines the onTopOfHome flag and arranges the focus
correctly if home is the next activity to run.

Fixes bug 11318263.

Change-Id: I73a8f5e82de04b01acaffe366b085f9e475e1451
Optimize system bar background drawable.

Out with TransitionDrawable.

The new background drawable knows about all possible
background styles, and optimizes the transitions
between them - including picking up from the current
state, force finishing on screen off, and using
SystemClock.elapsedRealtime() for timing.

Bug:11254317
Change-Id: Ice83dc966f6674ef97f7008f2a1b62d67ec59e7d
Merge "Import translations. DO NOT MERGE" into klp-dev
Merge "Import translations. DO NOT MERGE" into klp-dev
Merge "Check for home activity when switching focus." into klp-dev
Don't use transient states for wallpaper animation.

The WindowManagerService member mLowerWallpaperTarget is not stable
throughout an app transition. Relying on it to be stable causes the
intra-wallpaper animation to start out right but after the windows
have been relayed out there is no longer a lower wallpaper target.
This causes the wallpaper to start tracking the animation of the
current wallpaper target rather than remain stable.

Switching to a new variable that saves the state of wallpaper
animation at the start of the animation fixes bug 11240590.

Change-Id: I336a59c47665fcf61019f567b8663956ff0e4940
Edge case: overriden system package moved & became privileged in OTA

Because properly continuing permission grants post-OTA has changed
policy to include privilege considerations based on install location,
make sure that we re-evaluate when we determine that the apk has
moved from its pre-OTA location.

Bug 11271490

Change-Id: I6c09986e2851a67504268b289932588457c05dfc
Fix leak with transitions when views get removed

Transitions, when started, add an OnPreDrawListener to the current
ViewTreeObserver (which is global to the view hierarchy). This listener
is removed when the listener is called.

It is possible to add this listener and then remove the view from
the hierarchy before the listener is called. This could result in
either the listener not getting called at all (since there was no
drawing event) or (in the case of this bug) the listener getting called
when the sceneRoot had no AttachInfo (which is the case when that
root has been removed from the hierarchy). This results in the listener
trying to remove itself from a *different* ViewTreeObserver than the one
it added itself to, leaving the actual listener still sitting on a list
of listeners in that original VTO. This can result in a growing list of
listeners and a growing amount of work that gets done on every frame.
It can also lead to a serious memory leak, since the objects referred to
by the transition may be non-trivial (as in the case of this bug).

The fix is to add another mechanism for the listener to get removed.
Specifically, we now listen for detach events on the sceneRoot. If that
view gets detached before the listener is called, then we have a chance to
remove it from the correct VTO before the AttachInfo becomes null.

Issue #11307391 keyguard is slow after updating to krt16c and playing music

Change-Id: I108413ea2f18f5351df0a11d4ae56fec0b4aa154
Remove '?' icon in layout for "Forgot pattern" button

Fixes bug 11234297

Change-Id: I5fbb54997b7a2bcf29b3a98b10a2ba4e908283ef
Merge "Edge case: overriden system package moved & became privileged in OTA" into klp-dev
Merge "Add 'no system permission' test app." into klp-dev
Fix issue #11323037: Android apk incorrectly marked as running in app processes

The android package is now a special case, not being added to the package list
when creating a multi-process component.  There is no need, since this package
is actually the framework itself which must be loaded in every process.

Also cleaned up some of the procstats dump output to help see what is going
on here.

Change-Id: If65d35ecd562f3154bdebfded69c454af6ce8c96
Merge "Ensure the simple CAB appears below the status bar." into klp-dev
Treat document thumbnails as preemptable.

When a more important request comes along, preempt all outstanding
thumbnail requests.

Bug: 11317901
Change-Id: I164fc8d804bb9c471e6da3f8127228043b3ca482
Update roots when data cleared, refresh UI.

Data cleared usually means accounts went away, so kick off roots
refresh.  Also update any visible UI after a refresh finishes.

Bug: 10899793
Change-Id: Id68c80b5e635e358cfd75f4961ce13cd1c7c5f82
Fix issue #11278906: Some wm commands fail on shell users

Binder.clearCallingIdentity makes everything better.

Change-Id: I31cd9478c857553b3cf1ea54d5b4987571788796
Unhide BIND_NFC_SERVICE permission.

Needs to be held by host-based card emulation
apps in order to work.

Bug: 11352063
Change-Id: I8ba42446cd3066b38309d8e9cbc51d140a023547
Merge "Fix issue #11323037: Android apk incorrectly marked as running in app processes" into klp-dev
Merge "Fix issue #11278906: Some wm commands fail on shell users" into klp-dev
Merge "add accessibility string for location quicksetting" into klp-dev