SystemUI: Add double tap to sleep gesture

Change-Id: I4c54718e8ec8774677d13917b3a7ffa3b4b18cb5
Remove the navigation camera icon in keyguard if disabled by DPM

The logic here is incorrect: the camera shortcut is/should be accessible
even with a secure lock screen. As a result, a device with the lock
screen camera disabled by DPM and an insecure lock screen would still
display the unfunctional shortcut.

Change-Id: If1d172932c6c2af596c38e623521c992fdf95402
Limit QC camera features to post-ICS HALs

ICS blobs don't support longshot, and have a different API/method enum
for histograms

Change-Id: I6704b9302344ae2ae6386312b68de669bb5c11f2
WifiController: fix high perf lock sometimes not respected

When the device screen is turned off, the state is DeviceActive for
15 minutes. In this time, high perf lock is not respected and
Wi-Fi power-saving mode will be turned on because screen is off.

Fix by adding a new DeviceActiveHighPerfState.

Change-Id: I71074beec4d41286dea0861107d7931da205aca2
JIRA: CYAN-2860
AppOps: track op persistence by name instead of id

On XML write, include the op name.  On XML read, map
the name back to op id (if it exists).

Persistent AppOp state now follows the op name instead
numeric id.  This allows upgrades between versions of
android that have different code<>name mappings.

Change-Id: Iffc02095b6838a34ff999f8db51c2c6739dd0db8
Revert "Fix for Concurrency issue reported in  525529"

This reverts commit 7eb1fcb76989f11aaa9ca0a78e0361239ff5317d.

Change-Id: I37815b93bf2b25caff171888dc13788479a9c8c4
CRs-Fixed: 585504
Use highp precision for scaled coordination

If scaled coordination is closer to zero than what
the medium precision can store, distance becomes
zero and it causes divided by zero.

Change-Id: I8ee921dd1f57564a442e685266b12d95fc08e165
NetworkPolicy: Validate policy templates before updating

Ensure all the policies to be added are validated, otherwise
this service will throw IllegalArgumentException and cause
system crash when updating network template after receiving
ACTION_NETWORK_STATS_UPDATED.

Change-Id: I3faef0ac2a2fcea64ba5dde9c9256f6714280e2e
CRs-Fixed: 561490
WifiState: Don't aquire transitionwakelock in airplane mode

NetworkTransitionWakelock is for transition from Wifi to mobile.
It will cause device no sleep for 60s. There is no need to acquire
it in airplane mode.

Change-Id: I1487dc4787948d09e482f22e88d01768b54964da
[1/2] LED: Battery Light

==Requires==
in device tree's overlay/frameworks/base/core/res/res/values/config.xml:

    <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
    <bool name="config_intrusiveBatteryLed">true</bool>

    <!-- Does the battery LED support multiple colors? Used to decide if the user can change the colors -->
    <bool name="config_multiColorBatteryLed">true</bool>

PS6: enable by default
PS7: rmv public.xml additions
PS8: incompatible types getInteger to getBoolean
PS9: Works

Signed-off-by: Andre Saddler <dresadd09691@gmail.com>
Change-Id: Iadaba42c1752e31cc77804e5b0d01788724c35c8
[2/2] Frameworks: HALO

Forward port from jb.
PS1: Initial port
     Fix conficts with notification LED
     Fix derp
     Major derp
     HALO Mods
     Rebase
     Fix blackist, code clean and added some TODOs
PS2: Fix build
PS3: Fix bubble sometimes doesn't respond on new notification
PS4: Align halo icon
PS5: Keep floating app in recents and disable transparent layer temporarily
PS6: Fix conflict after recent merges
PS7: Cosmetic fixes:
     Fix buttons layout in status bar.
     Status bar button holders show halo + qs switch on notification and qs edit mode + notification switch on qs.
     Update new margins size.
PS8: Rebase
     Clean white spaces
     Toggle on/off from notification shade icon (remove red X)
     Standardize behavior (remove option to reverse tap/double tap)
PS9: Remove references to LayerActivity

Change-Id: I3e79945433d61da090ca263f4e2989be9987f11d
Conflicts:
	packages/SystemUI/res/values/pa_strings.xml
	services/java/com/android/server/am/ActivityStack.java