rename the custom lockscreen state action

Change-Id: I4ffadda9392e8ca8765e5b8ca47994e3a9990792
Add wallpaper pickers to seperate package [1/2]

Currently wallpaper pickers were part of the various launchers
and we were relying on Trebuchet's to add code for including
wallpapers from themes.  If Trebuchet is removed then this
functionality is lost.  This package is already included in all
builds so making the picker available here removes the dependency
on a specific launcher.

Trebuchet still contains a picker which should probably be removed
and make use of this package instead.

Change-Id: Ie42ae0e01f951a8293d13d6c8a73fde0dea6682b
CM11 Themes: remove handleThemeConfigChanges

This was used by the T-Mobile theme chooser and is no longer
needed with the new chooser.

Change-Id: I035606ffe6cb3efc82a3a0ce79215509d8289503
WallpaperPicker: Destroy cropview to avoid leaks

If the cropview's TiledImageRenderer is rendering threads, the activity
context gets leaked. Avoid that by invoking its destroy in onDestroy() of activity.

Change-Id: I0804c903d14d3f3d13529f0fe90d12784d97e93f
CM11 Themes: Don't set sys.refresh_theme on icon update

Change-Id: I5ed49ad2aa93974c54434e092946c4be7699131d
CM11 Themes: Properly handle themeing apps on install

Previously when an app was installed or re-installed it would not
pick up the currently applied theme.

mOverlays was not being properly updated and therefore newly
installed or re-installed apps would not pick up the currently
applied theme.

Change-Id: I7ce5454af11fb44e9a73b30858d893050b2fba8a
CM11 Themes: Handle legacy themes in createIdmapsForPackageLI

Change-Id: Iff42bac7bf84b9c739831775c8deef86adbdc0ca
CM11 Themes: Fix how common resources are found

During the boot process, application info may not be fully
available and createPackageContext can throw a null pointer which
causes a theme's resource-cache to be cleared.  If this theme is
in /system/app or /system/priv-app the theme will still be installed
but applying it will result in styles not being applied.

Change-Id: I4094bdd923edc1d829024404a4ce1b72709bd4f1
Themes: Support launcher based icon packs [1/2]

Before this patch, icon packs written for Trebuchet/Nova/Apex could not be used
with the new theme engine as the formats were different. Particularly the icon package IDs are 7F,
the same ID as as regular apps. Furthermore the location of resources in these icon packs was different
from what the theme engine expects. This patch adds support for these icon packs by overriding
the pkg id.

AssetManager now can override package ids without requiring aapt to recompile the APK.
Note: XML references will still use the original id compiled with AAPT, so it is only useful for resources
which do not use xml drawables (such as icon packs).

PackageInfo now has a new member identify "legacy" (3rd party icon packs) written
for launcher's like Trebuchet, Nova, and Apex.

Change-Id: Icd12c097e156c9626df0772abeb50e00f7b61f64
Send broadcast when package is 'about' to be removed

If a theme package is removed and it is the currently applied
theme, some apps will crash because the theme resources are
no longer available, since they were cleaned up by the package
manager.  The themes provider will receive this broadcast and
take care of switching back to the default theme for components
that are using the package about to be removed.

Change-Id: I968c25e19eb17ec87e7ddcba5ac0fd81745cef20
CM11 Themes: Allow defining a custom default theme [1/3]

Change-Id: I6b794d6c9c27b2d6436bdf4fec51c84a7859c134
CM11 Themes: Reduce "unable to load asset" log spam

With the introduction of a "common" resource folder for themes,
we always try to attach the common resource table and if it does
not exist it won't be attached but we would see this log spam.

Change-Id: Ida4e815523fd71b34fe8f3b41cef3432e6e07b64
CM11 Themes: Get proper package name in attachThemeAssets

Change-Id: Ic77ff41519b22e3b20c4571785a1368cdf4d14d2
Cleanup themes that fail to install

Themes which fail to install due to aapt or idmap errors
would not be properly cleaned up. This caused subsequent installs
to give a INSTALL_FAILED_UID_CHANGED (-24) error.

This patch also adds install error codes specifically for themes.

Change-Id: Ie03b92ca0a7dec8c4a5e3725b717943d36abb349
Themes: Fix -110 install error [2/2]

aapt was being called from PM with a ' ' at the end of the cmd. This would
cause installd to read unexpected parts of memory which sometimes
causes it to parse the command incorrectly.

Change-Id: I85bf93045370478fd9baaf5db784c0cc3a4a03b9
CM11 Themes: Expose applyDefaultTheme to public service

Change-Id: I952870fb984d51d554e560566a8cadbe2c49cc6b
Avoid app install failures from malformed themes

When an app is installed we create idmaps between it and all the themes
that theme the app. If the theme is really badly written it could
potentially fail idmap generation, but we should not block the app
itself from being installed just because a bad theme is on the device.

Change-Id: I0e38fd373dfd294aac17fab1cf07ba49934a8859
CM11 Themes: Fix applyDefaultTheme implementation

Change-Id: I718be5db58166df48cca5578d6ad5088b91bc1e2
persist the changed position values in updateWallpaperOffsetLocked, even with a null mWallpaperTarget

Change-Id: I175773f6e0b3f91c1d983857028a89b959e4e9f2