Add CPU boosting hooks

 * Send boost hint during scrolling
 * Still relevant on even high-end hardware

Change-Id: I72f2c2851b01fbceabddead03a4c3a7a0526ca61
SystemUI: Pimp-up QuickRecord Tile

PS2: Don't close dialog on deletion,
	keep active but notify
	user that file was deleted.

Change-Id: Iafef30a7f75b7131cc8779784bff1ef9f7042fac
SystemUI: Battery View Fixes

Fix inconsistent battery tile showing
	if battery is disabled in statusbar

PS2: Immediate update on inflate

Change-Id: I84618fb585eb700409932177041fa8ca3cadf92a
Framework: Allow All Widgets On Keyguard (1/2)

Change-Id: I2f25d403740a9ee8822c684436bc28283c356f6c
fb: translation - RU

Iafef30a7f75b7131cc8779784bff1ef9f7042fac

Change-Id: Id157621347ca4e2177403d5505cee405ee945aa6
FB:  Add transparency to Glowpad background [2/3]

Adds the option to make glowpad view background transparent on incoming call so the caller's entire picture can be seen.

PS3: Fix File Permissions

Change-Id: I0c6d883b86f05055fbf5865ea98f6cb144da7b27
Framework: Pulse Torch On Incoming Call (4/4)

Move our SliderPreference to framework for
	global usage

Add some torch constants

Add Settings entries

Change-Id: I3bf8e3d140ef507e2a72e3abbdad6ec1603dfbc3
fb: translation - RU

I3bf8e3d140ef507e2a72e3abbdad6ec1603dfbc3

Change-Id: I994a04555dd0666fd8204c7dedd67b15272f5f8c
Framework: More shake sensitivity adjustments (1/2)

Change-Id: I99b2c5577455e4b3c9c8bdac7cea94291182376b
Framework changes for moving applications to external volume

* Add static functions for retrieving external apps volume information
* Determine external apps volume using the 'externalApps' attribute in
  storage_list.xml
* Allow moving applications to an external volume regardless if the
  internal storage is emulated or not
* Check if app moving is disabled

Thanks to Pierre-Hugues Husson for identifying an issue causing the
SD card state to be incorrect (ie. SD card appearing unmounted when a
USB drive is unplugged)

Change-Id: I5561c2cf3f558b729c89663852173a532994a47a
frameworks: Add class for changing app moving setting

Change-Id: Ic9f0eed496f014fdc110946759e2041ef808e5c4
Fix DE translation derp

Change-Id: I77b4588aabb1138f74bcd3d0f7bda285c1c3d58d
Squashed Commit of New Theme Engine

Updated 4.2 support for the old T-Mobile theme engine, as usual
needs the provider and switcher apps installed as well.

I'm finally dropping the 400+ commit history on this, since everybody
else keeps picking it up from CM as a single patch anyway... But
for the record, nothing of this would be possible without Josh, Ed,
and the rest of the TMo guys who wrote and maintained it until 2.2:

amit chabra <amit.chabra@t-mobile.com>
Amit Kohli <amit.kohli@t-mobile.com>
Chris Cogar <chriscogar@t-mobile.com>
Dirk Sigurdson <dirk.sigurdson@t-mobile.com>
Ed Carrigan <edward.carrigan@t-mobile.com>
Gaurav Sharma <gaurav.sharma3@t-mobile.com>
Hui Feng <hui.feng@t-mobile.com>
John Ritz <john.ritz1@t-mobile.com>
Josh Guilfoyle <josh.guilfoyle@t-mobile.com>
Mark Roberts <mark.roberts48@t-mobile.com>
Pankaj Kumar <Pankaj.kumar6@t-mobile.com>
Samuel Cheung <samuel.cheung@t-mobile.com>
Sergey Ten <sergey.ten6@t-mobile.com>

Change-Id: I7148d51be48f28a2dc4bdf9ec9018f04b268ffc4

