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

Change-Id: I6b794d6c9c27b2d6436bdf4fec51c84a7859c134
settings: Enable the status bar double-tap to sleep gesture

Change-Id: Ibe4f1d0c864f261211d7ded418abfe45633e1392
[1/3]frameworks/base: add "Accept all files" option for incoming files via Bluetooth

This patch defines a key to store the option value in Settings Provider db

Change-Id: I993d7ec77b49f608a5a17e5a8516e52fc5d82946
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
Revert "ActivityTrigger:  New class to invoke when activity starts/resumes"

 * No longer supported upstream, and will be superseded by new
   CM functionality.

This reverts commit c5bb1bbd0a59640ec394ee729b57de34295a4e99.

Change-Id: Ieb26fb1db62b739e048a6a9b87fb33579b4ee285
perf: Improve performance profiles

 * Performance Profiles is going to grow into a much more powerful
   feature which can apply advanced optimizations or power saving
   techniques depending on both the state of the hardware as well
   as the current applications in use.
 * Refactor the original code and move it into PowerManager so
   that it's managed from the same place.
 * Implement "automatic performance profiles". This feature will
   automatically select a profile when specific activities are
   running. Currently this list is static and engages performance
   mode for several benchmarks (trollface).
 * Added support for a new power hint, POWER_HINT_SET_PROFILE.
   Currently, these profiles are fired using a property trigger
   in init. This is easy, but the PowerHAL can do more.
 * Moved the setting to Settings.Secure and also wrapped calls
   to the service in the DEVICE_POWER permission. Nobody should
   mess with this stuff except the system.

TODO:
 * Allow user configuration per-app.
 * Implement an advanced power-saving mode.

Change-Id: I140ebc0648c4cf05900e005923247c3180be8c93
wm: Nullify hardkey function assignments if enabling the navbar

This caused erroneous (and sometimes duplicate) events being generated
due to the regular key function assignments. The navbar does its
own action management, so don't try to derive from the actions
usually present in hard keys.

Change-Id: I82866e24547f8145cac4f07820ae90aacce09281
wm: Make the default menu longpress action configurable at build time

Do the same we do for home. For CDD validation, we need to switch
the menu and home longpress action, since Home must map to Google Now.

Change-Id: Iacfedf711d43f6637023c87c00e6c6b8b8a437dc
settings: Add support for default ribbon config

Change-Id: Ib4567431ce136813466ec87bba0581caafe0b352
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
Fix circle battery opaqueness for the low battery color

Because of the DST_ATOP Xfermode the color was drawn below the full
gray ring resulting in a washed out red. Fix this by not setting an
Xfermode and drawing the color normally.
This does not affect the non-low color as it cannot get any whiter.

Fixes: CYAN-3282

Change-Id: If1183dcb272e84858371be3765ba758fa2560eeb
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