Set foreground priority for shutdown receivers.

The broadcast of ACTION_SHUTDOWN has a timeout of 10 seconds. To
reduce the risk of hitting the timeout and speeding up the
shutdown sequence in ShutdownThread we set the priority of the
BroadcastReceivers to FLAG_RECEIVER_FOREGROUND.

We have seen that this change reduces the shutdown time when
the system is under heavy load.

Change-Id: I22cbf6af8cf6fc4bdefaa1c3da8a7eed7e7b7674
Fix for third party installing with HALO active

Change-Id: Ib4226d021804900f0f922cf95bb2dd49696a0d6d
Fixes for clang:
PackageInfo is a class, not a struct.
String16 is contained in the android namespace. Do not namespace prefix it
within the android namespace.
Explicitly specify which std classes are necessary to prevent ambiguous
type errors. (map, set)

Change-Id: I0d01477a976e770821ebae8847f8d11b132a15d6
Revert "Auto-close if you swipe away the last notification."

This reverts commit 8cc36e572876f3bb9197f0109db3042466e5f917.

It didn't work as advertised anyway: It only worked if there are no
persistent notifications, and it also closes the notification area if
the notification is closed by the app itself.

Change-Id: I16f0fb6cf41d20c3a3bd4278446edab780c1fc77
Fix occasionally flickering music control widget.

The problem was seemingly related to the player abandoning audio focus
while the playback state was still set to 'playing'. In that case, the
transport control was removed from the keyguard host because it had no
listener anymore, but later was re-added due to isMusicPlaying() still
returning true. Re-adding it lead to it re-registering with audio
service, which cleared the display due to nothing being connected, which
lead to the detachment listener being called again, which in turned
closed the loop.

While this may be a sign of a buggy player app (it should stop its
playback prior to abandoning audio focus), this situation still should
be handled gracefully. Fix the problem by simply reporting no music
being played while no remote control client is connected.

Change-Id: Id6834d38bc6faa3b6455ac66b413443f85606785
Always call out to KeyguardHostView when something in our state changes.

KeyguardHostView already takes care to not add or remove the transport
control twice.
This should hopefully fix some conditions where the transport control
was still being shown although the media player already abandoned audio
focus.

Change-Id: Ib4577cdbfcea0a89efbbd0df70646afe8e677e0d
systemui: Add CONNECTIVITY_INTERNAL permission

 * SystemUI needs to be able to list interfaces if tethering is in use
   and we ask for a second tethering path to be set up (BT+USB, etc).
 * Add permission to stop exceptions in the framework and enable
   tethering thru multiple paths.

Change-Id: If7a65c31557dc2f0451f0612fb109f61e8056368
Settings: External GPS Support (2/2)

- Ported feature from CM9

Submitted on behalf of a third-party: Cuong Bui

PatchSet2:

- Removed random tabs

Change-Id: I324269dae1c621b38e2f624e0ce82bf600896ff6
Framework: Add Fast Charge widget - (1/2)

Change-Id: Iac753914624ce82e0ccd2a89dda66870923fa5f4
Frameworks: Add fast charge QS toggle and other

this commit add
- qs toggle
- interactive reacting with pw toggle
- option stays after reboot
- option is hidden if kernel doesn't support
- code cleanup

Change-Id: I137720a7fe1acb7b36bec0f68ac0e5b6aa3fcbd0
Signed-off-by: scotthartbti <scott@ubuntu.com>

Conflicts:
	packages/SystemUI/res/values/strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java
update fcharge tile
Signed-off-by: scotthartbti <scott@ubuntu.com>

Change-Id: I50419297e7f5412f57c8f6acabbadb44314b3910
Frameworks: fcharge for all (1/2)

Thanks roman for the basic idea to use an overlay
to set the fast charge path so each device can set
the propper path to the custom kernel.
As well this commit pays attention if the user
flashed a kernel which does not support fastcharge
or is using another path. Option for tile in settings will be removed
as well.

not 100% happy with the whole fast charge implementation...but I am lazy :p
...whatever maybe I will recode that all on a later point. It
is working as intended like it is.

Change-Id: I0cb830c1ecfebe479a2e10a31c7c84967e2e2030
Signed-off-by: scotthartbti <scott@ubuntu.com>

Conflicts:
	core/res/res/values/config.xml