Conflicts:
	core/java/android/app/ResourcesManager.java
	core/java/android/content/res/Resources.java
	include/androidfw/AssetManager.h
	libs/androidfw/AssetManager.cpp
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	services/java/com/android/server/NotificationManagerService.java
	services/java/com/android/server/SystemServer.java
	services/java/com/android/server/UiModeManagerService.java
	services/java/com/android/server/am/ActivityManagerService.java
	services/java/com/android/server/connectivity/Tethering.java
	services/java/com/android/server/wm/WindowManagerService.java

Framework: Remove orphaned Theme related code

Change-Id: I930d4cc75e655c5bc37532e6a1425d27bd1ee661

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

PackageManager: Let com.tmobile.thememanager access privileged permissions

Needed for CHANGE_CONFIGURATION

Change-Id: If50b0926d77e15e18ef5e88d7efac1b7f209d6e4

PackageManager: Prevent themes from going into ASEC containers

Themes on ASEC cause all kinds of random timing/racey issues at boot
time, and more kinds of racey concurrency issues at uninstall/upgrade
time. Stop them from getting into containers at all.

Change-Id: If08e90c51137b22239831a4eca17ea00d5d87d93

ResourcesManager: Fix theme insertion at boot

This was lost during the 4.4 ActivityThread reshuffle, put it back

Change-Id: I96eadf691973e9a2daa099b55816fc103d129be7

SystemUI: Reinflate on theme change

Reflect the updated assets immediately once the config_changed
notification happens

Change-Id: I480a719fbdd45875277871af39ce65849918ec0a

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java

platform: Fix the gid for the theme manager service

It was mismatched with fs_config, resulting in attribution of the
"-1" gid

Change-Id: Ia6d55af0b39f659da2965f9bc0bda0df5c775ba4

ThemeUtils: Retain the original package name in themed UI context

In order for themes to reflect on system elements, we're changing
their context, including the package name.

This breaks anything that tries to identify system elements,
most notably any users of the uiautomator. Trying to do
'UiSelector().packageName("android")' to find, for example,
a force-close dialog will fail.

Fixes com.android.cts.uiautomatortest.CtsUiAutomatorTest#testUiWatcher

Change-Id: Ic05c3024b20ac3772ed5597846fbfa4a184ebb0d

AssetRedirectionManager: Accept redirections only for whitelisted resource types

Change-Id: Idf1ea739a81719b6a196f0114c9fc3b7c7ff428c

AssetRedirectionService: Check for permissions before running dump()

Fix android.security.cts.ServicePermissionsTest failure

Change-Id: I9d629d19f3ff231db477d156c8bf557d4b8ee861

Fix theme provider crashing for non-primary user.

PackageManagerService's context is for user 0, so if the theme provider
for other users was invoking the getInstalledThemePackages() method, the
themes provider crashed as it doesn't have the INTERACT_ACROSS_USERS
permission.
Fix that (and simplify code) by making getInstalledThemePackages()
return the installed themes for the current user, which was probably the
intent anyway.

Change-Id: I02002cee005b74128f3b2f7cc7a93b9b8514f1f3

Check themes of current user, not user 0.

Change-Id: I5d685a04289b434a12e460b4fdacc43a41ff2be1
JIRA:CYAN-1303

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/pm/PackageManagerService.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java

AssetAtlas: Fix NPE when there are no preloaded resources

Conflicts:
	core/java/android/app/ActivityThread.java
	include/androidfw/AssetManager.h
	libs/androidfw/AssetManager.cpp
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/am/ActivityManagerService.java
	services/java/com/android/server/pm/PackageManagerService.java
	services/java/com/android/server/wm/WindowManagerService.java

Conflicts:
	core/java/android/app/ActivityThread.java
	include/androidfw/AssetManager.h
	libs/androidfw/AssetManager.cpp
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/am/ActivityManagerService.java
	services/java/com/android/server/pm/PackageManagerService.java
	services/java/com/android/server/wm/WindowManagerService.java

Remove T-mobile items not used by new theme engine

