Make sure ThemeConfig is non-null when loading resources

When the device boots into safemode, the theme config will end up
being null and we need to check that prior to using it to retrieve
resources for the StatusBarIconView

This fixes CYAN-5009

Change-Id: I1a90bc9f9c65cb41a6e58947bbd1b6d7728a952b
Themes: Add ability to apply color filters to composed icons

Themes can include one or more of the following filter tags in
assets/icons/res/xml/appfilter.xml

    <!-- HUE filter
         Integer value between -180 and 180 representing the degree.
         0 = no change
    -->
    <filter name="hue">0</filter>

    <!-- SATURATION filter.
         0 = grayscale, 100 = no change, 200 = over saturated
    -->
    <filter name="saturation">0</filter>

    <!-- BRIGHTNESS filter.
         0 = pitch black, 100 = no change, 200 = 200% brightness
    -->
    <filter name="brightness">100</filter>

    <!-- CONTRAST filter.
         -100 = minimal contrast, 0 = no change, 100 = maximum contrast
    -->
    <filter name="contrast">100</filter>

    <!-- ALPHA filter.
         0 = transparent, 100 = opaque
    -->
    <filter name="alpha">75</filter>

    <!-- INVERT filter.
         Valid values are true or false
         true = invert colors
    -->
    <filter name="invert">false</filter>

    <!-- TINT filter.
         A hexadecimal value representing ARGB
    -->
    <filter name="tint">#ff0000ff</filter>

Change-Id: I2431237dd2766176be16c730020557ce87d623e4
Merge branch 'kk' of github.com:SimpleAOSP/android_frameworks_base into kk
Frameworks: network traffic color option (1/2)

Change-Id: I94f28e12cffb46fb36d2b311319bdbd7213d4d7c

Conflicts:
	core/java/android/provider/Settings.java
Over scroll effects [1/2]

Change-Id: I4cc67715f8f3bc67674782f08b9e363ee0e8ac9e

Conflicts:
	core/java/android/provider/Settings.java
	core/java/android/widget/AbsListView.java
StatusBarView: Ensure to not overload in/out animations

- Post animate call in main thread, thanks @David96
- Handle animation checking current view visibility

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Signed-off-by: David L.-W. <xD_e-mail@gmx.de>
StatusBarView: Avoid unnecessary calls to mHandler.post()

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Signed-off-by: David L.-W. <xD_e-mail@gmx.de>
Themes: Fix icon filters clamping to wrong values

Change-Id: Iab3cce465f8bdfd7c30a020fda254728349c5ebe
Themes: Make sure composed icon info is meaningful

We don't want to try and create a composed icon if the parts that
make up a composed icon are not valid or set.

Change-Id: I3d9e7432e4b351de9c0a4e662e028932ee7f08e2
Reduce memory leaks by removing all views.

Change-Id: I64b95981425840d101c8122421281976d0251bae
base: Add a key combo to start/stop video recording

Press volume up and power to start recording a video of your screen.
Press this key combo again to stop it.

PS2: rebased

Change-Id: Id0b13ba1092a1d6e0bf7bff5f14d89764cdf370c
Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	packages/SystemUI/AndroidManifest.xml
	packages/SystemUI/res/values/cm_strings.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Screenrecord: Create the Screenshots directory if it doesn't exist

Change-Id: I2b0458eed024dbda97e9e1ea3426c12d29add781
Power Menu: Add Screen record Option

Adding Screen Record menu entry and Functionality to Power Menu

Change-Id: I715cd91f2db7688ed2ebea18d219090aab4aebcd
Note: Screenrecord is broken on exynos based devices. Trying to record screen will result in device freeze

PS1: Adding Drawable resources for displaying in power menu. Courtesy: ChameleonOS
Change-Id: Ia34f68827576c5bc982f0377929376fa0d9b404d

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/strings.xml
	core/res/res/values/symbols.xml
	policy/src/com/android/internal/policy/impl/GlobalActions.java
SystemUI: Add RECORD_AUDIO permission

Change-Id: I5af3cbe31f182c8b5cf1633aaf8a16db2856a425
SystemUI: Add missing sound permissions for screen recording

Change-Id: If948aabfd5c2e09f192f12aa02830d39346d2c6c
Power menu: standarize capitalization for Screen record

Change "Screen Record" to "Screen record" to match the standard menu
styling.

Change-Id: I61c7adfe06c1d5ebc53c1c0b15b76e6d28a749f4
base: screenrecord: update notification

Update show/hide pointer button for actual state

Change-Id: I02090f05b06896248483f3f9ff2eb22924a22476

Conflicts:
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/simpleaosp/screenrecord/TakeScreenrecordService.java
screenrecord: Fix SystemUI loop-crash

Change-Id: I25045820465d21b7d1f0e933e5e4f3324cb044b6
Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/simpleaosp/screenrecord/TakeScreenrecordService.java
Media process is crashing with NullPointer exception

Sometime, while creating thumnails list of media files in
compose MMS->attach file,  filepath may be null due to
synchronization issue.
Adding NULL check to avoid NUllPointer exception.

Change-Id: Id6cf5612a959b3ae15b44bc60dbbcbe40c624f09
CRs-Fixed: 636494
Themes: Fix blurry composed icons

In a composed icon the original icon could be scaled incorrectly
due to a density mismatch resulting in blurry icons.

For example, Grouper has a screen density of 213 dpi but Trebuchet will want to show a larger icon and therefore
requests to the framework to load app icons with a slightly higher density of 320dpi (XHDPI bucket).

When Resources.loadDrawable(TypedValue value, ...) is called, it will use observe value.density. Since the image
is from the XHDPI bucket it will have a TypedValue.density of 320dpi, much higher than the screen's 213dpi, and therefore
loadDrawablei() will configure BitmapFactory to scale down the image to match the screen density. This is not what we want,
so this patch modifies the density value to prevent scaling, much the same way getDrawableForDensity() does.

Change-Id: Ie638c8576872f9115dc029bb4823b50bb31ecebf