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
[3/3] frameworks/base: National Data Roaming

Credits: CyanogenMod

Linked commits:
        opt/telephony: https://gerrit.paranoidandroid.co/#/c/3655/
        services/Telephony: https://gerrit.paranoidandroid.co/#/c/3656/

Change-Id: I0280d516067e1ef50f7321355cbee42009657d7e

Conflicts:
	core/java/android/provider/Settings.java
Pie Settings (1/2)
Pie tile: add LongClick to go to Pie settings (1/2)
Only show status bar blocker view if nav bar is translucent.

It's the background drawable of the translucent nav bar that makes the
blocker view necessary (as the background creates a visual 'gap' between
status bar and visual start of the nav bar), so if the nav bar isn't
translucent, there's no need for the view.

Change-Id: I684c8d24abe3d4393ae7db88fe5023aa65836164
Rotation tile: Longclick action
Percent Battery: Clean up
Percent Battery: Add charging Animation

Credits:cyanogenmod
Do not block home button if incoming call is a background call

The user want to navigate ahead if it is a call in background.
So we allow it.

Change-Id: If40b8abba05b600191bfc1403f197e624fd7a360
PIE: Turn on HWA only if isHighEndGfx()

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
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
SystemUI: Do not use missing status bar icons

This commit simply makes sure the status bar elements that are not
found are not interacted with. The battery indicator icons were
already partially taken care of so this commit simply provides
a more complete safeguard.

Change-Id: Ic9cd154caf29d27f93a3c5c0598a826eb31165bf
Port "Option to hide Adb notification icon (2/2)"

Change-Id: I63bfb7e4b4f0ac4d4d4c3da68ea767e8a37babdd

Conflicts:

	core/java/android/provider/Settings.java
WallpaperCropper: respect max wallpaper width

Some devices with high resolution screen only support 2048px wide
wallpaper (used to be fixed in I5b25bd931db0b2610e260921f28b92d8b0966aa6)

Pre-KitKat this works as follows:

- Launcher calls WallpaperManager.suggestDesiredDimensions and we
  limit the maximum size in that function
- The wallpaper setting application calls WallpaperManager
  .getDesiredMinimumWidth and respects that size

However, after KitKat, it is all broken because WallpaperCropper
now calculate its own dimension and does respect the value set by
getDesiredMinimumWidth (and it calls suggestDesiredDimensions,
which is supposed to be reserved for Launchers!)

Attempting to restore wallpaper setting by:

- Having WallpaperCropper respect config_wallpaperMaxWidth
- Having CMWallpaper (which copy pasted code from WallpaperCropper)
  respect getDesiredMinimumWidth
- For third party applications, if they respect getDesiredMinimumWidth,
  then they will work, but if they don't (i.e. uses WallpaperCropper's
  code), then there's nothing we can do.

Change-Id: Ib7da12a1c70befbeef2f305593d3841acbc45243
AppWidget: Make widget update quickly

Can't display the Power control widget after power on DUT for
3 mins. Because of the  update intent is received after power
on DUT for 3 mins.

Set the intent to foregound

CRs-Fixed: 707605

Change-Id: I5418c84a7dc79466be7a30bb3672ea41976badb0
Update the volume panel color to match Hover

The volume panel slides in from the top currently making it look similar to Hove
r. As both the elements slide down from the top, there should be consistency in
terms of design.

Change-Id: Ifa4439f593b390014a3efb672bc2d00eef6fb869
Update Pie QS Icons

The current pie icons are pretty outdated and neither are they available in XXHDPI resolution. This change adds new icons in all resolutions.

Change-Id: I44d777e2976fb00b3b775ecf554fe5e0754c7197
On-The-Spot: Add Gif support

Now features can be explained in yummy animated goodness

GifView supports adding gifs programmatically or via xml using custom:gif=""

Change-Id: Ic1e383c11eb6b8a7a2200470fa31bb28dfc304f7
SystemUI: Do not use null value animators

This commit ensures that any null value animators that are
passed out from the transition generator are handled properly.

Relates to 'Make sure AnimatorSet avoids null animations'
(change id Icfd751b1abceccf7f1177680b86d30610471810e)

Change-Id: I04357e33cfe293c2a1329a7033a5acb53bfb5c85
systemui: Unbreak the planet

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

Change-Id: I0c534354a699f756d809aff10843ebea21f3f369