Change-Id: I1e9c14e63ec25fdff61cfd2b7b8a05b1e488e558

Conflicts:
	core/java/android/app/ResourcesManager.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/pm/PackageManagerService.java

Conflicts:
	services/java/com/android/server/pm/PackageManagerService.java

Conflicts:
	core/jni/AndroidRuntime.cpp

New command line tool 'idmap'

Introduce a new tool 'idmap' to handle generation and verification of
idmap files. The tool is modelled on 'dexopt', and is intended to be
used similarly, notably by 'installd'.
See cmds/idmap/idmap.cpp for further documentation on 'idmap'.

Note: this commit is interdependent on a commit in project build/ to add
'idmap' to PRODUCT_PACKAGES.

Note: the changes to androidfw are only stubs. The actual implementation
will be provided in Runtime resource overlay, iteration 2.

Change-Id: I7131b74ece1e46c8a9c0a31d103e686aa07da2bb

Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

    <overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
   Initial AssetManager object created
+    idmap --scan creates idmaps for overlays targeting 'android', \
           stores list of overlays in /data/resource-cache/overlays.list
   AssetManager caches framework-res.apk
+  AssetManager caches overlay packages listed in overlays.list

Android boot
   New AssetManager's ResTable acquired
     AssetManager re-uses cached framework-res.apk
+    AssetManager re-uses cached 'android' overlays (if any)

App boot
   ActivityThread prepares AssetManager to load app.apk
+  ActivityThread prepares AssetManager to load app overlays (if any)
   New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

    <overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

        +------+------+-     -+------+------+
        | 0x01 |      |  ...  |      | 0x7f |
        +------+------+-     -+------+------+
            |                           |
        "android"                Target package A
                                        |
                       Pre-installed overlay B (priority 1)
                                        |
                       Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Conflicts:
	include/androidfw/AssetManager.h

Runtime resource overlay, iteration 2, test cases

Add automated test cases for runtime resource overlay, iteration 2.

The test cases are a mixture of 'adb shell' commands and regular
instrumentation tests. The device is rebooted between tests to setup
different overlay scenarios for framework-res.apk.

To verify Runtime resoure overlay, iteration 2, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py

For a list of supported options, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py --help

Change-Id: I692aa1a7ad073efd116b24f9ec7f197dfd65dfef

New Theme Engine [1/6]

[Summary]
Took the T-mobile theme engine, replaced redirection mechanism with a modified Sony idmap and then extended the feature set.

The new theme engine allows the following:
1. Simple creation of themes by compiling on the device
2. System level icon packs.
3. Font packs
4. Swappable boot animations
5. Lockscreen wallpaper
6. Alarms
7  Of course all the things the previous engine could do including skins, ringtones and
notifications. There is also legacy support for old themes.

[Theme Format]
For the time being themes are APKs with all theme elements in the assets folder. Since these resources
are compiled at runtime there is no reason we can't change it to a zip but creating an APK is well
understood by themers.

The directory structure looks like this:

AndroidManifest.xml
src/
res/
assets/
  boot-animation/
  fonts/
  icons/
    res/ (note: same dir structure as res/ in trebuchet icon packs)
  wallpapers/
  ringtones/
  notifications/
  alarms/
  overlays/
      [target-pkg-name1]
          res/
           drawable/
           drawable-hdpi/
           ...
           layouts/
           xml/
      [target-pkg-name2]
          res/

Where [target-pkg-name] is the package of the app you are trying to overlay. For example, to overlay
facebook's app you would make a directory under overlay called "com.facebook.katana". For frameworks
resources use the target name "android".

Under each target pkg is a res/ folder which follows the same format as a typical APK's res/. During
install time AAPT will actually compiling these res/ folders individually.

There are also non-overlay folders like boot-animation, wallpaper, fonts etc.

A theme APK is identified by meta-value data in AndroidManifest.xml. Here is an example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.me.andytheme2"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-feature android:name="org.cyanogenmod.theme" />
    <meta-data android:name="org.cyanogenmod.theme.name" android:value="My Blue Theme"/>
    <meta-data android:name="org.cyanogenmod.theme.author" android:value="John Doe" />
