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

This reverts commit 8abff47a8e61235b527b8ad684578454b6ef05ab.
Revert "Return system theme when SecurityException is caught."

This reverts commit e2907468a36921f9e8eaa9193b119a27f591282c.
Revert "hide new AssetManager methods for themes"

This reverts commit bfe9af85f2e1139306dc62b1de711c8e18ef92d9.
Revert "Allow icons in shared restables to be themed"

This reverts commit e0c61f81f23667c8f61bf6bdba42365030b6e96b.
Revert "CM11 Themes: Use theme name for audible name."

This reverts commit 052e3c3a14058b54062e3f4232aac4b8716c65ca.
Revert "CM11 Themes: Allow forcing idmap (re)creation."

This reverts commit fe82bd653428bbad80b5f971f0c1d89d91b9096c.
Revert "CM11 Themes: Remove type matching restriction"

This reverts commit 616acdb28714afebdeda666ff566002acbb4ce11.
Revert "CM11 Themes: Put overlays in their own group."

This reverts commit 3f1003cf5f3b98b05edf2029b8078acbde047786.
Revert "Fix segfault removing theme assets"

This reverts commit a754bce4b0d9a0ae6109b5f3ccd11cd900f9f00e.
Revert "Style previews [1/3]"

This reverts commit b99a1daee9b1b07529448a211c4aee4075bd14cf.
Revert "CM11 Themes: Take into account ALL res/xml dirs"

This reverts commit ead931908d4bb809addf51c625c2678d8af9f974.
Revert "CM11 Themes: Use 32bit hash to decide if idmap should be created"

This reverts commit f89abf8001f954e43c1fbbaa38abf56a9819532e.
Revert "Cleanup theme assets when done with them"

This reverts commit 25950a8da7fdbf3fb30d960d8170aac68af6082e.
Revert "Fix Theme engine errors"

This reverts commit 048ea037d44590f93179fa3b5689764f686f59c4.
Revert "OMG LOL!"

This reverts commit ecbbb3a2efa498c3bf1da742c73d15db598867c4.
Revert "Fix build"

This reverts commit 28a60142ee8e5251a36503381ba23461414047e4.
Revert "New Theme Engine [1/6]"

This reverts commit 27c37323807aa044865c1c2c33ad3dc9555707e7.
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
Move theme strings to cm_strings.xml

Also correct application->app

Change-Id: I13afe2b810ccb8f9a5fa9484a5cd93ec9820ed6e

Conflicts:
	core/res/res/values/crom_strings.xml
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