fb: use on virtual POWER_KEY own global menu handling

we use the POWER_KEY down event to call the global menu from SlimActions
to allow to add shorcuts to the global menu.

Handle this undependent of non virtual key events and call the global menu
directly without vibration and without delay.

Just put it into the message que and done

Change-Id: I7d9af04605696d41bee949cfd99f6de4c4be6baa

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Set Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE default value

To be able to customize the "WiFi scan always available"
setting we need to set a default value.

Change-Id: I3673f2613ab9b6a947aed7e29d4cc876140c2180
Fixed stylus eraser being rejected by palm rejection

The stylus eraser appeared not to work, i.e. Android did not respond to
input from the eraser. It turned out that all input except stylus input
is rejected when palm rejection is activated. The problem was that the
eraser itself activates palm rejection when it hovers. The solution is
to allow the eraser during palm rejection. This solution makes sense
because the eraser input works in the exact same way as normal stylus
input.

Change-Id: I90824500be7613af4f00427c59ce828528b632f7
Harden against transiently unavailable backup transports

The init & clear operations are particularly important to ensure
delivery when at all possible, so we retry those periodically
if the transport is unavailable when we first attempt them.

Now with 100% less build break.

Bug 11716868

Change-Id: I2af4e93788068cfac97c0a48d3568c561eefa23d
Handle backup transport registration dynamically

Bug 11369873

Change-Id: I9bbdcc21ce25159c6645690123b5d03c553b0ddc
FLAG_PRIVILEGED disappears if privileged app is updated and rebooted

Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.

Bug: 12640283

Change-Id: Ic24b5882f65dabdfae9cc39da3d68661bed4fc31
Only send storage intents after boot complete

It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.

If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.

Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.

Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
Remove unused field from AssetManager.

This field was introduced in commit 4bdd33b81a17 but wasn't
used there (or since).

Change-Id: I0615e98b8990d42da6b85f8094ab19eb0465fd9e
Telephony: Modify code to check that PUK code length is always 8.

As per 3GPP TS 31.101 Release 11 section 9.6, the number of digits
for UNBLOCK PIN (PUK) is always 8.

Change-Id: I4ea69fd8e2e8e96330d10a67b2d1f5a1859c1016
[1/2] FB: Make menu unlock configurable

For devices with hardware menu keys, menu unlock is turned on by default
This can cause unintentional unlocks. This commit adds the ability to turn
Menu Unlock on or off as desired (Settings -> Security)

System Default is for menu unlock to be ON. This default value can be
overriden using a device overlay:

overlay/frameworks/base/packages/Keyguard/res/values/config.xml
<!-- Allow the menu hard key to be disabled in LockScreen on some devices -->
    <bool name="config_disableMenuKeyInLockScreen">true</bool>

This commit requires the matching commit from Settings repo:
https://gerrit.slimroms.net/#/c/2395/

Based On: https://gerrit.omnirom.org/#/c/3317/

PS6: correct config/overlay location and make multiuser compatible
PS7: derp
PS8: remove the symbol
PS12: rebase

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

Change-Id: I3b6108e4bd403cb76827daed226a4d6a5b868741
Squash UMS Commits [1/3]

Credits: CyanogenMod

Change-Id: I09ed8bcc053f545377f28839673eadd2b9a2b872

Conflicts:
	core/res/res/values/symbols.xml
	services/java/com/android/server/usb/LegacyUsbDeviceManager.java
	services/java/com/android/server/usb/UsbDeviceManager.java
	services/java/com/android/server/usb/UsbService.java
Revert "Remove 'Allow custom buttons' checkbox (1/2)"

This reverts commit 063789e40f7191e6a21aa44166f9b2ad92cfcc2c.
Revert "Camera button support (1/2)"

This reverts commit c6c2a7b7719a85848a8fa19fba2e4c9349ec836b.

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/config.xml
Revert "Fix hardware home key behavior on wake-up"

This reverts commit 47f3801c7e3b2ccdd79ae9f8f50fca7da634a8ce.
Revert "PhoneWindowManager: Hardware key handling fixes and cleanup"

This reverts commit 9432fdea05a7856559ed20a539787c82ef43e67c.
Revert "Enable custom actions for double-tap home (1/2)"

This reverts commit 0e1611f8b1595c3a9d220f3ae313d2eee7b90334.
Revert "Fix virtual key press detection."

This reverts commit eba3edd4a1f028b08c538bf337b722b696dcaf48.
Revert "policy: fix menu key for devices with no physical menu key"

This reverts commit 97c57784d062422080d4c6f742c7080d84883a41.
Revert "Always prevent wake on home keypress when kl config does not contain WAKE"

This reverts commit b7b81ff67c0cd25d22c54c201d34f69ee1450e92.
Revert "[2/2] Permit home button wake to be configurable"

This reverts commit 47fd2c407ff79c7934a8e20b42c00e6fede51ca7.