</manifest>

By using meta-data we do not require special new tools.

[Changes to PackageManagerService]
During install time PackageManagerService will scan meta-data values in the manifest. If it finds
a meta-data name of "org.cyanogenmod.theme.name" then it will assume the APK is a theme and mark it as such.

Then PM will find all overlays from the theme. For each overlay target it will generate a resource table
and an idmap via Installd. Aapt will also run to compile 9patch and xml files. The new restable, idmap, and compiled resources
are stored under /data/resource-cache

[Changes to aapt]
Aapt has been extended to read zip entries and accept file descriptors to work with installd.

[Changes to frameworks/core]
Most of what TMO has done already here for runtime theme changes is kept so most changes
are simply plumbing to make Sony's overlays work at runtime. Additionally changes were made
to TMO classes to support mix n match better.

[Changes to libandroidfw]
Sony's idmap concept is one overlay apk -> one target apk, but themes support multiple target apks. So
most of the changes here are for support this. Also we support runtime overlay changes so functionality
had to be added to add/remove to the resource table during a configuration change.

[Security]
We run aapt in reduced priveledges via Installd. At the moment however a theme can overlay any resource. This
includes strings and layouts so any malicous theme could cause serious crashes to the device.

[See Also]
frameworks/native
external/skia
build
vendor/tmobile/providers/ThemeManager
vendor/tmobile/libs/com.tmobile.themes

[Contributors]
Andrew Mast <andy@cyngn.com>
Clark Scheff <clark@cyngn.com>
Special thanks to the T-Mobile theme team. This would not be possible without their efforts.
Special thanks to Mårten Kongstad and the rest of the Sony team for their work in idmap.

Change-Id: I812a3757bdb56c429b5870ff922485439ae00f8d

Conflicts:
	core/res/AndroidManifest.xml
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	services/java/com/android/server/am/ActivityManagerService.java
	services/java/com/android/server/pm/PackageManagerService.java
	tools/aapt/Images.cpp

Conflicts:
	core/java/com/android/internal/os/ZygoteConnection.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	services/java/com/android/server/pm/PackageManagerService.java
	tools/aapt/Images.cpp

CM11 Themes: Take into account ALL res/xml dirs

Only res/xml was being searched for redirection XML files, which
causes themes that use xml-v14, xml-v19, etc to be overlooked and
resources not being mapped.

Change-Id: I8ccad5770250150a95ec3b89be56f8d01025b126

CM11 Themes: Use 32bit hash to decide if idmap should be created

Using the last modified time of the package to determine if an idmap
should be created is not always valid for system packages.  We have
observed some packages having a time stamp of 08/01/2008 even if the
package has changed.  This causes system packages, such as
frameworks-res.apk to not be properly mapped if IDs changed in this
package.

This patch will generate a 32 bit hash code based on the file's
MD5 sum.  This hash code is then provided to idmap for writing these
values into the idmap header for future comparison.

This patch requires the following change found in frameworks/native
http://review.cyanogenmod.org/62566

Change-Id: Ie9e0273aef96217f06b08774623dd5f1b290a3da

Cleanup theme assets when done with them

Before this patch if phone was left on long enough it would reboot
when a theme was applied due to files being left open.

Change-Id: I4c242249fcf6e8097789c3dd6690104296485784

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

Make Dark UI and Theme Chooser play nicely

Style previews [1/3]

Change-Id: Ifed0ef7829eb61492a39395e8140b99f01c5e6a3

CM11 Themes: Remove type matching restriction

Change-Id: I5a8ac8ff1794350ff9dc03b378c704bfb97d0a9e

CM11 Themes: Allow forcing idmap (re)creation.

Change-Id: I9f5938e9b1052da83b7f2cd7b1ff6f1ed270db6b

CM11 Themes: Use theme name for audible name.

Change-Id: Ib841cb80925b0f3f5ac770e00df04515849e9360

