Themes: Use INSTALL_LOCATION_INTERNAL_ONLY for legacy icon packs

If an icon pack is currently applied and is installed using forward
locking, the system will crash when the pack is updated.  Several
applications can have the pack attached to their resources and this
causes the system to crash because it cannot unmount the asec container
to finish the post install process.  Installing these packs to internal
storage without forward locking alleviates this issue.

This is done with theme packs as well, including legacy themes.

Change-Id: I155fc0bd671f3f9baaf2565d1c4d654a0a5348dc
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Theme IME switcher alert dialog

Change-Id: I5344e9ddbacb1520080532d9cc1a7a5f5428e131
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Themes: Use first asset entry for lockscreen wallpaper

The current implementation assumes the wallpaper will be named
either wallpaper.png or wallpaper.jpg.  If this is not the case
the wallpaper is not applied.  This patch implements the lockscreen
wallpaper the same way that the regular wallpaper is done.

Change-Id: I9f3dd299c1e61158fa53c163f7e42e21e2f9b1dc
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Themes: Use default_wallpaper for HOLO lockscreen wp

Change-Id: I9c7fd29c99d13e811993eb9b3b045010431ccad0
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Themes: add ability to theme quick settings battery tiles

This is to make the battery tiles more uniform to the rest
of quick settings and also allow the background to be themed

http://i.imgur.com/AA5bkMK.png

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

Conflicts:
	packages/SystemUI/res/layout/quick_settings_tile_battery.xml

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
PhoneStatusBar: Readd headsup view when theme change occurs.

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
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
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Use ArrayListExtra for broadcasting theme changes [1/2]

Change-Id: I897cfbbe293b73f9e8f069f4b4cefa7c3ffb79ed
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
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.

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/SystemServer.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/am/ActivityManagerService.java

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Add getThemedResourcesForApplicationAsUser()

Change-Id: I90b7cb441e4056f59b7260ffa55e31eba644e25a
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
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.

Change-Id: I1e619f038566233bd89ee96eb8eb87fa6894e630
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
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.

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java