Framework: Rewrite Quiet Hours (2/3)

Added:
	New Toggle States.
		Toggle is now aware
		of if quiet hours
		is truly enabled or not.
		Enable "force" mode
		on click: turns quiet hours
		on / off
		Double-click to return
		to "timed" mode.

	New Features:
		Wifi Connected Requirement
		Battery Charging Requirement
		Individual day times

        Completely rewrote quiet hours
                to reduce system calls.
                No more calendar objects
                or checking three preferences
                and comparing their values
                on each quiet hours check.
                Reduce that to ONE preference
                check per preference

PS2: Ensure booted before firing intent

______vanirized______

PS5: cleanup

Change-Id: I61ef5afa32c5ff883129b9362423af7f724c5ac1
Signed-off-by: Dan Trifan <jimsth@gmail.com>
quiet hours: add back the option to disable system sounds (1/2)

Change-Id: Ie494c441c3e0e48a5394fce3f5e0ef671c3d085f
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Framework: Quiet Hours Extra Daily Times (1/2)

Change-Id: I38301d53b57f6b0525edd2a7e13a2bd5022e7a65
Signed-off-by: Dan Trifan <jimsth@gmail.com>
quiet hours: change the QS tile logic

Got rid of double tap handle, it now cyrcles through modes now (off. timed and on).

Change-Id: I4d90cfcd916fd3edce05e20d56b1d79620556e69
Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/quicksettings/QuietHoursTile.java
quiet hours: refactor system sounds

thanks to SlimRoms

Change-Id: Ice90016f88cb3b5a35d860afec574d272d747d03
Signed-off-by: Dan Trifan <jimsth@gmail.com>
SystemUI: show statusbar icon if quiet hours is active

Reflects the 3 active modes we provide as status bar icon, similar to
android L.

Change-Id: Ic32242b0843f44de72174ee768ef04ee0f4535aa
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Add more functionality to hardware key rebinding 1/2

new functions:
- make back key rebindable
- make home key short press rebindable
- kill target
- navigate home
- navigate back
- last app
- ime switcher
- power menu
- toggle the navigation bar

PS1,000,000: clean up some stuff and add the ability to disable individual keys

Change-Id: I5cb31572b3c57529327a302e3b286ca041e051bf
Keyguard: add smart cover support

Change-Id: I436eba7678b923a9f293e15d786447214bc9bdcb
Signed-off-by: Roman Birg <roman@cyngn.com>
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>
policy: respect FLAG_TURN_SCREEN_ON flag with device flip covers

If an application uses WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
and the device supports covers and the cover is closed, then after the
screen would turn on due to this flag, it would immediately be turned off
because PhoneWindowManager thinks the cover is closed, so it puts the device to
sleep.

Respect this flag and do nothing if it is detected.

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