Return system theme when SecurityException is caught.

Isolated processes cannot access content resolvers so a SecurityException
will be thrown when calling getBootTheme.  This catches that
exception and returns sSystemTheme.

Change-Id: If4077adef4c657b80ba2c52a6610126dabe4ffdf

idmap: Don't log spam "CREATING STRING CACHE"

Change-Id: Idce5aa5881c8e860eca9749cc85f748303c913c0

CM11 Themes: Ensure customTheme is not null.

The configuration retrieved via getConfiguration() sometimes contains
a null customTheme which results in the theme returning to holo when
applying a component such as icons.  Icons will change but styles
and fonts would return to the default.

Change-Id: Iac0cb8eed5de8fdc9fe8efd697d968f26e801c08

CM11 Themes: Properly handle SystemUI theme package name.

Change-Id: Ia8915684e1620184dcc513c2c5039ea20aabbd04

CM11 Themes: Include alarms in mixnmatch.

Change-Id: I004f6b0149d71c8ed1a3952704f5a3521eca5add

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

Set themes to install internal only

Themes should not be moveable to sdcard. Before this patch the new
style themes installed with forward lock would fail.

Change-Id: Iea50f5526b1c2c56a825757eac5bf4bb01b4686d

Test for systemui lockup and excessive memory usage

Change-Id: Ia13971067fcf2d729bcdbde9630cca03c1cdaf3d

Conflicts:
	core/java/com/android/internal/os/ZygoteConnection.java

CM11 Themes: remove handleThemeConfigChanges

This was used by the T-Mobile theme chooser and is no longer
needed with the new chooser.

Change-Id: I035606ffe6cb3efc82a3a0ce79215509d8289503

CM11 Themes: Fix how common resources are found

During the boot process, application info may not be fully
available and createPackageContext can throw a null pointer which
causes a theme's resource-cache to be cleared.  If this theme is
in /system/app or /system/priv-app the theme will still be installed
but applying it will result in styles not being applied.

Change-Id: I4094bdd923edc1d829024404a4ce1b72709bd4f1

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:
	libs/androidfw/ResourceTypes.cpp

CM11 Themes: Don't set sys.refresh_theme on icon update

Change-Id: I5ed49ad2aa93974c54434e092946c4be7699131d

Send broadcast when package is 'about' to be removed

If a theme package is removed and it is the currently applied
theme, some apps will crash because the theme resources are
no longer available, since they were cleaned up by the package
manager.  The themes provider will receive this broadcast and
take care of switching back to the default theme for components
that are using the package about to be removed.

Change-Id: I968c25e19eb17ec87e7ddcba5ac0fd81745cef20

CM11 Themes: Properly handle themeing apps on install

Previously when an app was installed or re-installed it would not
pick up the currently applied theme.

mOverlays was not being properly updated and therefore newly
installed or re-installed apps would not pick up the currently
applied theme.

Change-Id: I7ce5454af11fb44e9a73b30858d893050b2fba8a

CM11 Themes: Handle legacy themes in createIdmapsForPackageLI

Change-Id: Iff42bac7bf84b9c739831775c8deef86adbdc0ca

CM11 Themes: Allow defining a custom default theme [1/3]

Change-Id: I6b794d6c9c27b2d6436bdf4fec51c84a7859c134

Conflicts:
	core/java/android/content/pm/ThemeUtils.java
	core/java/android/provider/Settings.java
	packages/SettingsProvider/res/values/defaults.xml
	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
	services/java/com/android/server/ThemeService.java

Conflicts:
	packages/SettingsProvider/res/values/defaults.xml

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

Reduce memory leaks by removing all views.

Change-Id: I1c7d3647ae0d40aa214108ea22e007e3cb3191b9

CM11 Themes: Reduce "unable to load asset" log spam

With the introduction of a "common" resource folder for themes,
we always try to attach the common resource table and if it does
not exist it won't be attached but we would see this log spam.

