Sync with CM; remove leftovers from old theme engine; remove HeadsUp notification
Protected App [1/3]
 PackageManager:
   Add support for Protected App Components
   Adding protect flag to ApplicationInfo

 SettingsProvider:
   New DB entry for protected app components

Change-Id: If04843e93b572191d4654c01f4da8f087ba9fba8

Conflicts:

	core/java/android/content/pm/PackageManager.java
	services/java/com/android/server/pm/Settings.java
Themes: Get resources with an explicit theme attached.

Change-Id: If04e82a13250f520d70b58991586c8ce38f0ecb1

Conflicts:

	core/java/android/app/ResourcesManager.java
Add getThemedResourcesForApplicationAsUser()

Change-Id: I90b7cb441e4056f59b7260ffa55e31eba644e25a
Clean up and CM sync
Allow icons in shared restables to be themed

Example
Google Drive's package  name: com.google.android.apps.docs
Google Drive's restable name: com.google.android.apps.docs.common

Before this patch we used resource table name to get the package info. For
app's like google drive this return a null package info and the icon would not be themed.

So instead of usnig the restable name, this patch creates a package name
in AssetManager that is set by getTopLevelResources.

Change-Id: Ic51b93f6c7ea0a32197682998c6d0aa36d774845

Conflicts:

	core/java/android/content/res/AssetManager.java
CM11 Themes: Common overlay for sharing resources. [1/2]

This patch will allow themes to contain common resources
which can be shared by all overlays.

Common resources will reside in assets/overlays/common and
can be referenced by other overlays.

Common resources will be referenced using the common package
name, i.e. To reference the common drawable some_drawable for
com.example.theme the theme designer would use
"@*common:drawable/some_drawable"

Change-Id: I395b6bd5eae91b00265a8e9221856ef7bf5d115a

Conflicts:

	core/java/android/app/ResourcesManager.java
	core/java/android/content/res/AssetManager.java
	services/java/com/android/server/pm/PackageManagerService.java
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

Conflicts:

	core/java/android/app/IconPackHelper.java
	core/jni/android_util_AssetManager.cpp
	include/androidfw/AssetManager.h
CM11 Themes: Get proper package name in attachThemeAssets

Change-Id: Ic77ff41519b22e3b20c4571785a1368cdf4d14d2

Conflicts:

	core/java/android/app/ResourcesManager.java
Themes: Handle apps using "original-package" tag

Before this patch the themes code assumed the pkgName from PackageInfo was equal to the
manifest value. This is not the case however for upgraded system apps that have gone
through a pkg-name change. For example, Trebuchet was "com.android.launcher3" and now
it is "com.cyanogenmod.trebuchet". If the device had wiped data then PM would use the new
pkg-name, but if the system apps were being upgraded then PM would use the old name which is
now different from the manifest name.

Change-Id: Ie7eb1b4e17899d1055535dc890d4f7a7bca9a98a

Conflicts:

	core/java/android/app/ResourcesManager.java
CM11 Themes: Add support for composed icons [1/2]

If an icon pack includes background, mask, and/or foreground
images and an icon is not included for a given app, an icon
will be generated using the background, mask and foreground.

Icon packs can include the following items into their
appfilter.xml
    <!-- Set deafult scale factor for the icons -->
    <scale factor="1.0" />

    <!-- Set back image for composed icons -->
    <iconback img="iconback" />

    <!-- Set the mask image for composed icons
         Original icon will be masked off using this mask -->
    <iconmask img="iconmask" />

    <!-- Set foreground image for composed icons -->
    <iconupon img="iconupon" />

Note: Mutliple iconback images can be used as follows
    <iconback img1="iconback1" img2="iconback2" img3="iconback3" />

Change-Id: I0f5fd7de4f0eae485139cbcd282c1d1e1663952f

Conflicts:

	core/java/android/app/ComposedIconInfo.java
	core/java/android/app/IconPackHelper.java
	core/java/android/content/pm/IPackageManager.aidl
	core/java/android/content/res/Resources.java
	services/java/com/android/server/ThemeService.java
	services/java/com/android/server/pm/PackageManagerService.java
Themes: Don't set icons for iconpack that is applied.

Change-Id: I3cffade2c12ae1dbc1f75e43f1a74609ff0d7135

Conflicts:

	core/java/android/app/ResourcesManager.java
Themes: Get resources with an explicit theme attached.

Change-Id: If04e82a13250f520d70b58991586c8ce38f0ecb1

Conflicts:

	test-runner/src/android/test/mock/MockPackageManager.java
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
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

Conflicts:

	core/java/android/app/ResourcesManager.java
	core/java/android/content/pm/ThemeUtils.java
	core/java/android/content/res/Configuration.java
	core/java/android/content/res/CustomTheme.java
	core/java/android/content/res/ThemeConfig.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/AppsLaunchFailureReceiver.java
	services/java/com/android/server/SystemServer.java
	services/java/com/android/server/ThemeService.java
Catch all exceptions when retrieving ComposedIconInfo

It is possible to receive a TransactionTooLargeException when
getting the composed icon info from the package manager service.
We should catch these exceptions to avoid unnecessary crashes.

For reference:
The Binder transaction buffer has a limited fixed size, currently 1Mb,
which is shared by all transactions in progress for the process.
Consequently this exception can be thrown when there are many transactions
in progress even when most of the individual transactions are of moderate size.

see http://developer.android.com/reference/android/os/TransactionTooLargeException.html
for more details.

Change-Id: I70d35dc4926125bfbef5d8c5fb8ed6d6fcdbf159
Themes: Load correct common resources

In order to support theming separate packages we need to make sure
we load that theme's common resources.  We were currently loading
the system wide theme's common resources which is incorrect for
package level theming.

Change-Id: Ie594458be9b6b3f4a25c56c9c5c9ba5bd8cf063a
Fix derp
CM11 Themes: Add support for composed icons [1/2]

If an icon pack includes background, mask, and/or foreground
images and an icon is not included for a given app, an icon
will be generated using the background, mask and foreground.

Icon packs can include the following items into their
appfilter.xml
    <!-- Set deafult scale factor for the icons -->
    <scale factor="1.0" />

    <!-- Set back image for composed icons -->
    <iconback img="iconback" />

    <!-- Set the mask image for composed icons
         Original icon will be masked off using this mask -->
    <iconmask img="iconmask" />

    <!-- Set foreground image for composed icons -->
    <iconupon img="iconupon" />

Note: Mutliple iconback images can be used as follows
    <iconback img1="iconback1" img2="iconback2" img3="iconback3" />

Change-Id: I0f5fd7de4f0eae485139cbcd282c1d1e1663952f

Conflicts:

	core/java/android/app/IconPackHelper.java
	core/java/android/app/ResourcesManager.java
	core/java/android/content/pm/IPackageManager.aidl
	core/java/android/content/res/Resources.java
	services/java/com/android/server/pm/PackageManagerService.java
Cleanup obsolete stuff