Themes: Fix ResourceNotFoundException when updating  applied theme

If the user has a theme applied and there is an update to that theme,
then the themed apps will crash. This is because the theme's APK path changes,
but the apps do not update their resources. Apps were not updating their resources
because updateConfiguration() determined that the config (which only has pkgName) hasn't changed.

The problem is fixed by first applying the default theme config and then re-applying the
updated theme.

SystemUI was crashing with a NPE while verifying this fix, so a NP check was added to SystemUI as well.

Change-Id: I00e32fc1535b4d279fcb37c35f868501ecc1dd19

Conflicts:
	packages/SystemUI/src/com/android/systemui/quicksettings/UserTile.java
IconPackHelper: Respect the original size of bitmap icons

When use icon packs on low-resolution devices, for example, my HDPI
phone, it seems that using the size returned by
getLauncherLargeIconSize() will cause a blurness on
some icons that are not included in the icon pack because of the compose
function.

This patch respects the original size of the icon if the icon is an
instance of BitmapDrawable but use the size returned by
getLauncherLargeIconSize() if the icon is an instance of PaintDrawable.
This will remove icon blurness on low-resolution devices.

Change-Id: Ifcb39020d934a9c7cb409e1206a179d64f99aa37
Restore lazy loading of LoadedApk resources

This was broken in 8fff544ec349593cfa61ae2f5ec59419fff666b6. Since that change,
resources are always initialized in getPackageInfo(), even if they haven't been
loaded before (mResources == null).

It shouldn't be necessary in *any* case to preload the resources at this point.
Anything using the resources should call LoadedApk.getResources(), which will
initialize them just when needed. Setting mResources to null resets the cache
and will force a reload the next time the resources are requested.

Change-Id: I9bc9986297478e99752b1e2b9bd04dab3dcc9656
Themes: Support applying components from multiple themes [1/3]

The current implementation assumes the components being passed
into the ThemeService belong to the same theme.  This patch uses
a Map instead of a List to pass in a mapping of components to
package names, allowing us to apply several components from
different themes.

Requesting a theme change now takes a Map<String, String> which
maps components to the theme package name they will be applied
from.
Example:
    Map<String, String> componentMap = new HashMap<String,String>();
    componentMap.add(ThemesColumns.MODIFIES_ICONS, "com.mytheme.blue");
    componentMap.add(ThemesColumns.MODIFIES_OVERLAYS, "com.mytheme.red");

    ThemeManager tm = (ThemeManager) contex.getSystemService(Context.THEME_SERVICE);
    tm.requestThemeChange(componentMap);

Change-Id: I13fa17eabecb824884fe522d5dc1822a4d7c55f4
Merge remote-tracking branch 'pa/kitkat' into kitkat-next
Recents: Cleanup and fix visibility of ClearAll buttons

- Make it clean. Also this is a short life patch, top corner clear all will
  be moved as a function of hw buttons (ex long pressing desired assigned button ),
  reflects PA logic and muscle memory with soft navbar implement.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Recents: Need to consider if pie is on along with immersive

- Checking just the on the spot stored value result always true then

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Recents: Fix rushness

- Missing parenthesis

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
add missing TE refs
Signed-off-by: cj360 <ayunker551@gmail.com>

Change-Id: I29c8e9b8ddb05ca641356f005d81e882d4b6a71f
Tweak NotifcationManagerService

-Add mWasScreenOn boolean to check if screen is on, and then if the user
is in the color picker for cutom led force update to preview selected
led color with chosen lengh & speed.
Original Work & commit by @sam3000 on team-gummy http://goo.gl/FdP6cX

Change-Id: Ic9e1b67f9e8e50f21495555ef9f253bf68713e7b
Signed-off-by: cj360 <ayunker551@gmail.com>
rm extra "THEME_PKG_CONFIGURATION_PERSISTENCE_PROPERTY"
to fix compile
Signed-off-by: cj360 <ayunker551@gmail.com>

Change-Id: Ie93938087112685f324b9b856523b61792885251