Change-Id: Ida4e815523fd71b34fe8f3b41cef3432e6e07b64

CM11 Themes: Get proper package name in attachThemeAssets

Change-Id: Ic77ff41519b22e3b20c4571785a1368cdf4d14d2

Themes: Fix -110 install error [2/2]

aapt was being called from PM with a ' ' at the end of the cmd. This would
cause installd to read unexpected parts of memory which sometimes
causes it to parse the command incorrectly.

Change-Id: I85bf93045370478fd9baaf5db784c0cc3a4a03b9

CM11 Themes: Expose applyDefaultTheme to public service

Change-Id: I952870fb984d51d554e560566a8cadbe2c49cc6b

CM11 Themes: Fix applyDefaultTheme implementation

Change-Id: I718be5db58166df48cca5578d6ad5088b91bc1e2

Cleanup themes that fail to install

Themes which fail to install due to aapt or idmap errors
would not be properly cleaned up. This caused subsequent installs
to give a INSTALL_FAILED_UID_CHANGED (-24) error.

This patch also adds install error codes specifically for themes.

Change-Id: Ie03b92ca0a7dec8c4a5e3725b717943d36abb349

Avoid app install failures from malformed themes

When an app is installed we create idmaps between it and all the themes
that theme the app. If the theme is really badly written it could
potentially fail idmap generation, but we should not block the app
itself from being installed just because a bad theme is on the device.

Change-Id: I0e38fd373dfd294aac17fab1cf07ba49934a8859

Notify callbacks on "any" wallpaper change

Callbacks are not notified when the wallpaper is changed to
a live wallpaper.  This patch notifies callbacks of the change
regardless of the type of wallpaper be set.

Change-Id: Icbb7b825cd7e7096c90c5498b6fee0bc61a3de3b

Conflicts:
	services/java/com/android/server/WallpaperManagerService.java

	modified:   services/java/com/android/server/WallpaperManagerService.java

CM11 Themes: Clear wallpaper mixnmatch entry on external change

If a wallpaper is applied from a theme and the wallpaper is changed
from an external source, the theme is still shown to have its
wallpaper applied.  This patch will clear this value out when a
wallpaper change is detected that is not from the ThemeService.

Change-Id: I3d32bb3c0ac96db3f940989bc7ad4eda5e4a71f7

Conflicts:
	services/java/com/android/server/ThemeService.java

	modified:   services/java/com/android/server/ThemeService.java

Themes: Fix bad idmaps for system themes

For a system installed theme or a user who cleared his resource-cache,
there were empty idmaps for some packages.

[Details]
During startup PM could reach the theme package first before the target app was scanned in yet. This
would cause aapt to be skipped. Then when the target app is being installed in startup,
PM would try to create idmap pairs but it would fail since the resources from the theme
were not compiled for that target app.

Also cleaned up PM idmap/aapt creation a little bit more

Change-Id: I6a7dbd7c5d51a2d1336e3289c1e03bb3ed5d762e

Conflicts:
	services/java/com/android/server/pm/PackageManagerService.java

Avoid calling idmap w/ trailing whitespace [1/2]

installd performs a buffer over-read if trailing ws is sent to it.
No observable effect found yet for idmap, but until installd is
fixed upstream, best to play it safe.

Change-Id: I56c9b4bd956ca6f59935253c6d2c90c4dba0ae94

Fix socket descriptor leak from Zygote to child app

Due to an API change in LocalSocket, Zygote must now
manually close the FileDescriptor it created when it
registered a LocalServerSocket.  The LocalSocket.close()
routine will no longer do so.
Bug: 12114500
(cherry picked from commit 70ef29b04ee4ef7d7acfec79041dbe800961195e)

Change-Id: Ief23a3c99e007dc4aa6f94dfb47a1b2b6c854dad

Themes: Map themed icon to app after upgrade

Before this patch, applying an icon theme and then upgrading an app would
cause the app to lose its themed icon.

Change-Id: Ia76a33d0fb731720aa735e9dd9596bc5d2e75d9f

