LockScreen: allow long-press actions from hardware keys (1/2)

Allow following actions with button long-presses on lockscreen:
- toggle flashlight (if available)
- play/pause/next/previous track selection
- toggle silent mode

Allow customizing of back, menu, and home buttons. Search
button events are completely ignored on the lockscreen.

Auto-detect hardware keys, only show appropriate menu
options based on the actual hardware keys available on the
device (or completely hide if there are no hardware keys).

Based largely on Danny Baumann's work from gingerbread.

Ported from CM10

Conflicts:
	core/java/android/provider/Settings.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java

Change-Id: Iff32736d00ca5d4122f64a6a861bbb0a1de9cca9

Fix custom insecure unlock logic

The previous implementation of lockscreen hardware keys long press
actions has conflicts with the Menu/Home/Back key unlock methods.
This was due to a derp in the switch loop.
This commit fixes this

Change-Id: I03025b8c8217d3bd0999b784b1c3046646bfa70f

Frameworks: Lockscreen minor fixes

- fix for hide lockscreen page hints in landscape
- fix initial  logic rotation lockscreen

Patchset 2
- fix derp

cheers

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java

Change-Id: I19d5f0c5474986bee4ba5a6457ed0f47d530cfba
Avoid NPE when stop() is called inside callback

stop can be called inside onMotionChange. Since that mLastAcceleration
is null and it makes NPE when mUpdateRunnable is being excuted next
time.

Change-Id: I7ed276ef63eb7fcb8fcf4dedc53eba0b13fdc539
Signed-off-by: Alan Jeon <skyisle@gmail.com>
Statusbar: Revert all teh things! (1/2)

Go back to old way we did things. By that I mean get rid of the Hidden Statusbar Pulldown,
Hidden Statusbar Pulldown Timeout, etc, just for now to see if it helps with the Statusbar
deadzone issue. So with this picked, we have the AOKP Statusbar toggle and menu item again
to hide it. Once it is stable, rebase Hidden Statusbar Pulldown on the way RB is doing it.

Revert "Hidden Statusbar Pulldown Timeout (1/2)"

This reverts commit d3568058a1212785388fa607e2762128f043752d.

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

Change-Id: I78b6df83c373d7cfd5e330a59a0b62494704d227

Revert "Hidden Statusbar Pulldown (1/2)"

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

This reverts commit 66680fe3308d7f7d85689c39ea11193ebea4634b.

Change-Id: I305bdba51b9ef720aec722afc425c91261d318f3

Revert "Swiping on the top of full screen apps shows status bar for 10 seconds"

This reverts commit a2146dc8439946e4e23a8d0f96478570272174bf.

Revert "Fix and cleanup Expanded Desktop Mode"

This reverts commit 6e5dfa1e8f0b01fd581c483dde8be629d350f74e.

Revert "Status bar Auto-Hide [1/2]"

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

This reverts commit 88895541101981fa55f0d7744105aa0588a9864d.

Change-Id: Ib6229ef6e696e4beebdaa63dcd1f8a10e54709b1

Revert "Revert "Revert "Breaks Expanded Mode Revert "FW: Status Bar Hide toggle (1/3)""""

This reverts commit 504cf18bc2fdb541358e8c0dba56dab5e2198594.

Revert "Revert "Revert "Breaks Expanded Mode Revert "policy: add missing spacer view""""

This reverts commit 7016032228b5a519fb96959aa5ea3c3af191fe5f.

Revert "Revert "Fix statusbar toggle.""

This reverts commit f7b557868b05416bef0ab8f0094c743859aecea4.

Fix and cleanup Expanded Desktop Mode

no need to call state and mode several times from provider settings.
Cleaned up.

Also fix for the ugly lockscreen gap on expanded desktop
mode 1 and 3

And fix that mode changes reflects directly to the screen if
expanded state = 1

cheers

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I8cc0d936af270d72f2fb5c005a28c575576d894b

Conflicts:
	packages/SystemUI/AndroidManifest.xml