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
Fix layout recreation check

Change I7d6b088a9235362e03cb6694392df71bbf5a323a added a relayout
for programmatic text direction changes, but this is breaking some
fixed layouts. Make sure layout params exist before trying to
act on them

Change-Id: Ibfe3daa71490d109c9a4bdc4c90cbf9517e53260

Conflicts:
	core/java/android/widget/TextView.java
TextView: Check also for mLayoutParams before calling checkForRelayout

Cherry-picked from OmniROM.

http://jira.omnirom.org/browse/OMNI-976

This was introduced with
https://github.com/omnirom/android_frameworks_base/commit/b3670c54e60387fde633fb91c649c5b896f8b962

Change-Id: I06c1926c5b8102b336d128d9b411f74a9eff3ded

Conflicts:
	core/java/android/widget/TextView.java
Fix can't change airplane mode from GlobalActions.

A PhoneStateListener is registered in the constructor of
GlobalActions which, on rare occasions, leads to a callback being
received immediately. In these cases because mHasTelephony has not
been initialized, airplane mode is not refreshed in the callback
which disables the option to set airplane mode from GlobalActions.

To fix this issue mHasTelephony has to be set before registering
the listener.

Change-Id: If117a879d3244414b369a1711bf46526b7a5ae24
listview: ensure active views are filled prior than scrap views

The internal Recycler#fillActiveViews should be called prior to add any view
to the scrapViews queue, so it can be use safely without detaching views
because out of sync.

Change-Id: Ie119ad871a89e0a3fa1e07e955fcd5ca7b171f46
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
hwui: Always enable the scissor while composing layer

Due to scissor optimization feature added in KK, scissor was disabled
all the time. Hence the undefined areas/region of textures are not
masking properly with GL_LINEAR filter mode.

Change-Id: Ifbbde2c67a4c01e45eda07ada709e066255fffcb
CRs-fixed: 645077
Themes: Don't set icons for iconpack that is applied.

Change-Id: I3cffade2c12ae1dbc1f75e43f1a74609ff0d7135
Themes: Don't kill launchers that handle the theme change

Change-Id: I5e3a7ea2455a4c407928bb5c90b7fc4e5906aa73
Floating window: Fix possible NPE
Avoid possible NPE if app provides no interface such as pushbullet's
test notification & other apps which provide one.

Change-Id: I5e97ec300e30dc290899f94b745255d55ff52398

Conflicts:
	packages/SystemUI/res/values/cr_strings.xml
Themes: Add categories to theme change intent.

The following categories are available:

org.cyanogenmod.intent.category.MODS_HOMESCREEN
org.cyanogenmod.intent.category.MODS_LOCKSCREEN
org.cyanogenmod.intent.category.MODS_ICONS
org.cyanogenmod.intent.category.MODS_FONTS
org.cyanogenmod.intent.category.MODS_BOOTANIM
org.cyanogenmod.intent.category.MODS_NOTIFICATIONS
org.cyanogenmod.intent.category.MODS_ALARMS
org.cyanogenmod.intent.category.MODS_RINGTONES
org.cyanogenmod.intent.category.MODS_OVERLAYS

Change-Id: Ic444278d1d712cb6207bb10574a471524a8fed41
Hover: disallow notfications from currently active app

This commit stops hover showing a notification is from the same app as what is currently running in the foreground.

TO DO:
Add a settings switch
PEEK: Sensors improvements

- Bring some fixes to the algorithm thanks to @D4rKn3sSyS
- Cleanup

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>