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
(cherry picked from commit 0b02a881476465295cf712b4e012ac6e795b0b3e)
CM11 Themes: Handle legacy themes in createIdmapsForPackageLI

Change-Id: Iff42bac7bf84b9c739831775c8deef86adbdc0ca
(cherry picked from commit 7f011fc48676901c12f0ccec61768e21b1c7ad9a)
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
(cherry picked from commit 86348683c782f088b786197adf1ce68691581fa4)

Conflicts:
	core/java/android/content/res/AssetManager.java
Merge "CM11 Themes: Don't set sys.refresh_theme on icon update" into cm-11.0
(cherry picked from commit b400cf4f9991df936a9f9c73402170a05f221de1)
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
(cherry picked from commit 238e80a5c7edcb922ce15feebec74ea2475c31cb)
Merge changes Iff42bac7,I7ce5454a into cm-11.0

* changes:
  CM11 Themes: Handle legacy themes in createIdmapsForPackageLI
  CM11 Themes: Properly handle themeing apps on install

(cherry picked from commit 577b3c44a10c47a1fc93f686b74b1d109429ffc6)
CM11 Themes: Allow defining a custom default theme [1/3]

Change-Id: I6b794d6c9c27b2d6436bdf4fec51c84a7859c134
(cherry picked from commit c65b0e61fb222e8ae1002f0af13ee110a1bb9b52)

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