DialogFragement: Add null pointer check for mDialog for protection

DialogFragement can be dissmissed just after the Dialog is
established. This will cause NullPointerException.

Add null pointer check for mDialog for protection

CRs-fixed: 549689

Change-Id: If57f81d03a8ec2906598363b681ea38806fb2a90
SystemUI: Make percentage appear for hidden batt

This commit makes the battery percentage appear in QS when the user
chooses the "hidden battery" option as the battery style. Prior to
this commit, the same battery style was used for the QS tile just
without the percentage indicator. This means no major changes are
being introduced but the usability is being improved as the user
can glance at the QS tile to see the exact percentage instead of
being forced to open the linked Settings page.

Fixes AOSPA-687.

Change-Id: I2131332f2639721f99e149d3add0eb2877b4debe
Merge "DialogFragement: Add null pointer check for mDialog for protection" into kitkat
Revert "Return: Custom Carrier Label [1/2]"

This reverts commit 90aab4278438012b818fdd30211b592c4e0edbfe.

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

Change-Id: Idf949420f6a334c4522732d38916d230413559b3
Show Statusbar Carrier and Custom label [1/2]

    Ported to AOSPA from N5X CM11 Based by @AragaoAnderson

Change-Id: I61a0489a4e890536511d9d16caadc476f63bc24e

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
Hide the notification tray carrier label during and not after flip animation

    Ported to AOSPA from N5X CM11 Based by @AragaoAnderson

It's possible for the user to have enough quick settings tiles to cover
the carrier label during the flip animation. This looks a bit strange,
so hide the carrier label during a flip.

Change-Id: I9f164fde9f522f33c6bf8e591c0bfeae99d532c7
[1/2] Power connect/disconnect notification support

    Ported to AOSPA from N5X CM11 Based by @AragaoAnderson

part 1/2: frameworks/base PowerUI and Settings
http://review.cyanogenmod.org/#/c/35241/

part 2/2: packages/apps/Settings Sound settings
http://review.cyanogenmod.org/#/c/35242/

patchset 3:
    shrink a couple of long lines
    remove power_notifications_use_default option (folded into ringtone option)
    load default settings in global instead of system

patchset 5:
    support vibrate toggle
    ignore first power state change (on boot) if it's a DISCONNECT

patchset 6:
    fix ignore first power state change

patchset 7:
    change vibrate to default to off
    simplify first power state change ignore logic

Change-Id: I36a6b9f924d2cd52191a8e83a744745b37c5b068

Conflicts:
	packages/SystemUI/src/com/android/systemui/power/PowerUI.java
Add back navigation ring customization.

Change-Id: Iebe4ec7c2519b85cfd5189d060444764a50f3cf6

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/symbols.xml
	packages/SystemUI/src/com/android/systemui/SearchPanelView.java

Conflicts:
	core/res/res/values/n5x_symbols.xml
Add GlowPadView extensions needed for lockscreen targets and nav ring.

Change-Id: I4f82fd3fe04ac16c6737d38b2473f2a533c5d326
Framework : Lockscreen - Customizable shortcuts

Forward port lockscreen shortcuts

Change-Id: Ic3b935df5c0da35f31373d96943e442dc39cf11b

Conflicts:
	packages/Keyguard/res/drawable-hdpi/ic_lockscreen_chrome_activated.png
	packages/Keyguard/res/drawable-hdpi/ic_lockscreen_chrome_normal.png
	packages/Keyguard/res/drawable-hdpi/ic_lockscreen_contacts_activated.png
	packages/Keyguard/res/drawable-hdpi/ic_lockscreen_contacts_normal.png
	packages/Keyguard/res/drawable-mdpi/ic_lockscreen_chrome_activated.png
	packages/Keyguard/res/drawable-mdpi/ic_lockscreen_chrome_normal.png
	packages/Keyguard/res/drawable-mdpi/ic_lockscreen_contacts_activated.png
	packages/Keyguard/res/drawable-mdpi/ic_lockscreen_contacts_normal.png
	packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_chrome_activated.png
	packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_chrome_normal.png
	packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_contacts_activated.png
	packages/Keyguard/res/drawable-xhdpi/ic_lockscreen_contacts_normal.png
	packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
Framework: Fix some derps and define default targets for Lock screen targets

Change-Id: I2537d22387f88199d55c85980dbfc316db9217f7
Framework: HOVER Master switch [1/2]

    Ported to AOSPA from N5X CM11 Based by @AragaoAnderson

Change-Id: I9ebdbe1388d068319f2054af913edaab1b5bcd02
Framework: Add missing value

Change-Id: Iffcfec780db4f6631fc2efa3c439e34223f2b839
Update settings after recreating status bar.
This is needed to e.g. keep the status bar carrier after theme changes.

Change-Id: Id13bf0426f315de7cbd67229fcc5bf03dd70c331
SystemUI: fix lightbulb toggle delay on boot

Change-Id: Ib6e7ff4e312b1a8802df045bf9192746339d6dbc
Framework: Quiet Hours [1/3]

    Ported to AOSPA from N5X CM11 Based by @AragaoAnderson

Change-Id: If49e5f91f5ef4be2f00147826557d541444989a5
Framework: Lock screen notifications respect Quiet Hours

Change-Id: Ib1411169ac7e78c716f5cb41e479c2bc150e9ef1
Re-add auto brightness configuration UI (1/2) (Slim's implement)

This reverts commit 99729863d98894edad9bb6b83e5c0f86875aeabd.

Conflicts:
	services/java/com/android/server/power/DisplayPowerController.java
	services/java/com/android/server/power/DisplayPowerRequest.java
	services/java/com/android/server/power/PowerManagerService.java

Change-Id: I2469c04a52843d4c4eec97e66fd65e14fb2117c3
Add method to PowerManager that allows querying the lowest possible
brightness.

Used by the auto-brightness adjustment to adjust the sliders.

Change-Id: Idb58fd86dee1a053fe858291be6c9b3169ac4247
Framework: Fix for auto brightness implementation

Change-Id: I28ca27777e068a573622c3ce396c033e0c290386