Theme Engine [3/7]

commit a0e8db5a5086d00ec1408f07c81ede64e1cc1654
Author: Clark Scheff <clark@cyngn.com>
Date:   Wed Jun 4 18:28:36 2014 -0700

    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

    Conflicts:
    	core/java/android/app/IconPackHelper.java
    	services/java/com/android/server/ThemeService.java

commit 92522d728d92d219353625c6dd70c420a740562c
Author: Jmz <jmztaylor@gmail.com>
Date:   Sun Jun 22 07:51:13 2014 -0400

    Theme Engine [3/7]

    commit e0b2ca35288fa9cd25bc1e47fb00b18c19a26359
    Author: Jmz <jmztaylor@gmail.com>
    Date:   Sun Jun 22 07:50:25 2014 -0400

        Squashed commit of the following:

        commit 84d640fe76601645c03bbe1b5ab5b6b98829c219
        Author: Jmz <jmztaylor@gmail.com>
        Date:   Sun Jun 22 07:34:14 2014 -0400

            Theme Engine Patches

            Squashed commit of the following:

            commit 7f8a46e691b4a95a1b3d845aa7d40b98a08429bc
            Author: Roman Birg <roman@cyngn.com>
            Date:   Thu Jun 19 13:54:07 2014 -0700

                WallpaperCropper: include wallpapers from themes!

                Theme all the things!!!!!!!!!

                Change-Id: Ie9d5d4dfe6533442188e38fa0b11742368246e37
                Signed-off-by: Roman Birg <roman@cyngn.com>

            commit 47b70825244f603ef4afaf3108ae9bd1e96c5c9c
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Fri Jun 13 18:56:38 2014 -0700

                Themes: Add previews to the themes contract.

                Change-Id: I607a6eda1c63a701516d2bc78ca6b705841fbdf7

            commit 1ec152ac7f9114257b987cc7aff198b7c0e4ff6b
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Tue Jun 17 16:40:25 2014 -0700

                Themes: Add status bar and navigation bar to ThemesContract

                Change-Id: I8048c735d7bbbfdb86ee5923b95bece6b4252bf7

            commit f8922addcaf7d571a6c89605d5542c8d838b1eec
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Wed Jun 18 09:17:09 2014 -0700

                Themes: Remove DEFAULT_THEME_APPLIED_ON_FIRST_BOOT

                doApplyDefaultTheme should be able to apply the default theme, if
                one exists, whenever applyDefaultTheme() is called.

                Change-Id: Ia50b4089d122855a4ddde91a02eef33ed3f9eaf4

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

            commit 4d5da27807c423c272097c525c21a9f52b766067
            Author: d34d <clark@cyngn.com>
            Date:   Tue Jun 17 08:35:42 2014 -0700

                Themes: Install themes and icon packs for secondary users.

                Change-Id: I48ae6835223510a433642fced5b96b6c3954baf6

            commit c1c48226038f1f3482b8079ed0285de68591d83e
            Author: Andy Mast <andy@cyngn.com>
            Date:   Mon Jun 16 19:21:53 2014 -0700

                Themes: Don't create idmap if app doesn't have resources.arsc

                Some apps do not have a restable but some legacy themes
                try to theme these apps anyways. In this case we skip
                the idmap creation process.

                Change-Id: I8bc60984299791733d4fe8c9bbcaa75eca6d736b

            commit 08baa71bc16f5a3a63c3ae7f61a36214de268026
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Mon Jun 16 17:58:07 2014 -0700

                Themes: Fix icon support for secondary users.

                This fixes the problem when switching to a secondary user and
                icons are currently applied.  Prior to this patch the secondary
                user would see droids as their icons and apps would FC at start.

                Change-Id: Icd4275eae5868612bf2a81b375ac4d0779a61395

            commit d46ea20d1c22188e72c93546a602378a276dd6ee
            Author: fuzz <fuzzzzzzzzzzzzzzzzzz@gmail.com>
            Date:   Mon Jun 16 19:21:01 2014 +0900

                Themes: Tests: Hide new private APIs

                Add missing @hide
                This should have been done in If04e82a13250f520d70b58991586c8ce38f0ecb1 to avoid

                /opt/jenkins/android/workspace/android/cm-11.0/out/target/common/obj/PACKAGING/public_api.txt:24102:
                error 4: Added public method android.test.mock.MockPackageManager.getThemedResourcesForApplication
                /opt/jenkins/android/workspace/android/cm-11.0/out/target/common/obj/PACKAGING/public_api.txt:24103:
                error 4: Added public method android.test.mock.MockPackageManager.getThemedResourcesForApplication

                Change-Id: Ib40279065c937b130322350c1dbdf5b0b43506e3

            commit 4aa875a157de334408dcb06aa7bd6ebdb28b7768
            Author: d34d <clark@cyngn.com>
            Date:   Sun Jun 15 11:56:56 2014 -0700

                Themes: Set bounds on iconUpon

                Change-Id: I90720b87ed6d5c30f342bd0e1c149e8a6e238d6e

            commit d3b058f05f86e4b337e84110dcdc372301be6d67
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Wed Jun 11 14:19:42 2014 -0700

                Themes: Get resources with an explicit theme attached.

                Change-Id: If04e82a13250f520d70b58991586c8ce38f0ecb1

            commit 6b650e6863345b86a9243df3139d17c707115309
            Author: David96 <xD_e-mail@gmx.de>
            Date:   Sat Jun 14 19:10:15 2014 +0200

                Fix DocumentsUI FC

                Change-Id: I2bfd4ea83db53ee83683a4754b49b15cc2abeaca

            commit a89f760a79e4c0d8e1ee79263de7b201b07df0d5
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Fri Jun 13 14:05:45 2014 -0700

                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

            commit 2dde43450151dde4b3358423c5f06bedb78134bd
            Author: sd3993 <shouvik.dey3993@gmail.com>
            Date:   Sat Jun 14 00:01:18 2014 +0530

                Themes: Fix wallpaper chooser crash

                Fix AOSPA-477

            commit e6f8c3c7db26a99515678d883b6ecf18efe225fc
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Tue Jun 10 14:59:34 2014 -0700

                Themes: Don't kill launchers that handle the theme change

                Change-Id: I5e3a7ea2455a4c407928bb5c90b7fc4e5906aa73

            commit aa3f4d390bc28d00ca0d349cdd99cd3b0e58413e
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Mon Jun 9 11:33:57 2014 -0700

                Themes: Don't set icons for iconpack that is applied.

                Change-Id: I3cffade2c12ae1dbc1f75e43f1a74609ff0d7135

            commit 1a21a59e15d63fc7f04d15870798d2ba15406468
            Author: Andy Mast <andy@cyngn.com>
            Date:   Wed Jun 4 11:53:26 2014 -0700

                Themes: Check CRC of APK MANIFEST.MF at install

                Change-Id: I6ccfcd2b04107b85fe14cb678aad63443284353a

            commit b7113abb76093c2c1756e5ba849def3fe87a52ed
            Author: Andy Mast <andy@cyngn.com>
            Date:   Fri Jun 6 15:57:58 2014 -0700

                Themes: Theme special volumeup+down volume panel

                When you press vol up + vol down button it brings up a
                different volume panel which was not getting themed because
                it lacked the ui context.

                Change-Id: I416b8920160c0ab263fd426a6e6491d1f877a905

                Conflicts:
                	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

            commit c4fedfcc75e3424065b79f636a77639e75e5a069
            Author: Andy Mast <andy@cyngn.com>
            Date:   Fri Jun 6 13:40:08 2014 -0700

                Themes: sync status bar transparency state on theme change

                When the status bar view is reinflated its transparency mode is
                reset back to opaque. This can be observed by changing a theme
                and switching to home in the middle of a switch.

                Change-Id: I3049c5f24cc6c46dcefb24188039a08503db09a9

            commit 1c583e8e6545f9965d0bcf9531e3b6ffe45bb1d7
            Author: Andy Mast <andy@cyngn.com>
            Date:   Thu Jun 5 17:13:27 2014 -0700

                Themes: synchronize updateStringCache on mAccessLock

                Resources.java used to synchronize on mTmpValue but has since
                switched to mAccessLock. mTmpValue can be null in some instances
                causing a NPE during a theme change.

                Change-Id: I7411dfdf6e8e411381ae993872a3c740dad19300

            commit 1096073e794a1adc49ff905e6f59a0eca3fe4205
            Author: Andy Mast <andy@cyngn.com>
            Date:   Wed Jun 4 11:38:49 2014 -0700

                Themes: Avoid compiling icon packs every boot

                Change-Id: I51c7effdd4592a302f457822a05cbebee6cde06b

            commit 7b73ed3289539e0d32368938157c3a2626ef1502
            Author: nagarw <nagarw@codeaurora.org>
            Date:   Fri Oct 11 15:37:22 2013 +0530

                SystemUI: Fix crash on Recent Apps list

                Issue: SystemUI crash is observed when Context MenuItem "App info"
                       is selected on the recent apps activity
                       1. Open the rencet apps list
                       2. Long press on any one/more recent app(s)
                       3. Lock the screen using power key
                       4. Unlock the screen using power key
                       5. select menu item "App info"
                       6. SystemUI process will get crashed.

                Fix: Changed the code to make sure that only one context
                     menu is active at a time and also dismissed the
                     context menu on pause of the RecentsActivity

                Change-Id: Ia50bed7bfad6fde7beeaec37fa6402177eee1d40

            commit 6d595ab6acc05e6d91d9337df9d8abf9e5389942
            Author: Dirk Rettschlag <dirk.rettschlag@gmail.com>
            Date:   Sun Jun 8 00:07:39 2014 +0200

                Themes: Keyguard: Fix NPE setting lockscreen wallpaper

                After boot the view might not be laid out and so getWidth() and
                getHeight() return 0 and will cause a NullPointerException in
                createBitmap().

                Bug AOSPA-448

                Change-Id: Ibacf4199a69709dc34d21695732c2a5360533a23
                Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>

            commit a58827cba2942e001bf309c2839d56ed7ba46dc7
            Author: namagi <br.mladen@gmail.com>
            Date:   Wed May 14 12:53:09 2014 +0200

                SystemUI: prevent NPE on clear recents double press

                Pressing Clear all button twice fast or while the list
                is clearing but not yet fully cleared causes sysui to crash due to
                mRecentTaskDescriptions being null: (http://pastebin.com/2gRFvf8k)

                Change-Id: I23d10edfd336041739fe80352ee01987e671dbd7

            commit d4d0ebd81e172edc9eeef10b0723e03407a05d5a
            Author: Andy Mast <andy@cyngn.com>
            Date:   Wed Jun 4 15:40:19 2014 -0700

                Don't cleanup overlay mapping for non-theme apps

                mOverlay structure should keep all app/theme mappings even
                if the app does not exist. Otherwise we will have to insert back the mapping
                for every app that is installed which would be time consuming.

                Without this patch an upgrade app loses its applied theme
                until the device is rebooted.

                Change-Id: Id02b8e0a3bdd78d1a9d39cd38294c584ef95f8db

            commit 504320ad5c2d10376295fed309602d9cd9f6dfeb
            Author: nuclearmistake <nuclearmistake@gmail.com>
            Date:   Wed Jun 4 14:11:13 2014 -0400

                Themes: uninstallThemeForAllApps shouldn't check if map is empty if it's null

                Potential NPE introduced in ec2200878706735cdd2caf4d934d988296998e85

                Change-Id: I6d1ec165957c2be63086a18af2236e46978e9c8a

            commit 5d9858733cbee82c6bc060155be2ce7555639f6a
            Author: Evan Anderson <evan@thelinuxman.us>
            Date:   Wed Jun 4 18:26:13 2014 -0500

                Themes: Fix home button for realz

                AOSP doesn't update or refresh home button, its drawable is loaded once.
                Refresh home button when refreshing recents and back icons aswell.

                Change-Id: Ic691563bddcda00cff985edc2d0980172e81db0d
                Signed-off-by: Evan Anderson <evan@thelinuxman.us>

            commit 0e66547ff6dc24e6301495c50e32896ccb1f3fc0
            Author: Ethan Chen <intervigil@gmail.com>
            Date:   Tue Jun 3 12:24:10 2014 -0700

                Themes: Update last postFinish call

                * Previous patchset changed postFinish function signature.

                Change-Id: Ibe07435e274054c7203504bc4b0877b4df006893

            commit ef65396fb0c48dabb1b4d163d7b6349899eb5d8a
            Author: Roman Birg <roman@cyngn.com>
            Date:   Tue Jun 3 10:40:21 2014 -0700

                WallpaperCropper: do not display null bitmaps

                It is possible that themes can include a corrupted bitmap,
                and the lockscreen will try and display a NULL image resulting in an
                empty thumbnail and applying it will cause the app to crash.

                Change-Id: Ie0770486a9d58050a5f296a219d844a39937421e
                Signed-off-by: Roman Birg <roman@cyngn.com>

            commit 3a0548dc6bd44c5cd1e2fdc4eba981b5f7f46cd3
            Author: Andy Mast <andy@cyngn.com>
            Date:   Mon Jun 2 16:59:23 2014 -0700

                Themes: Delete icon resources during uninstall

                Change-Id: Icf247642f9d246c8826f3394f873e4b434ad2b3f

            commit 1981c50145540a9fa9d74ca1839547846b64eb6b
            Author: Andy Mast <andy@cyngn.com>
            Date:   Mon Jun 2 16:58:54 2014 -0700

                Themes: remove unused code

                Change-Id: I5ee8de962c40ddc5fcfbbc0332a9e389223e716c

            commit 2592857a96489a32d1cf7f3a79a4670ca4e4ec97
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Tue Jun 3 09:32:53 2014 -0700

                Make theme change broadcast a protected broadcast.

                Change-Id: Ic24c840685d18d133dc73ff2637c041c4775f197

            commit fc16c4f3b9df7d09e7bd22b9d9e1dde73ede3b6e
            Author: Andy Mast <andy@cyngn.com>
            Date:   Mon Jun 2 13:57:04 2014 -0700

                Themes: Handle apps using "original-package" tag

                Before this patch the themes code assumed the pkgName from PackageInfo was equal to the
                manifest value. This is not the case however for upgraded system apps that have gone
                through a pkg-name change. For example, Trebuchet was "com.android.launcher3" and now
                it is "com.cyanogenmod.trebuchet". If the device had wiped data then PM would use the new
                pkg-name, but if the system apps were being upgraded then PM would use the old name which is
                now different from the manifest name.

                Change-Id: Ie7eb1b4e17899d1055535dc890d4f7a7bca9a98a

            commit 8cbb3adba98fd15c3377ecc6a07b767d9c8890a7
            Author: Clark Scheff <clark@cyngn.com>
            Date:   Tue Jun 3 09:09:58 2014 -0700

                Themes: Add '|' delimited list of components to broadcast

                Change-Id: I742dcb0f502b6089dee584a92a3792016f2a9799

            commit 4b572fe7e5eafa87e942126884b5aa0012177843
            Author: Andy Mast <andy@cyngn.com>
            Date:   Thu May 29 12:40:09 2014 -0700

                Cleanup app->{theme1,theme2...} mapping on uninstall

            Change-Id: I4882195998a647001d501e40fad1a65a8cf15654

        Change-Id: Idb0c1b60c6c8af9a210e02e66c4c1ae69467ce64

    commit 7191b16db08509548197a94944cda1175677b84a
    Author: BigBrother1984 <stevewatersy@gmail.com>
    Date:   Sun Jun 1 08:27:37 2014 +0200

        Theme Engine [3/7]

        Bring new CyanogenMod Theme Engine to AOSPA. This is a HUGE commits history (100+ commits),
        it squashes all cm code about Theme Engine since old tmobile one. As well it inlcudes some changes
        required as custom lockscreen wallpaper, keyguard app changes, wallpaper overscroll and transparent
        navigation bar features. All commits inside, along with adaptations and fixes for our aosp base, are
        listed in the commit message (as well as for new Theme Engine description, code-wise).

        Infinite thanks to the CyanogenMod team for bringing us this new engine, kudos!

        CM Credits:
        Andrew Mast and Clark Sheff (as lead creators of new Theme Engine)
        Roman Birg
        Ricardo Cerqueira
        Danny Baumann
        Andy Prock
        Kyrylo Mikos
        Danesh M
        All T-Mobile guys

        PA Contributors:
        @BigBrother1984
        @beerbong
        @linuxman94

        ------------------------------ HISTORY ------------------------------

        [+]
        Squashed commit of the theme engine support.

        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:
        	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
        	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/NotificationManagerService.java
        	services/java/com/android/server/SystemServer.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

        [+]
        @hide API change from themes

        Change-Id: Ia0798346d2e8e5a84e8456bb89b7d503a71a7afa

        Conflicts:
        	core/java/android/content/res/Resources.java

        [+]
        Framework: Remove orphaned Theme related code

        Change-Id: I930d4cc75e655c5bc37532e6a1425d27bd1ee661

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

        [+]
        framework: Allow specifying max wallpaper width

        For some devices with very high-res screen (1920x1200), the wallpaper
        width suggested by the launcher may be too large for the GPU and so
        we need to limit it. (2048 for the above mentioned screen)

        We don't need to limit the height since that's the height of the
        screen.

        Change-Id: I5b25bd931db0b2610e260921f28b92d8b0966aa6

        Conflicts:
        	core/res/res/values/config.xml

        [+]
        Check themes of current user, not user 0.

        Change-Id: I5d685a04289b434a12e460b4fdacc43a41ff2be1
        JIRA:CYAN-1303

        [+]
        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

        [+]
        AssetRedirectionService: Check for permissions before running dump()

        Fix android.security.cts.ServicePermissionsTest failure

        Change-Id: I9d629d19f3ff231db477d156c8bf557d4b8ee861

        [+]
        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

        [+]
        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

        [+]
        PackageManager: Let system-defined permissions take precedence over settings

        If a permission was already present in the device's settings due to having
        no prior system definition, and the system tried to take it over
        (after a version upgrade, for example), it'd fail, since the saved
        value would clobber the one previously read from the permissions XML.

        This breaks system-behavior changes (gid grants, in particular) unless
        the user performs a factory reset after upgrading, which isn't acceptable.

        Change-Id: If2e44110f6db735ad29cdf1086e814bd1299e290

        [+]
        Fix certain setting writes being incorrectly skipped.

        If a value that previously had a very long value (over the 500 char
        threshold) is now set to null, isRedundantSetValue would incorrectly
        return true even though the value was changed.

        Change-Id: Ia5304743024ec01024be98aa51ed260d38caf93c

        [+]
        AssetAtlas: Fix NPE when there are no preloaded resources

        [+]
        PackageManager: Let com.tmobile.thememanager access privileged permissions

        Needed for CHANGE_CONFIGURATION

        Change-Id: If50b0926d77e15e18ef5e88d7efac1b7f209d6e4

        [+]
        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

        [+]
        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

        [+]
        SystemUI: Allow theming battery via theme chooser

        Change-Id: Iebea2dab0ed89baa14c0f18a4c8f487cdb8313a6

        [+]
        Keyguard: allow keyguard to be dismissed via intent

        Requires system permission "android.permission.CONTROL_KEYGUARD"

        Change-Id: I9f8f5ca90a65b949d43fac33ce3e9e39ffdf9254
        Signed-off-by: Roman Birg <roman@cyngn.com>

        [+]
        Keyguard: smooth background change.

        Change-Id: Ia0e4d0000db72b5cdb6fede03791805e34fa311d

        [+]
        Frameworks: Lockscreen custom wallpaper (1/2)

        kitkat now has code for a custom wallpaper image.

        Using that code set a switch case to set the custom background between
          - Custom Wallpaper
          - Default background

        This way allows the same overlay shadow thats set on the keyguard when
        its the defualt way.

        Change-Id: I98fde63ef9f3c0a5f334cd9a97b237a6f99c57f6

        Conflicts:
        	core/java/android/provider/Settings.java
        	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

        [+]
        Lockscreen: Fix SystemUI crash on initial selection of Custom Background.

        Change-Id: I8df4984f4b90d211baa888d380a95fc00a85d1ad

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

        [+]
        Wallpaper Overscroll and Transparent NavBar

        Now possible to offset wallpaper windows by more than the size of the wallpaper
        and add added a transparent mode to the NavigationBar

        Change-Id: I2b0f1129a4cf73b8def35abb7072d0472a9cc972

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

        ------------------------------ NEW THEME ENGINE  ------------------------------

        [+]
        Remove T-mobile items not used by new theme engine

        Change-Id: I1e9c14e63ec25fdff61cfd2b7b8a05b1e488e558

        Conflicts:
        	core/jni/AndroidRuntime.cpp
        	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

        [+]
        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

        [+]
        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:
        	cmds/bootanimation/BootAnimation.cpp
        	core/java/android/app/ContextImpl.java
        	core/java/android/content/Context.java
        	core/java/com/android/internal/os/ZygoteConnection.java
        	core/res/AndroidManifest.xml
        	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
        	policy/src/com/android/internal/policy/impl/GlobalActions.java
        	services/java/com/android/server/InputMethodManagerService.java
        	services/java/com/android/server/SystemServer.java
        	services/java/com/android/server/am/ActivityManagerService.java
        	services/java/com/android/server/pm/PackageManagerService.java

        [+]
        Keyguard: more consistency with the new lockscreen wallpaper

        * In the case when the screen was off and setCustomDrawable()
        was being called, and the use wallpaper is null, then we could be
        setting the color filter on a null drawable.

        * Fix logic when old custom background was null and the new one is also
        null (but could be the user one) and the func was being returned, thus not
        clearing out the current media album art.

        * Move resetting the shouldShowWallpaper() flag to the show() method
        so it is not being called every time the screen is turned on.

        * Fix user image not showing up on first boot if it exists

        Change-Id: I567c2ec8920df627835defb822c2ea25be7b3cab
        Signed-off-by: Roman Birg <roman@cyngn.com>

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

        [+]
        wallpaper: add missing @hides

        Add missing @hides to setWallpaperOverscroll and setWallpaperOverscrollOffsets

        Change-Id: I1cfe876272d7c0a94bef122567da30318eac9400

        [+]
        Lockscreen wallpaper for themes

        Change-Id: If77b97301c5bfebd94b193fe9a54e676e678d3ed

        [+]
        Keyguard : Fix album art sticking after playback is stopped

        newIsNull should be populated by what is currently being set and not by
        what the user's custom background is, since otherwise you end up a in state
        where the user has no custom background set, music stops, no album art via arg is provided and you simply return.

        Change-Id: Ifaea1cae176faaba6b32a711071f3b75ccacdd63

        [+]
        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

        [+]
        revert camera icon disable when Settings.System.LOCKSCREEN_MODLOCK_ENABLED was set to 1

        Change-Id: I0f6e318c5da7b526e24f8c0c73102e3d7d826a46

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

        [+]
        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

        [+]
        Fix segfault removing theme assets

        Change-Id: I4827eb6e2b186547f1df6f9bbd048fb1e3a29890

        [+]
        Style previews [1/3]

        Change-Id: Ifed0ef7829eb61492a39395e8140b99f01c5e6a3

        [+]
        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

        [+]
        CM11 Themes: Remove type matching restriction

        Change-Id: I5a8ac8ff1794350ff9dc03b378c704bfb97d0a9e

        [+]
        CM11 Themes: Allow forcing idmap (re)creation.

        Change-Id: I9f5938e9b1052da83b7f2cd7b1ff6f1ed270db6b

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

        Change-Id: Idce5aa5881c8e860eca9749cc85f748303c913c0

        [+]
        CM11 Themes: Use theme name for audible name.

        Change-Id: Ib841cb80925b0f3f5ac770e00df04515849e9360

        [+]
        Allow icons in shared restables to be themed

        Example
        Google Drive's package  name: com.google.android.apps.docs
        Google Drive's restable name: com.google.android.apps.docs.common

        Before this patch we used resource table name to get the package info. For
        app's like google drive this return a null package info and the icon would not be themed.

        So instead of usnig the restable name, this patch creates a package name
        in AssetManager that is set by getTopLevelResources.

        Change-Id: Ic51b93f6c7ea0a32197682998c6d0aa36d774845

        hide new AssetManager methods for themes

        Change-Id: I9f5c6a432f9c2f3c1dd5bd9927c5e3fe3ddd1f93

        [+]
        CM11 Themes: Update lights out resources and extra nav buttons

        The ImageViews that hold the lights out dots were not being
        updated on a theme change as well as the KeyButtonView with
        ID of R.id.one

        Change-Id: Ieed5f5ba1d822fe47dad3ec934889bf70eb1a3ad

        [+]
        CM11 Themes: Adapt NavigationBarView changes to stock navbar

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

        [+]
        WallpaperCropper: Fix crash when set .gif as wallpaper

        It returns an equivalent scaled cropBounds as true
        crop bounds, then it set the rounded rect by rounding
        "out" the true crop rect, this make the rounded crop
        rect may out range of the original bitmap, then an error
        will happen.

        We change to check the rounded crop rect, if it is out
        the range of original bitmap, we set the original bitmap
        bounds as rounded crop bounds.

        CRs-Fixed: 622582

        Change-Id: I215ef2a0165adaaadb05c62dee741a8ea6926144

        [+]
        wallpapercropper: OOM issue while opening *.bmp image

        This change manages setting of large images as
        wallpapers without encountering OOM.

        CRs-fixed: 619815
        Change-Id: I3a32ec4b42050b146076f0adf6b6e65afd6fae4e

        [+]
        frameworks: allow Keyguard package to be defined in overlay

        This way, custom keyguards can have their own namespace.

        Change-Id: Ia2dfa57652c6f3d3404963897fb2f20a265e5c76
        Signed-off-by: Roman Birg <roman@cyngn.com>

        Conflicts:
        	core/java/com/android/internal/util/cm/LockscreenTargetUtils.java
        	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

        [+]
        frameworks: move keyguard wallpaper to system  (1/2)

        Change-Id: I0eb1b5578b705c2ade4c0772fa86e09478b9f73e
        Signed-off-by: Roman Birg <roman@cyngn.com>

        Conflicts:
        	core/java/android/provider/Settings.java
        	core/res/res/values/cm_strings.xml
        	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

        [+]
        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

        [+]
        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

        [+]
        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: Include alarms in mixnmatch.

        Change-Id: I004f6b0149d71c8ed1a3952704f5a3521eca5add

        [+]
        CM11 Themes: Properly handle SystemUI theme package name.

        Change-Id: Ia8915684e1620184dcc513c2c5039ea20aabbd04

        [+]
        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

        [+]
        rename the custom lockscreen state action

        Change-Id: I4ffadda9392e8ca8765e5b8ca47994e3a9990792

        [+]
        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

        [+]
        Reduce memory leaks by removing all views.

        Change-Id: I1c7d3647ae0d40aa214108ea22e007e3cb3191b9

        [+]
        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

        [+]
        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: Don't set sys.refresh_theme on icon update

        Change-Id: I5ed49ad2aa93974c54434e092946c4be7699131d

        [+]
        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: 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

        [+]
        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: Allow defining a custom default theme [1/3]

        Change-Id: I6b794d6c9c27b2d6436bdf4fec51c84a7859c134

        Conflicts:
        	core/java/android/provider/Settings.java
        	packages/SettingsProvider/res/values/defaults.xml
        	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

        [+]
        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

        [+]
        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

        [+]
        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

        [+]
        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

        [+]
        CM11 Themes: Fix applyDefaultTheme implementation

        Change-Id: I718be5db58166df48cca5578d6ad5088b91bc1e2

        persist the changed position values in updateWallpaperOffsetLocked, even with a null mWallpaperTarget

        Change-Id: I175773f6e0b3f91c1d983857028a89b959e4e9f2

        [+]
        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

        [+]
        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

        [+]
        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

        [+]
        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

        [+]
        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

        [+]
        CM11 Themes: load wp from apk if uri is null

        When setting a default theme on first start, the provider may
        not have processed the theme and the uri for the wp will be null.
        If this happens try to load the wallpaper from the themes assets.

        Change-Id: I883b9dd796920e66e4729e78d41cd8899916fa42

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

        Change-Id: Id9710a7f6058454f563488288220744b02cc4850

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

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

        Change-Id: I35294bcac664e85cc5d344b50b5c4335a60d3f37

        [+]
        CM11 Themes: Use sendBroadcastAsUser in ThemeService

        Change-Id: I2a283318357ece9f6195a9bb825748b4549396af

        [+]
        SystemUI: Make wifi combo margin themable

        Change-Id: Ie77b13cee84d5b472f878dba6388f3e168f5a249

        [+]
        Make KeyguardMultiUserAvatar fully themeable

        Create the animation color for the username text based on the final
        color.

        Change-Id: I4b1beb70160e178264c32f3b33c6c0c7c51f70c5
        Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>

        [+]
        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

        [+]
        Revert "Reduce memory leaks by removing all views."

        This reverts commit a61cab784f2560d972a1c30554a697d04993c57b.

        [+]
        This is causing BT icon to get caught up in "all views" removal. Backing this out until Clark can look into it.

        Change-Id: Ied8f45f035492ee351e6b24fa0ae88c2abfbf9ea

        [+]
        Reduce memory leaks by removing all views.

        Change-Id: I64b95981425840d101c8122421281976d0251bae

        [+]
        CM11 Themes: Delay setting default theme

        Change-Id: I56c0ae7a8b6868a1e81b6c7a72c0dd4a079cd7ba

        [+]
        Revert "CM11 Themes: Delay setting default theme"

        This reverts commit 293d7e8547a05bcb17042402c18849571cd1edcf.

        Change-Id: Ib36dd5f649b985238724dac06cbd0dca2eccb2cf

        [+]
        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

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

        This reverts commit 8a8b3bc1f7fe97b1c11693ad3350cebfd9e546be.

        Change-Id: Ic461c90e9fd50b81051b2bc55bb6507f40144c36

        [+]
        idmap: reduce CREATING STRING CACHE verbosity

        Change-Id: I7febe358b3b302427650edc1d00772fc9d2d547c

        [+]
        CM11 Themes: Big cleanup of cm dependencies and compatibility miscs

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

        [+]
        CM11 Themes: Add theme support to Ringtone and Profile pickers activities

        Patchset 3: Add support for theme RingtonePreference view. The dialog is
                    automatically adjusted to the caller activity base theme.
        Patchset 4: Don't break the android api

        For Ringtones:

        http://review.cyanogenmod.org/#/c/61393/

        For Profiles:

        Usage:

        Intent intent = new Intent(ProfileManager.ACTION_PROFILE_PICKER);
        intent.putExtra(ProfileManager.EXTRA_PROFILE_DIALOG_THEME, R.style.CustomDialogTheme); <<< Add your custom dialog theme here
        startActivityForResult(intent, 0);

        Style Usage:

        Define an style that inherits from an android base theme

        <style name="CustomDialogThemeDark" parent="@*android:style/Theme.Holo.Dialog.Alert">

        or

        <style name="CustomDialogThemeLight" parent="@*android:style/Theme.Holo.Light.Dialog.Alert">

        or define your own dialog style

        Change-Id: Icadbcf2c617c51177466989acdab9435066a47a0
        Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

        Conflicts:
        	core/java/android/app/ProfileManager.java
        	packages/SettingsProvider/src/com/android/providers/settings/ProfilePickerActivity.java

        ------------------------------ END ------------------------------

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

    Change-Id: I1d105656be68c5ceb095a546162bb9a84a922a9a

Change-Id: I1d105656be68c5ceb095a546162bb9a84a922a9a