QS: let's welcome LocationTile to 4.4

we already modified to use the basic 4.4 location mechanism. Still
it was very basic. Now using the same attempt like in Settings to
controll location mode (high accuracy, battery saving, device only) and on/off state

longpress switches between the states. Normal click turns it on/off
Compared to settings turning on will recover last state where it was turned off. As
well it respects the sharing location warning dialog either when you switch on into
a mode which use it or you switch into a mode which uses it and it was not confimed.

Slight corrections to original AOSP code to reflect the changes in LocationController
even though this code is non operational

PatchSet:
- moved the complete handling into the LocationController. Way better
  to have in centralized. Who knows for what we will use it later.
PatchSet:
- cleanup

PatchSet:
- added drawables from kroz :)

Change-Id: I3c7c51c8d7e3a8c003c37d1b55a6503a9bbeaf64
SystemUI: Add LongClick SwitchButton (1/2)

User TJKV had the idea to set notification
	button to the notification station.
	Nothing else fits in my mind...so
	that's what I'll use there.

Change-Id: I2087de5c5ff2387d51b4c7685fc7aa3c0d26d72e
Settings: Long = tile settings.
SystemUI: Sleep Screen Shortcut

PS2: typo

Change-Id: I3ee9611db49b7d8cd84508ab4959fbcb9ce6d59f
fb: ES translations

PS2: SystemUI translations
PS3: Blank line in description

Change-Id: I3fbd8e84387c4b111d7f1a72002bc913352c762d
Merge changes I2087de5c,I3c7c51c8 into kk4.4

* changes:
  SystemUI: Add LongClick SwitchButton (1/2)
  QS: let's welcome LocationTile to 4.4
Merge "SystemUI: Sleep Screen Shortcut" into kk4.4
privacyguard: Share privacy package name between activity stacks

AOSP 4.4 now has a stack supervisor with differents activity stacks for home and focus activities.
Every ActivityStack instance has a ref to this supervisor. Just share the privacy guard package name
throught the supervisor.

Thanks Jorgue....way better solution then the dumb fast one I did on 4.4 bringup

Change-Id: I66c283fb9e3cec6ac9ec6a293e068d115e80a3fa
base: Check for homeAsUp status when collapse actionbar widget

mHomeLayout should be visible if one of DISPLAY_SHOW_HOME or DISPLAY_HOME_AS_UP are set.
collapseItemActionView only checks for DISPLAY_SHOW_HOME, so applications that only uses
DISPLAY_HOME_AS_UP and uses an expandable/collapsible widget (like SearchView) doesn't
properly restore the home layout.
One sample of this behaviour is the DeskClock app. The CitiesActivity doesn't show the homeasup
indicator after collapse the searchview.

aosp change-id: https://android-review.googlesource.com/#/c/71093/

Change-Id: I2f225138771da6bd6b2a468ad616b90c2c0a9d35
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
trds: consistent glow for menu dropdown and popup

Change-Id: I248872cbd67471495f8b95036d995f25e2ca4459
fb: fix possible NPE on power key handling

fixes reported NPE which can cause SoD

E/InputManager-JNI(  805): An exception was thrown by callback 'interceptKeyBeforeQueueing'.
E/InputManager-JNI(  805): java.lang.NullPointerException
E/InputManager-JNI(  805):      at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeQueueing(PhoneWindowManager.java:4185)
E/InputManager-JNI(  805):      at com.android.server.wm.InputMonitor.interceptKeyBeforeQueueing(InputMonitor.java:357)
E/InputManager-JNI(  805):      at com.android.server.input.InputManagerService.interceptKeyBeforeQueueing(InputManagerService.java:1351)
E/InputManager-JNI(  805):      at dalvik.system.NativeStart.run(Native Method)
E/InputManager-JNI(  805): An exception was thrown by callback 'interceptKeyBeforeQueueing'.
E/InputManager-JNI(  805): java.lang.NullPointerException
E/InputManager-JNI(  805):      at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeQueueing(PhoneWindowManager.java:4185)

