Themes: Get resources with an explicit theme attached.

Change-Id: If04e82a13250f520d70b58991586c8ce38f0ecb1
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Don't log an error if we cannot open icon hash

The icons will end up being processed if we cannot access the hash
so let's just fail gracefully and silently.

Change-Id: I6368ee9bb47a9d52351fff22283ffac2de625b71
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Themes: Set bounds on iconUpon

Change-Id: I90720b87ed6d5c30f342bd0e1c149e8a6e238d6e
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
tests: Hide new private APIs

Add missing @hide
This should have been done in If04e82a13250f520d70b58991586c8ce38f0ecb1 to avoid

/opt/jenkins/android/workspace/android/cm-11.0/out/target/common/obj/PACKAGING/public_api.txt:24102:
error 4: Added public method android.test.mock.MockPackageManager.getThemedResourcesForApplication
/opt/jenkins/android/workspace/android/cm-11.0/out/target/common/obj/PACKAGING/public_api.txt:24103:
error 4: Added public method android.test.mock.MockPackageManager.getThemedResourcesForApplication

Change-Id: Ib40279065c937b130322350c1dbdf5b0b43506e3
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
PackageManagerService: Prevent sending a SIGKILL while the device shutting down

This avoid potential NPE when cleanup theme related data

Change-Id: Ifc7b5f7a21af32464feb32012336cfbe4b7de2ff
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Fix icon support for secondary users.

This fixes the problem when switching to a secondary user and
icons are currently applied.  Prior to this patch the secondary
user would see droids as their icons and apps would FC at start.

Change-Id: Icd4275eae5868612bf2a81b375ac4d0779a61395
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Don't create idmap if app doesn't have resources.arsc

Some apps do not have a restable but some legacy themes
try to theme these apps anyways. In this case we skip
the idmap creation process.

Change-Id: I8bc60984299791733d4fe8c9bbcaa75eca6d736b
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Install themes and icon packs for secondary users.

Change-Id: I48ae6835223510a433642fced5b96b6c3954baf6
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Remove DEFAULT_THEME_APPLIED_ON_FIRST_BOOT

doApplyDefaultTheme should be able to apply the default theme, if
one exists, whenever applyDefaultTheme() is called.

Change-Id: Ia50b4089d122855a4ddde91a02eef33ed3f9eaf4
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Add status bar and navigation bar to ThemesContract

Change-Id: I8048c735d7bbbfdb86ee5923b95bece6b4252bf7
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Add previews to the themes contract.

Change-Id: I607a6eda1c63a701516d2bc78ca6b705841fbdf7
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
WallpaperCropper: include wallpapers from themes!

Theme all the things!!!!!!!!!

Change-Id: Ie9d5d4dfe6533442188e38fa0b11742368246e37
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Fix PackageManagerService WTF in systemReady()

This resolves the following error:
F/SystemServer(31979): BOOT FAILURE making Package Manager Service ready
F/SystemServer(31979): java.lang.SecurityException: Unable to find app for caller android.app.ActivityThread$ApplicationThread@42171630 (pid=31979) when registering receiver android.app.LoadedApk$ReceiverDispatcher$InnerReceiver@420d1130
F/SystemServer(31979):  at com.android.server.am.ActivityManagerService.registerReceiver(ActivityManagerService.java:13157)
F/SystemServer(31979):  at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1506)
F/SystemServer(31979):  at android.app.ContextImpl.registerReceiverAsUser(ContextImpl.java:1481)
F/SystemServer(31979):  at com.android.internal.content.PackageMonitor.register(PackageMonitor.java:84)
F/SystemServer(31979):  at com.android.server.pm.UserManagerService.systemReady(UserManagerService.java:237)
F/SystemServer(31979):  at com.android.server.pm.PackageManagerService.systemReady(PackageManagerService.java:11305)
F/SystemServer(31979):  at com.android.server.ServerThread.initAndLoop(SystemServer.java:1022)
F/SystemServer(31979):  at com.android.server.SystemServer.main(SystemServer.java:1372)
F/SystemServer(31979):  at java.lang.reflect.Method.invokeNative(Native Method)
F/SystemServer(31979):  at java.lang.reflect.Method.invoke(Method.java:515)
F/SystemServer(31979):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
F/SystemServer(31979):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
F/SystemServer(31979):  at dalvik.system.NativeStart.main(Native Method)

TODO: Revisit this in the future when Google updates AOSP for multiple
system contexts.

Change-Id: I74be7a7a3ba1ede55a8ccae7c86e7650b27f435e
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Themes: Theme immersive mode cling.

Change-Id: I5521b93f69e859c40cfd62eb4a367562200074e9
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Fix SystemUI FC on applying a theme

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Fix Reboot menu not getting themed

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>