SystemUI: fix memory leaks

ContentObservers are being registered without being unregistered,
causing old objects not to be garbage collected. This causes memory
leak if the classes are destroyed and recreated throughout the
device's uptime.

SearchPanelView is recreated every time the screen is turned on.

Signed-off-by: Paul Beeler <sparksco@gmail.com>
[1/2] Power connect/disconnect notification support

part 1/2: frameworks/base PowerUI and Settings

part 2/2: packages/apps/Settings Sound settings

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
Mms auto-retrieval (1/3): framework

Change-Id: I9b2f76d8cf9d67eddddfdf7737a948eea680329f

It's only porting this http://review.cyanogenmod.org/#/c/26166/
Part 1 of 3
Don't start keyguard in an attempt to exit it.

exitKeyguardSecurely() will open the keyguard if it's currently disabled
by an app. As this is unwanted here (the user has either already
bypassed the keyguard or the keyguard isn't secure; otherwise he
couldn't click on a notification entry) and as the lockscreen already is
dismissed a few lines above, don't call exitKeyguardSecurely here.

Change-Id: I5582da350d8826e42f9edcd56845a59965865c8b
JIRA:CYAN-99
KeyEvent: update comment

Change-Id: I1ea491e7e23670bf0ea83392710010b557803178
Don't let apps disable the SIM PIN entry screen.

As the user (who controls the app behaviour after all) likely doesn't
see the PIN screen as a lock screen (he likely wants telephony) and the
PIN screen is not shown on a timer-driven basis, it should be treated
specially.

Change-Id: I3572a80d4a515d72e3aa4a6e933e980fa4516c2b
Option to wake up the device when plugged/unplugged (1/2)
Fix Watchdog HeartbeatHandler to run on correct thread

The HeartbeatHandler for the System Server Watchdog has been running
on the wrong thread due to a race condition in initialization.  It's
designed to run on ServerThread, so that it can catch lockups in the
main looper of the System Server.  It has been running on
ActivityManagerThread instead, so it does not detect lockups on the
ServerThread as it should.

ActivityManagerService is calling Watchdog.getInstance() before
ServerThread calls Watchdog.getInstance().init(), so the handler is
being bound to the ActivityManagerThread instead of the ServerThread.

Explicitly bind HeartbeatHandler to ServerThread, so that the Watchdog
catches lockups on this critical thread.

Change-Id: Iccb184ac3adb817feb86ed4ee0e50e443bf74636
Allow creating custom dialogs in DialogPreference.

This allows creating non-AlertDialogs while still using the click and
state handling of DialogPreference.

Change-Id: I54fd7d6d6b9f6a49fef1ae95e0178838b3edfa56
Fix SystemUI memory leaks on theme changes.

ContentObserver instances were dangling after the status bar was
recreated.

This patch has been modified from original CM patch to work on
SaberMod

Signed-off-by: Paul Beeler <sparksco@gmail.com>