Patchset: 2
http://review.cyanogenmod.org/#/c/64571/

Add wallpaper pickers to seperate package [1/2]

Currently wallpaper pickers were part of the various launchers
and we were relying on Trebuchet's to add code for including
wallpapers from themes.  If Trebuchet is removed then this
functionality is lost.  This package is already included in all
builds so making the picker available here removes the dependency
on a specific launcher.

Trebuchet still contains a picker which should probably be removed
and make use of this package instead.

Change-Id: Ie42ae0e01f951a8293d13d6c8a73fde0dea6682b

Conflicts:
	packages/WallpaperCropper/AndroidManifest.xml

Conflicts:
	packages/WallpaperCropper/AndroidManifest.xml
	packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java

WallpaperPicker: Destroy cropview to avoid leaks

If the cropview's TiledImageRenderer is rendering threads, the activity
context gets leaked. Avoid that by invoking its destroy in onDestroy() of activity.

Change-Id: I0804c903d14d3f3d13529f0fe90d12784d97e93f

CM11 Themes: Put overlays in their own group.

Overlays will now be added to their own group and the
target group will contain a pointer to the overlay
package to be used in getResource and getBagLocked.

Change-Id: Icc6c6eb791f04966e68dbc099eae8e7129546414

Conflicts:
	libs/androidfw/ResourceTypes.cpp

Lockscreen wallpaper for themes

Change-Id: If77b97301c5bfebd94b193fe9a54e676e678d3ed

Conflicts:
	core/java/android/content/pm/ThemeUtils.java
	services/java/com/android/server/ThemeService.java

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	services/java/com/android/server/ThemeService.java

CM11 Themes: Use package name from AndroidManifest

It is possible for an apk to have a different package
name for the resources than what is defined in the
AndroidManifest.xml of the apk.  Using the resource's
package name for the base package name causes themed
resources to not be properly loaded.

Instead of returning the resource package name we return
the apps package name from AssetManager.

A good example of this is Trebuchet.  The system sees
it as com.cyanogenmod.trebuchet but it's resources use
com.android.launcher3.

Change-Id: Id57e68b27b3c7509e3358a7fd12ae73a03dd6cdf

SystemUI: Make wifi combo margin themable

Change-Id: Ie77b13cee84d5b472f878dba6388f3e168f5a249

Conflicts:
	packages/SystemUI/res/values/liquid_dimens.xml

Conflicts:
	packages/SystemUI/res/values/ose_dimens.xml

Revert "idmap: Don't log spam "CREATING STRING CACHE""

This reverts commit 1434485d28183afc8c9b64df784d3ccb530b4c29.

idmap: reduce CREATING STRING CACHE verbosity

Change-Id: I7febe358b3b302427650edc1d00772fc9d2d547c

Themes: Add read/write permissions [1/2]

Change-Id: Id9710a7f6058454f563488288220744b02cc4850

Conflicts:
	core/res/AndroidManifest.xml
	core/res/res/values/cm_strings.xml

Conflicts:
	core/res/AndroidManifest.xml

add a getter for the x and y offsets of the wallpaper window

Change-Id: I35294bcac664e85cc5d344b50b5c4335a60d3f37

Reduce memory leaks by removing all views.

Change-Id: I64b95981425840d101c8122421281976d0251bae

CM11 Themes: Add themeChange config change to manifest

Change-Id: Ia84c0089a79637906e4f75fa38a56e8ff3b21a2b

CM11 Themes: Don't kill setup wizards

Change-Id: Ib68dbf08b5b65f66e73f2f22882932ced0851093

Fix wallpapers not applying in full screen

Change-Id: I01f451d0b9a2236c2cdf0c7533e6f13ef03b7bf2

WallpaperCropper requires these permission.

Without these it just crashes lockscreen wallpaper.

Change-Id: I25c676244a919ed355e02664828ddd79dd327062

No need to hide flags in configChange

Change-Id: I36cda275f836d07e639419db8c856c7527307907