Change-Id: Ia0aa32c5472d0381d629a83492b42dec419b840e
Revert "Fix a bootloop problem when /data/system/usagestats/usage-history.xml is empty."

This reverts commit 286cba172e026515da98c08c93967a9c679ebba2.

AOSP just pushed 2 days ago a way better fix

Change-Id: Ib69ffad209b9f72857cf584c74cc1f8f74e6937a
Fix broken XML parsing idiom.

Code that expected a single top level element in an XML file
was doing something like :

while (type != START_TAG) { next(); }

This would loop forever when the XML being parsed was empty,
where each call to XmlPullParser.next() would return END_DOCUMENT.

bug: https://code.google.com/p/android/issues/detail?id=64173
Change-Id: I7543203e976a8999ae471a6c2d629249a87011bb
XmlUtils#readThisMapXml should handle null keys.

Both readThisValueXml & writeThisValueXml have been
implemented to handle values with "null" names.

Change readThisMapXml to allow such names as well, and
map them to the null key in the resulting HashMap.
readThisListXml and readThisSetXml already support
null names.

bug: https://code.google.com/p/android/issues/detail?id=63463

Change-Id: I1c93976656e45e7733113eb67d29b6bad5d25f1f
Fix appwidgets not updating

Previously there was a bug where if an appwidget's update caused a
TransactionTooLargeException then the AppWidgetServiceImpl.Host's
callbacks were completely disabled, for all widgets.

The fix still allows a DeadObjectException or other RemoteException
to disable the host callbacks, as that would be caused by a bad host.

Fixes issue 28216 on the public tracker
https://code.google.com/p/android/issues/detail?id=28216

Change-Id: I5c5d5939d7211ed23cca69e6674de730b51b0f3e
Signed-off-by: Kevin Barry <kevin@teslacoilsw.com>
Framework: Fix blacklist support

Copy & Paste isn't a good friend for programmers ;)

Change-Id: Ic6ab81462530f614b9e896cb098590241accb192
Prevent nullPointerException by updateBondedBluetoothDevices

In some very rare cases difficult to identify, it seems that the
IBluetooth.getBondedDevices() returns a Set with a null element.

This patch will prevent calling getBondState() if the device is null to
avoid a nullPointerException.

Change-Id: I9bcad60c37e03c77ec39227e5c947c002a3ae2c7
Orig-Change-Id: I8845f0e6b8fdcda679bc71e2b5c33fd4a52f3ac5
Signed-off-by: Patrick Combes <patrick.combes@intel.com>
Reviewed-on: http://android.intel.com:8080/116592
Reviewed-by: Bondier, CedricX <cedricx.bondier@intel.com>
Reviewed-by: Chen, HuaqiangX <huaqiangx.chen@intel.com>
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Aquilone, RaffaeleX <raffaelex.aquilone@intel.com>
Tested-by: Lestienne, ChristopheX <christophex.lestienne@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 90085
NPE in SearchManager.triggerSearch

mAssociatedPackage field is never initialized and cause NPE.

Change-Id: Ibf0d44b2170b7cbfe4a883008254a086e03579c5
Commit I3ee9611db49b7d8cd84508ab4959fbcb9ce6d59f translated to Russian

Change-Id: I79ec3da5b2d9caf8ed1031f0027039391a8c0b69
Fix a variety of small publicly-reported bugs.

Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp.
https://code.google.com/p/android/issues/detail?id=61556

Missing fclose in core/jni/android_os_Debug.cpp.
https://code.google.com/p/android/issues/detail?id=61546

Bad loop guards in core/jni/android_util_Process.cpp.
https://code.google.com/p/android/issues/detail?id=61557

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
Prevent MediaScanner infinite loop with invalid path

including double slash  "/storage/sdcard0/xx//xxx/xxxx"

Change-Id: I112a70c88b5ec662482b79c3151310b9b9b52e40