Themes: Only kill launchers if overlays or icons changed

There is no need to kill the launcher for every coponent changed.
The only ones that really concern us in regards to killing launchers
are MODIFIES_OVERLAYS and MODIFIES_ICONS

Change-Id: I840b8e2ecd4b52a33f352809c5d3d2c7e92ce85e
Themes: Update provider with components that were applied

There may be times when one or more components do not get applied
so we should remove them from the component map and then update
the provider after all changes have been made.

Change-Id: I75d2a674d84c6a0de3f0b613d1dfc50654c2d181
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
Allow granting permissions based on signature in <allow-permission/>

This patch allows us to either specify a sharedUserId or a package
signature to use when granting the specific permission.

Change-Id: I8aed78d40316e0e94ac1bfefc7c4a3016a2a9a6b
Fix attribute resolution in theme lookup

[Fixes Known Issues]
1. (CM) Chrome beta crashing w/ Hexo applied and menu button is pressed.
2. (AOSP) TextAppearance - fontFamily attr is incorrect (looked up in wrong package!) when
    a string value is defined in a style, and that style is set as the app's theme.

[Terminology]
1) Theme:    is the standard android definition of a theme.
             e.g in your manifest you may set android:theme="@style/foo"
2) CM-Theme: will be a Cyanogen theme. e.g. "Hexo"

3) Block: Also called index. Can be considered the cookie or ID to lookup a package in the resources.
          When a CM-Theme is applied, block 0 is framework, block 1 is the app, and block 2 is the
          CM-Theme.

[Background]
When a value for an attribute has not been found, the last resort is to look at a theme's base value.
This is done by using theme->getAttribute(...) which will return the value. The value is
unresolved if its a reference type. The block value will also be returned.

Since the value may be a reference and therefore unresolved, a call is then made to
ResTable::resolveReference(..) to do the final resolution. As part of its input, resolveReference
takes a block as a starting point.

In the case where resolveReference(...) is asked to resolve something that is not a reference,
for example, a string type, then it will simply return the same value and block. *Important* The block
value is then saved for the next call to get an attribute value. So if this block value is wrong
it will remain incorrect.

Therefore if resolveReference is passed the wrong starting block with a string value, then the wrong
block will be returned.

[Example]
1. 0x0101009b (android:attr/textColorLink) is first attribute to be looked up.
2. textColorLink has a value of 0x01020123 which maps to theme id 0x01020111. The block for theme
is "2" so block is set to 2. The value for this attribute is put into the array.
3. 0x010103ac (android:attr/fontFamily) is the next attribute to be looked up.
4. fontFamily is found in the theme as type string. The value is 0x7b9 (1977) and newblock variable
   is set to 1 since this value is found in the app's string pool. The block variable still == 2.
5. resolveReference() is called with block=2. The function does nothing and returns block=2.
   The fontFamily thus is stored wtih value=1977 and a block value of "2" instead of "0".

Change-Id: I2b979911b1b8ffb79c4cf310ae60682c84c11fcb
FB: Slimrecents card/text color [2/2]

Allows user to set custom colors for Slimrecents card
    header text and background.

PS: fixed expanded card (thumbnail) background
Change-Id: I896a4db4ce235dc53858381347379d5fd7f7e796

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values-holodark/colors.xml
	packages/SystemUI/res/values/mahdi_colors.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Themes: Only process themes that are applied during boot

Currently, the PackageManagerService will process all themes and
ensure their resources are compiled and available to the system.
This is highly inefficient and can bog the system down when booting.

This patch will only process the themes that are currently applied
durring boot and lets the ThemeService take care of queuing up the
others for processing.   This reduces boot time considerably,
especially when the user has many themes installed.

Change-Id: I52168a1751ad3bfc458048dd1558ad71cc16317a

Conflicts:
	core/java/android/app/ApplicationPackageManager.java
	core/java/android/content/pm/IPackageManager.aidl
	core/java/android/content/pm/PackageManager.java
	services/java/com/android/server/ThemeService.java
	services/java/com/android/server/pm/PackageManagerService.java
	test-runner/src/android/test/mock/MockPackageManager.java
systemui: Unbreak the planet

 * Not sure who to blame, but it's probably themes... :)

Change-Id: I0c534354a699f756d809aff10843ebea21f3f369
PIE from ParanoidAndroid [1/2]

PS1: Inital Cherry-pick and removed Pie Tile
PS2: Switch Dupes to PA_Pie
PS3: Switch all the things to PA_Pie
PS4: Link strings properly
PS5: Remove last WhiteSpace

Change-Id: Icb8aa21574722686a2889ea813e87446c6a1b50c

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values-land/dimens.xml
	packages/SystemUI/res/values/mahdi_colors.xml
	packages/SystemUI/res/values/mahdi_dimens.xml
	packages/SystemUI/res/values/mahdi_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Frameworks: Implement Dynamic System Bars (1/2)

This commit implements DSB. Simple as that.

Change-Id: I3bc7102b2139fd1fa3de22aac096bd2a75bde878

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

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/layout/msim_status_bar.xml
	packages/SystemUI/res/layout/status_bar.xml
	packages/SystemUI/res/values/config.xml
	packages/SystemUI/res/values/cr_config.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java