Do not launch floating window when on default launcher

We only do this when user is on the default launcher 
because if the user was on a non-default launcher,
he/she must have been there for some purpose and we 
do not want to throw him/her back to the default 
launcher incase he/she exits the app with HOME button.
Themes: Update LoadedApk resources.

Instead of creating a new LoadedApk when resources are not up to
date, we use the existing LoadedApk but recreate mResources.

Change-Id: Ic1ad810863d03c2cedc751c9e84dd7c954daf3d7
IndexOutOfBoundsException observed rarely in ProcessStats

Sometime IndexOutOfBoundsException is observed in ProcessStats
while allocating longs array. This could be due to synchronization.
This fix will return if array index is >= size.

Change-Id: I1df34152c95f2ff61829da07f750e79a6f1efab3
CRs-fixed: 626638
Signed-off-by: houst0nn <houstonn@gmail.com>
Fixing parcel leaks to avoid virtual memory leak

Client has to call recycle() on parcel object after its usage
otherwise native layer of binder won't clear the resources of
parcel which were allocated for IPC

Change-Id: Ib31ddcc92aa4ebd80bb66729922b9133692e9c9e
Signed-off-by: houst0nn <houstonn@gmail.com>
Merge "Themes: Update LoadedApk resources." into kitkat
Merge "Fixing parcel leaks to avoid virtual memory leak" into kitkat
Merge "Do not launch floating window when on default launcher" into kitkat
Themes: Modify config to support app specific themes [1/4]

Summary of Changes
1. The configuration now supports each app to have their own theme.
Each theme can include icons, styles (ie overlays) and font.

2. The theme config is serialized into a json string and stored
in secure settings.  This entry consolidates what was previously 3 separate
keys (style, icon, font) into a single field.

3. 'CustomTheme' was renamed to 'ThemeConfiguration'.

Note: This commit is for the configuration. Additional work needs to be done to
the framework and UI to support app specific themes.

Credit to @BigBrother1984 for the original cherry pick

Change-Id: I8ac7e83f7cfa60567166bed699d1cb17c547e20d
Themes: Support theming navbar separately from SystemUI

This allows using a different theme for the navbar than the theme
applied to the rest of SystemUI.  This will not affect theming until
we have the front end in place that allows users to change this.

Credit to @BigBrother1984 for the original cherry pick

Change-Id: I753623696cdc017fc66dc5e85079fe80e5f626f9
Add getThemedResourcesForApplicationAsUser()

Credit to @BigBrother1984 for the original cherry pick

Change-Id: I90b7cb441e4056f59b7260ffa55e31eba644e25a
Themes: Allow specifying a theme when creating a Context

A Context normally loads the resources associated with the given
package that this context is for.  This patch allows us to specify
a theme we want attached to a given context's resources.

Credit to @BigBrother1984 for the original cherry pick

Change-Id: Idfb53aba307f58be6e2ed6d404b8a76c31199fc8
Themes: Use systemui's applied theme for notifications.

Notifications contain RemoteViews which are inflated using the
application's context for which this notification belongs to.  This
can look out of place if SystemUI is using a different theme than the
rest of the system.

This patch will use SystemUIs theme when inflating the RemoteViews,
giving us a more consistent look in the notification drawer.

Credit to @BigBrother1984 for the original cherry pick

Change-Id: I91392c76dca2ef08c82c5ccd68a0f6aca64b647a
Themes: Add icon previews to ThemesContract

Credit to @BigBrother1984 for the original cherry pick

Change-Id: Icbfbee3404702a29881ad4933721d8beb39bef30
Merge "IndexOutOfBoundsException observed rarely in ProcessStats" into kitkat
Fix possible NPE in SyncHandler.onBootCompleted()

If onBootCompleted() was called a second time, it would have throw a
NullPointerException since the queue object would have already been
set to null by the previous call. This commit just makes such an
object behave as an empty queue instead of throwing the exception.

Change-Id: I7ef82ba1e2504ceb0a2c11694d32f0588db7d0af
Themes: Revert "Send broadcast when package is 'about' to be removed"

This reverts commit 238e80a5c7edcb922ce15feebec74ea2475c31cb.
This was a band-aid that is being fixed in a future commit.

Change-Id: I89a928e2fd9cff2b1992a6e85eb5c96c5b8b9b0e
Automatic Translation Import

Change-Id: I35b5cce6e47d9d765b5cc8dbc48bb16e1c4c3d4b
Merge "Themes: Revert "Send broadcast when package is 'about' to be removed"" into kitkat
Themes: Partial change: Use ArrayListExtra for broadcasting theme changes [1/2]

Change-Id: I897cfbbe293b73f9e8f069f4b4cefa7c3ffb79ed
Merge "Themes: Partial change: Use ArrayListExtra for broadcasting theme changes [1/2]" into kitkat