Unify Settings icon and light theme

Signed-off-by: Chintan Shah <cgintan1998@gmail.com>
Notification drawer brightness slider: fix fc on settings button
Swap volume buttons when the screen is rotated (1/2)

See: http://review.cyanogenmod.org/#/c/14530/

Patch Set 8: Invert the orientation interpretations on tablets

Change-Id: I201febc2827e6fbd347cb0e3f8d3347ad1bc487b
PS19 for Multitasking

Signed-off-by: Chintan Shah <cgintan1998@gmail.com>
Bring inline with App CircleSidebar

Thanks to Omni and Yanuar Harry

PS19 - Floating Window Multitasking
PS16 - App Circle Sidebar
PS9 - Add support for Floating window in App Circle Sidebar

Updates bring in cleanup for app circle sidebar, support minimize and maximize window, and more

Signed-off-by: Chintan Shah <cgintan1998@gmail.com>
Base: App Circle sidebar (add support Samsung multiwindow flags)

this will automatically add app into app circle sidebar
if apps support samsung multiwindow flags
in their manifest

PS.2 : rebased

Change-Id: Ifa8965f1fb5d24987aed7d6d52a4e77deb48c455
SystemUI: Chamber string edit

Let the user know that the setting simply may not
	exist in the settings database yet on failure
	to parse the key.

PS2: Use only for settings database mismatch (not
	values toggled)
PS2: Dependency

Change-Id: Idec8ea425ea46ff0ebfda37451c521b08d2d4979

Conflicts:

	packages/SystemUI/res/values/mahdi_strings.xml
SlimRecents: Adress the 50ms touch unsresponsive issue

User reported that if the screen is fully animated in that the touch
detection is not working for about the first 50ms. For user who are working
fast this is indeed an issue. Especially due that the recent screen speeds
up the workflow much already.

Problem is our third loading stage due that after the recent screen animates in
it calls getView on all elements which rebuilds the touch listeners and cause to
the slight timeframe where it is unresponsive.

Well the third loading stage was a left over from the first optimizations when
we started to develop this feature. Other optimizations are into place now so we
do not really need the third loading stage at all. So instead of handling now
the fix in the getView implementation of the arrayadapter we simply just remove the
third loading stage completely.

PS:
- small other optimization

Change-Id: Ibf46fbe393de4f9d6b867e6bdb9c331dff1dd38e
Volumes in Settings/Sound is slow to start

There is a delay after pressing volume menu item
there is a delay until the Volume popup is shown.

The reason for this is that the initialization of
the different seekbars is slow and run in the main
thread. More specifically the call to get the
ringtone from the RingtoneManager is causing this
delay.

Moving the call to the ringtone manager to the
handler thread used to play ringtones to make
the launch of the volume dialog a bit snappier.

Change-Id: I76da0226592468debd542d67164b37b2b59897c7
Solve three memory leaks related to PatchCache

A Patch can be fairly large, holding bitmap data, but
is also frequently leaked which adds to the severity.
The feature is used in many important processes such
as Home, SystemUI and Chrome.

The following leaks are solved:

1. The Patch itself was not always freed.
PatchCache::removeDeferred() can mark patches to be
cared for by PatchCache::clearGarbage(). But
mCache.remove() would only destroy the container
and the pointer, not the Patch object itself.

2. The vertices stored in the Patch at Patch::createMesh()
would always leak. The empty/default destructor in Patch
would not properly destroy "vertices" since it's just a
pointer.

3. A BufferBlock that's added to the mFreeBlocks
in PatchCache could leak. The leak happened when a
patch later needed the entire free block, because the
object was removed from the list but never deleted
in PatchCache::setupMesh().

Change-Id: I41e60824479230b67426fc546d3dbff294c8891f
GlobalActions: Fix Airplane Mode on/off issue

Issue: Unable to turn off Airplane mode from power button
       after phone reboot

Fix: Initialize mHasTelephony before the PhoneStateListener is
     registered to the TelephonyManager so that correct value
     of mHasTelephony is reflected when onServiceStateChanged
     callback is called.

Bug: 13697360
Change-Id: Ide8afd9c16ea90b98b5912dbff440c5fd67b178d

Conflicts:

	policy/src/com/android/internal/policy/impl/GlobalActions.java
base: Fix screen on stats after a boot

Prior to this change, the following sequence:

  * Turn the display off
  * Issue a reboot via adb
  * Unlock the device (after rebooting) before the screen turns off

results in the screen being on but the battery stats not reflecting
this fact.

In general, the mismatch occurs when either there is no serialized
battery stats state or when it is serialized in a state where the
screen is off.

Change-Id: I17374553fae6a08a1be8fdf445967509474177a9
Fix problem where PhoneWindowManager waits for keyguard to draw

This fixes a problem where PhoneWindowManager times out waiting
for keyguard to draw when it's disabled.  Instead, we pass a null
token back which allows PhoneWindowManager to continue.

Fixes bug 11190932

Change-Id: I041ea1d88dca681476d9477a3aab54559976b312
SystemUI: Chamber - Add Global Databases

Change-Id: I25eab5951f8d127ee80be3848766653b9e8d5523
Parallel shutdown

Decrease shutdown time by doing some shutdown tasks in parallel.

There are two threads executing during the shut down: the ShutdownThread
and a separate thread for the radio shutdown. However, the execution is
done in serial, as the ShutdownThread immediately joins on the radio
thread.

This commit will move the shutdown of the radio to the beginning of
shutdown and execute it in parallel to the shutdown of the rest of the
system.

The flow of the two threads during shutdown is now:

Radio Thread
  * Start shutdown of the radio
  * Wait for radio off or time out
  * Notify that the radio is done
ShutdownThread
  * Broadcast ACTION_SHUTDOWN as a parallel broadcast. (The receivers
    will get as much time to handle onReceive as it takes execute the
    rest of the tasks in the shut down flow. If they are not done in
    that time, we don't care.)
  * Shutdown ActivityManager
  * Shutdown MountService
  * Wait for MountService and radio to notify done
  * Vibrate
  * Low level shutdown

PS
- fix derp

Change-Id: Ifdd8a9c75337fd9d00148a0d2b9917e10fa60634

Conflicts:

	services/java/com/android/server/power/ShutdownThread.java
Keyguard: We need to ensure that keyguard is showing as well to set the token

Google fix

https://github.com/SlimRoms/frameworks_base/commit/021806ec33f5f59567f3bb3af135b2a1d88c0951

fixes what it is meant to fix.

But still we need to ensure if the keyguard eg is disabled by 3rd party
apps or the keyguard is not showing due of other reasons to inform PhoneWindowManager over the token
not to wait to draw for the Keyguard and go ahead.

Fix:
Just check for isShowing in addition to the check if KeyGuard is disabled

Change-Id: I5f017a6ccebf12dc717fb6d44802a1c1fee15abc
Send out USER_PRESENT broadcast on screen on if lockscreen is disabled.

This makes sure to turn off the notification LED on screen on when the
lockscreen is disabled by lockscreen toggle tile.

Change-Id: Ibf2fdcd912a2719d973a253aaf3752add7a22e00
Fix visibility of camera widget on insecure lock screens with DPM

The camera widget should be visible on an insecure lockscreen even
with the KEYGUARD_DISABLE_SECURE_CAMERA policy flag set.

Change-Id: I37ff905c6325be9120b16984d3401f334ad00e4c
add VoiceWakeup Settings value

Change-Id: I798d1ed9b2bda0fe8a36b8fa2bd17d74d2a09cab

Conflicts:

	core/java/android/provider/Settings.java
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>