PowerManagerService: Optimize button illumination
The current implementation of button/keyboard illumination is a bit flaky
When the device goes into deepsleep before the illumination time has expired
the buttons stay illuminated all time

The issue is fixed with this commit by setting button and keyboard brightness
to 0 when wakefullness state is not WAKEFULNESS_AWAKE because there is no point
to still illuminate the buttons when device is already dozing or dreaming

Change-Id: I01e66462271df57a6840a9ab9f40a7b51228c736

Conflicts:
	services/core/java/com/android/server/power/PowerManagerService.java
Clear Recent Apps (From NavBar)

Original author: TheMrcool212

this is not using cm's clear recents way, cm uses a button to clear recents but mrcool coded like pa's way at kk based pa roms so navbar recents button turns to clear all button when you open recents menu.
SystemUI: add Weather display to status bar header (1/2)

Signed-off-by: Roman Birg <roman@cyngn.com>

requires: android_packages_apps_LockClock

Change-Id: Ic2fea861c36f405d8a0e64cc9224f47088ac6351
SystemUI: add quick settings pull down with one finger

Logic is currently set to use 1/3 of right hand side of the statusbar to
trigger a quick settings quick pull down, quickly.

Change-Id: I3f536496f724f07d2419a5b2db5fa8f8261609e7
Signed-off-by: Roman Birg <roman@cyngn.com>

(cherry picked from commit f2ce6f5cc21aac4b1dd1c80b8c9b970d383264f4)

(cherry picked from commit d87f7d89eec86bab8497c7fa169fe939fd552c61)
SystemUI: fix right hand side gestures on lockscreen

two finger quick pulldown was not accounting for being in the keyguard
adn was eating touch events when it shouldn't be.

Change-Id: I625d48a4002aaaf2d55d7efaed65d892ab7aa13c
Signed-off-by: Roman Birg <roman@cyngn.com>

(cherry picked from commit d302aff6b7011dea25a4a7f41828cb71752e1a85)

(cherry picked from commit a0457606f97e1faaef48f4820bc2655b0cb3acea)
SystemUI: make long pressing recent switch to last app

With this patch, long pressing the recents key on the navigation bar
will attempt to switch to your last application in the activity stack
before the active one.

The user's current home launcher package is ignored as well as SystemUI (so that
RecentsActivity does not influence the behavior).

Change-Id: I38771e0fce16b55bb5186af47115b4e812cb60b0
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
frameworks: allow last app action to be assigned to hardware keys

Also fix multi-user handling for 'switch to last app' and 'kill
foreground app' actions.

Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Danny Baumann <dannybaumann@web.de>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>

Change-Id: I1fb586d19b1198e6888b0f11e0a2813acf0bcd5b
Forward Port: Volume button seek on screen off [1/2]

PS : Fix the short press event type

Change-Id: Id55a1240a133b5144502fced862bae040b390662
Signed-off-by: cj360 <ayunker551@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Revert "SystemUI: add Weather display to status bar header (1/2)"

This reverts commit da6047aed70f63d9241ad79359be08db01795cc0.

Signed-off-by: cj360 <ayunker551@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java

Change-Id: I820e01b9d1aa68636f9458682c590f116f350c12
add advanced reboot options

Signed-off-by: cj360 <ayunker551@gmail.com>

rm duplicate string

Signed-off-by: cj360 <ayunker551@gmail.com>
[1/2] frameworks/base: Battery and Notification Lights

PS2: *) Add back a few missing pieces
     *) Do not clear light state in onPanelRevealed(),
        update lights on ACTION_SCREEN_ON instead

PS3: *) Wrap long lines
     *) Disable config_multiColorNotificationLed by default
     *) Revert config_defaultNotificationLedOff
        from 1000 back to AOSP default of 2000

PS4: *) Clear lights in onPanelRevealed() if
        keyguard is not active.

PS5: Coding style tuning

Pulled together from:

Author: DvTonder <david.vantonder@gmail.com>
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Mon Nov 4 00:57:51 2013 +0000
Framework: Port CM9 features to CM10
Change-Id: Ibd63116df90b06f6ce6adb8a0343059bbb999bfb

Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Date:   Sun Dec 8 15:24:41 2013 +0700
BatteryService: fix FC on boot until battery stat is present
updateLightsLocked() can be called from CM's added SettingsObserver
when battery stat is not present, causing an FC and a loop until
battery stat is present.
Change-Id: Ic4438fe50e98f1aa05ae1d0d26240bf9410fd92f

Author: Sam Mortimer <sam@mortimer.me.uk>
Date:   Tue Dec 31 16:22:05 2013 -0800
[2/2] Framework: instant led test
Adds support a new notification extra boolean
EXTRA_FORCE_SHOW_LIGHTS.  Used by settings
notification light picker to force lights on
when the screen is on.
Change-Id: If0a42d32b28fe8c02ef5f7dd148db7eb478fac17

Author: Danny Baumann <dannybaumann@web.de>
Date:   Wed Apr 24 11:09:55 2013 +0200
Allow creating custom dialogs in DialogPreference.
This allows creating non-AlertDialogs while still using the click and
state handling of DialogPreference.
Change-Id: I54fd7d6d6b9f6a49fef1ae95e0178838b3edfa56

Author: Michael Bestas <mikeioannina@gmail.com>
Date:   Mon Aug 18 04:56:28 2014 +0300
Add support for single color notification LED (1/2)
Change-Id: I367af77036da9e87c6dd0df552ce4c56d945a44d

Change-Id: I564fdb6ca6c5bbcf890afa4b9a2f9fa7bf8b9604
Signed-off-by: cj360 <ayunker551@gmail.com>

Conflicts:
	core/res/res/values/cm_arrays.xml