FWBase: Audio Themes Support [1/3]

Change-Id: I698acc3e7843dcb38ba545219a21e9bee0b2fbe6
Signed-off-by: STELIX <ssspinni@gmail.com>
FWBase: Battery Saver mode [1/4]

Concept:
http://jira.omnirom.org/browse/CONCEPT-24

introduce battery saver mode
this based from what user want or what user do to saving the battery
life
this include:
1. Automatically switch mobile network into what user choice and also
disable mobile data IF wifi connected to an AP
2. Automatically switch mobile network and disable mobile data IF
battery low (battery level can configure)
3. Reduce screen brightness based low battery (this feature will
disabled if Auto brightness mode enabled)
4. Not changing network IF on Call or Usb tether enabled or WifiAP
enabled
5. Not changing network IF there is Download/upload progress
6. Support For Both GSM and CDMA devices (need someone to test for CDMA
devices)
7. every condition has an option :D
8. Restore all network configuration if battery saver mode disabled
9. Add Time Range to start battery saver mode
10. allow device without mobile data support, to using this feature
11. fix inconsistent battery low level
12. rewrite to better performance
13. modified the controller to support battery saver mode
14. add bluetooth, gps, wifi, and mobile data (if support) to be
disabled while power saving activated
15. fix build QuickSettings because of LocationController change
16. rewrite to better performance
17. fix brightness value
18. rewrite (again) to allow add more saving mode
19. do delay changing only for POWER SAVING not NORMAL mode
20. add Cpu power saving mode
21. fix Cpu freq value
22. fix call saving state for non user configuration mode
23. fix NPE
24. add kill all task
25. add disable sync
26. add disable vibrate
27. add disable led
28. add notification :)
29. finally fix sync interval :D

preview:
http://jira.omnirom.org/secure/attachment/10394/Screenshot_2014-03-07-19-54-57.png
http://jira.omnirom.org/secure/attachment/10395/Screenshot_2014-03-07-19-55-56.png
http://jira.omnirom.org/secure/attachment/10396/Screenshot_2014-03-07-19-56-06.png
http://jira.omnirom.org/secure/attachment/10397/Screenshot_2014-03-07-19-56-14.png
http://jira.omnirom.org/secure/attachment/10398/Screenshot_2014-03-07-19-56-27.png
http://jira.omnirom.org/secure/attachment/10399/Screenshot_2014-03-07-19-56-34.png

Conflicts:

packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Conflicts:
	core/java/android/content/Intent.java
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/BootReceiver.java

packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java

packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
	services/java/com/android/server/NotificationManagerService.java

Change-Id: I89f7885f303bf236a7af9a4700fa81cce0cffebb
Signed-off-by: STELIX <ssspinni@gmail.com>
FWBase: assign PowerMenu on longclick Tile Sleep

Change-Id: I66532df1eefd681328fd207639c99a9f8d82f285
Signed-off-by: Stefano Mura [STELIX] <ssspinni@gmail.com>
Add PowerMenu QS Tile 1/2

Credit:Daxx & Winner00

PS6 : Try to fix PowerMenu Tile

Signed-off-by: MURA Stefano [STELIX PippoX3] <ssspinni@gmail.com>
Change-Id: If08248a6e9ab714fb04fe22513d0f07a58b881db
FWBase - Add all the possible ringtones available [1/2]

Change-Id: I33ea8a89f9368328dc177179266cfcc39d751a4d
Signed-off-by: Stefano Mura [STELIX] <ssspinni@gmail.com>
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.

Conflicts:
	core/java/android/app/ContextImpl.java
	core/java/android/content/Context.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
	services/java/com/android/server/InputMethodManagerService.java
	services/java/com/android/server/SystemServer.java
	services/java/com/android/server/am/ActivityManagerService.java

I'm leaving out the changes to NavigationBarView & PhoneStatusBar.
Won't play along with slim's navbar implementation.

Change-Id: I812a3757bdb56c429b5870ff922485439ae00f8d
fonts: Add LBhashitaComplexSans font for Sinhala

* From http://www.siyabas.lk/files/Bhashitha_Linux.zip

Change-Id: I293bfe84efd663d5a105541196e2bb3b123ee192
Make the default value of in-call noise suppression configurable.

Change-Id: I1dc0b6085807c49370a06243689b70ea4b91732b
Fix the value type of def_noise_suppression

Change-Id: I0b94e9b24af959fa1c16c807ba83890b2ce077ad
Move theme strings to cm_strings.xml

Also correct application->app

Change-Id: I13afe2b810ccb8f9a5fa9484a5cd93ec9820ed6e
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
frameworks/base: Call setDirtyRect to update dirty rectangle

This change updates dirty rectangle instead of dirty region of a
surface.

Change-Id: Ic5c6e68ff644911a596a2432fd14868edbff9b17
Keyguard: Set untranslatable

Change-Id: I83fd46ec44b65523e7f6f838ef93320d83bfe50f
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
core: Add support for Galician

Change-Id: I6a8f18d07436ff414897c63170e7eaebcf93e891
quickboot: Disable quickboot by default

* We probably don't want to enable this by default on devices that have
  it because it is confusing to users attempting to shut down their
  phones.

Change-Id: I80eb946f93509cb3b32f6c790611597921b9c54a
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
Duplicate strings

Change-Id: Icb8745c02efd611b8f285e0ce600b832447bb9e4
Gesture Lockscreen [1/2]

Signed-off-by: MURA Stefano [STELIX PippoX3] <ssspinni@gmail.com>

Change-Id: I9820644d0a5752d62b8219e820e696c9157e949d
Add OpenCnam paid account settings keys

Change-Id: I895b5f2b2a8a8de568e5aa1cea5d66ba490985fc