fix soft reboot while formatting

While formatting it's possible to cause a framework crash if the format
opperation is not successful. The 'getCode' function in
NativeDaemonConnectorException can cause a NullPointerException, since
'mEvent' can be null. If an exception is thrown while formatting the
thread will try to create a Toast to notify the user of failure. This
causes a RuntimeException because a Toast cannot be shown from a
background thread. Make sure 'getCode' will not throw a
NullPointerException and also create a handler so that the thread can
send a message in order to create a Toast.

Change-Id: I04c250c46509ae38b0d0a5bfc0e950efbad58305
Conflicts:
	core/java/com/android/internal/os/storage/ExternalStorageFormatter.java
Fixed broken syntax in ExternalStorageFormatter and NativeDaemonConnectorException

Added missing underscores and incorrect case in variable names
Fixes errors created by https://gerrit.paranoidandroid.co/4004

Change-Id: I9571a08e0fa482135b5e3c6ec30af9c9dbf2edd0
Don't cleanup overlay mapping for non-theme apps

mOverlay structure should keep all app/theme mappings even
if the app does not exist. Otherwise we will have to insert back the mapping
for every app that is installed which would be time consuming.

Without this patch an upgrade app loses its applied theme
until the device is rebooted.

Change-Id: Id02b8e0a3bdd78d1a9d39cd38294c584ef95f8db
appops: enforce appop for bluetooth disabled action

Bluetooth disable action should be enforced in the same manner that the enable one.

Patchset 2: Fix derp
Patchset 3: Fix build
Patchset 4: Rebase. Fix comment style
Patchset 5: Rebase

Change-Id: Ie161ac0c038acbd4c1ce7f27ab4c5897813fd4cf
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
PIE: EdgeGestureService: Add flags LONG_LIVING | UNRESTRICTED

Following PhoneWindowManager enforcing.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Merge branch 'kitkat' of https://github.com/AOSPA/android_frameworks_base into kitkat

PS2: base: Remove deprecated AOSP menuKey (SferaDev)

Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:
	Android.mk
	core/java/android/view/ViewConfiguration.java
	core/java/com/android/internal/os/storage/ExternalStorageFormatter.java
	core/res/res/values-fr-rCA/strings.xml
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/ConnectivityService.java
	services/java/com/android/server/power/DisplayPowerController.java
	telephony/java/android/telephony/PhoneStateListener.java
	telephony/java/android/telephony/TelephonyManager.java

Change-Id: Ieadc43146fcc43d78e127238552f54ba887cfd0e

Conflicts:
	core/java/android/widget/AbsListView.java
	core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png
	core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png
	core/res/res/drawable-xxhdpi/cab_background_top_holo_dark.9.png
	core/res/res/drawable-xxhdpi/cab_background_top_holo_light.9.png
	core/res/res/values-mcc404-mnc17/config.xml
	core/res/res/values-mcc404-mnc85/config.xml
	core/res/res/values-mcc404/config.xml
	core/res/res/values-mcc520/config.xml
	media/java/android/media/AudioService.java
	packages/SystemUI/res/drawable-hdpi/ic_qs_cast_available.png
	packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connected.png
	packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_0.png
	packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_1.png
	packages/SystemUI/res/drawable-hdpi/ic_qs_cast_connecting_2.png
	packages/SystemUI/res/drawable-mdpi/ic_qs_cast_available.png
	packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connected.png
	packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_0.png
	packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_1.png
	packages/SystemUI/res/drawable-mdpi/ic_qs_cast_connecting_2.png
	packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_available.png
	packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connected.png
	packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_0.png
	packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_1.png
	packages/SystemUI/res/drawable-xhdpi/ic_qs_cast_connecting_2.png
	packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_available.png
	packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connected.png
	packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_0.png
	packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_1.png
	packages/SystemUI/res/drawable-xxhdpi/ic_qs_cast_connecting_2.png
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/power/DisplayPowerController.java
	telephony/java/android/telephony/TelephonyManager.java
Merge commit 'c8f73fd0178a875239f50f4d0a6f013a098be219' into kitkat-themes