Quicksettings: OnLongClickListener for backside tiles

Added BackOnLongClickListener for bluetooth (back side) tile  and for location
(back side) tile.

Change-Id: I11afcc9f4ea29a14a57b449e7458053e9d4d12a5
Signed-off-by: Parthipan Ramesh <parthipan.ramesh@gmail.com>
GlobalActions: Fix Airplane Mode on/off issue

Issue: Unable to turn off Airplane mode from power button
       after phone reboot

Fix: Initialize mHasTelephony before the PhoneStateListener is
     registered to the TelephonyManager so that correct value
     of mHasTelephony is reflected when onServiceStateChanged
     callback is called.

Bug: 13697360
Change-Id: Ide8afd9c16ea90b98b5912dbff440c5fd67b178d

Conflicts:
	policy/src/com/android/internal/policy/impl/GlobalActions.java
Squashed commit of QuickBoot feature from Qualcomm

QuickBoot: don't log boot events when in QuickBoot mode.

Don't need log boot events when booting from QuickBoot mode.

Change-Id: Id381530418c09ac1d650f45e7a368dbd7945aff3

QuickBoot: don't wake up screen when usb connected

Don't wake up screen in QuickBoot mode when usb connected.

Change-Id: If65936a0edbbc3b36a0768294e5c3bd7d741018a

QuickBoot: filt out alarms that for non-system users

Don't allow alarms for non-system users when under QUickBoot
mode.

Change-Id: I322d08f7236b6895462c4cd3304326c66f67ddd2

QuickBoot: restrict app's auto start under Quickboot mode

Don't let broadcast trigger apps auto start when in Quickboot mode.

Change-Id: I5d156cbea4ef18397ce4569cb74f73a446a6e49b

QuickBoot: remove alarms for killed apps

Device may be woken up by WAKEUP alarms, which have been set
by those killed apps before. Here to get the killed apps list
and remove the alarms from AlarmManagerService.

Change-Id: Ib34f5fc234b834b2fe4528229c267c8693fc76cb

SyncManager: Fix SyncManager null pointer issue under QuickBoot

BOOT_COMPLETED broadcast will cause mBootQueue null pointer issue.
Then system_server will crash. Add protection here to avoid
system_server crash.

Change-Id: I78029dfa90709455e4c2220e06b95640383655f8

QuickBoot: add execption restore mechanism

There may be some exceptions like battery unplugged When device
is put into QuickBoot mode. Then device will be in airplane
mode after next boot. We don't want such kind of things happen.
So start restore task to check if need restore before main
screen shows.

Change-Id: I3d0967c2f446fd71eca87ff085617edca549c984

QuickBoot: switch normal power off to quickboot

Handle power off button when quickboot mode enabled.

Change-Id: I6a668cbe823018b5e508633a76202d0df0381694

QuickBoot: support QuickBoot power on

Support long press power key to power on when in QuickBoot mode.

Change-Id: Id493d352bce73683b9696a2685a6c902f1195799

QuickBoot: Don't handle SHUTDOWN broadcast from QuickBoot

Don't process the ACTION_SHUTDOWN broadcast sent by QuickBoot.
It is only for apps.
Change-Id: I73d1a7b8edda0a898dd052831033806e18b37c99

QuickBoot: rename some intents and broadcasts

Modify some improper names for intents or broadcasts of QuickBoot.

Change-Id: I92357b0110643bb425199452cb03bd75248a5d83

QuickBoot: Support poweroff alarm under QuickBoot mode

Add white list in QuickBoot mode to support poweroff alarm.
    1. Allow original deskclock app and quickboot app to be launched.
    2. Don't filter out deskclock's alarms.

Change-Id: Ie4254e3da45837d3185d3daba625a42c50fd7f52

QuickBoot: enable poweroff charging under QuickBoot mode

control native charger's enable/disable under QuickBoot
mode.

Change-Id: I4f80c74b042e03bddc9f7fe419f4ed1f8b1409d5

QuickBoot: Add wakeup check under QuickBoot mode

We only want QuickBoot application to wakeup screen in QuickBoot
mode. Add wakeup check to filter out other wakeup callers.

Change-Id: Id82a0938003d2a776efda0e39a57877f41fc1ee4

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/power/PowerManagerService.java

Conflicts:
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/power/PowerManagerService.java
Fix problem where PhoneWindowManager waits for keyguard to draw

This fixes a problem where PhoneWindowManager times out waiting
for keyguard to draw when it's disabled.  Instead, we pass a null
token back which allows PhoneWindowManager to continue.

Fixes bug 11190932

Change-Id: I041ea1d88dca681476d9477a3aab54559976b312

Conflicts:

	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
Quicksettings: Refresh immersive tile when on native immersive.

Inform the user that the app is using its own immersive mode when forced immersive is off.
Just update the label, keep tile state to off cause it reflects forced mode, not native.

PS4: Improve real time checking and simplify string description.
PS5: Fix a derp and listen to last flag when observing IMMERSIVE_MODE and PIE_MODE.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: Ibeb33ceb739d204f6eaecd2a04e4b40985a296e9
Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
base: cleanup battery circle and percent

-no need to recreate objects
-simplify receiver

Change-Id: I98ff4ae6c72094a92ef8dc9f1c67adae09a4fdae

Conflicts:
	packages/SystemUI/src/com/android/systemui/BatteryCircleMeterView.java
	packages/SystemUI/src/com/android/systemui/BatteryPercentMeterView.java
hwui: fix projection uniform caching.

The previous caching would only consider a change in the
actual matrix to figure out that the projection matrix
uniform needs to be updated. This would not work if the
requested projection matrix is identical, but only the
offsetting would change.

The fix now considers changes in the requested offsetting.

Change-Id: I49848de99a4ef80f43d9ca8437aa8403759c7d28
Handle NullPointerException

When clearClientLocked() is called twice in a row,
(ex. When Spooler Service is killed by LMK, it is called by unbindLocked() and onServiceDisconnected())
it could cause NullPointerException.
So add 'catch' clause to handle it.

Change-Id: I60540c35f09ffe309836b207d2d354ef77b00ff0
Correct typo in doc comment

Changed "will" to "with"
(will null Options -> with null Options)

Change-Id: I3bbfb953d8e783ca6335247463007cbee722a28e
Signed-off-by: Shuhrat Dehkanov <k@efir.uz>
NPE in GestureOverlayView

When mCurrentGesture is null, fireOnGesturePerformed is being called by
GestureOverlayView which causes an NPE and the app to force close.
This happens when you clear the overlay in the OnGestureListener using
gestureOverlay.clear(false), and adding a null check in FadeOutRunnable
for this case fixes the issue.  Refer issue #6572 for reproducing.

Signed-off-by: Chander S Pechetty <cspechetty@gmail.com>
Merge branch 'kitkat' of https://github.com/TeamHorizon/platform_frameworks_base into kitkat