forgot to save file that i made fcharge changes in... smh
Signed-off-by: scotthartbti <scott@ubuntu.com>

Change-Id: If3c50e50319208e057449580f3c5f05cadd1967c
Fix up fastcharge power widget
Signed-off-by: scotthartbti <scott@ubuntu.com>

Change-Id: I4aea4496b0a720d48b8aab2aea0485f7b46e9fcf
PreferenceActivity should not leave message in looper when destroyed

When a PreferenceActivity is destroyed as soon as created,
there is a problematic case that messages for the activity are
sometimes left in the looper even after the activity is destroyed.
For example, by clearing user data of the selecting IME on
Settings apk, com.android.settings.Settings is re-launched
2 times successively. (Destory->Create->Destroy->Create)
Due to the left message, application crash can happen.
(NullPointerException at BackStackRecord.getBreadCrumbTitle())

Two cases have been found to observe this issue.
[Case 1]
 1,Launch IME in advance.
 2,Go to Settings >Apps > All and choose the IME package.
 3,Click "Clear data"
 4,Application crash occurs on com.android.settings.
[Case 2]
 1,Go to Settings > Language&input > Language.
 2,ListView dialog to choose language is shown.
 3,Rotate the tablet 180 degree so that 90 degree rotation occurs twice.
 4,Application crash occurs on com.android.settings.

Change-Id: I5ce36ea7a40ab7bc7737b7dca6641a4c3d77a480
Framework: Add TouchKey Light Duration Pref

Gives the option to change duration of touchkey backlights

Must be enabled in overlay

Change-Id: I9175fe1aeb998e8ebdd5793bc1c8633b5008d5e1

Conflicts:
	services/java/com/android/server/power/PowerManagerService.java
HALO colors: a lil improvement

Shouldn't break themeability this time, the custom colors has it's own halo bg

Signed-off-by: scotthartbti <scott@ubuntu.com>

Conflicts:
	packages/SystemUI/res/drawable-hdpi/halo_bg.png
	packages/SystemUI/res/drawable-mdpi/halo_bg.png
	packages/SystemUI/res/drawable-nodpi/bubble_l.9.png
	packages/SystemUI/res/drawable-nodpi/bubble_r.9.png
	packages/SystemUI/res/drawable-xhdpi/halo_bg.png
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/src/com/android/systemui/statusbar/halo/HaloProperties.java

Change-Id: Icfbdfa2e0f44527a80f1e9365a243a654c61a9a2

Conflicts:
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/src/com/android/systemui/statusbar/halo/HaloProperties.java
Fix circle not theming
HALO Style revamp

- speech bubbles are centered
- number batches are roundand simplified, same color as in g+
- markers appear as dots above the bubble
- hiding and dimissing triggers text hints
- couple of bugfixes

WARNING: some of the drawables are good for xhdpi only for now and must
be scaled down for the other resolutions

Change-Id: Ib656664f6f8c42b747df18d65d1e3fb40cb7480c
Signed-off-by: scotthartbti <scott@ubuntu.com>

Conflicts:
	packages/SystemUI/res/drawable-hdpi/halo_pulse1.png
	packages/SystemUI/res/drawable-mdpi/halo_number.9.png
	packages/SystemUI/res/drawable-mdpi/halo_pulse1.png
	packages/SystemUI/res/drawable-nodpi/bubble_black_l.9.png
	packages/SystemUI/res/drawable-nodpi/bubble_black_r.9.png
	packages/SystemUI/res/drawable-xhdpi/halo_number.9.png
	packages/SystemUI/res/drawable-xhdpi/halo_pulse1.png
	packages/SystemUI/res/layout/halo_speech.xml
	packages/SystemUI/src/com/android/systemui/statusbar/halo/Halo.java

Conflicts:
	packages/SystemUI/res/drawable-hdpi/halo_pulse1.png
	packages/SystemUI/res/drawable-mdpi/halo_number.9.png
	packages/SystemUI/res/drawable-mdpi/halo_pulse1.png
	packages/SystemUI/res/drawable-xhdpi/halo_number.9.png
	packages/SystemUI/res/drawable-xhdpi/halo_pulse1.png
	packages/SystemUI/res/values/strings.xml
Finish the floating activity again

Change-Id: I1db29ddd2c056d7645f1028e084face815a44e0c