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>
NPE in SearchManager.triggerSearch

mAssociatedPackage field is never initialized and cause NPE.

Change-Id: Ibf0d44b2170b7cbfe4a883008254a086e03579c5
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
p2p: Display P2P peer MAC address if device name is empty.

Display MAC address of a P2P peer in an invitation prompt
message on receiving invitation request from the P2P peer
with empty device name.

Change-Id: Icabeb91d666437746eb5a733ec582849eb7295a5
CRs-Fixed: 506109
Show confirmation for deleted screenshot

Change-Id: I4a36cf06bf252e5e15fe08fbd054dc64a0a507ae
Fix fatal exception due to missing looper for current thread.

While creating handler for the thread, there was fatal exception getting
thrown because the present thread does not have a looper. So passing the
applications looper to be used , while creating the handler to avoid this
exception.

Change-Id: Id2e3ed61f5691c8319eb7bc20ad970eb6758e765
(cherry picked from commit f5d1769b4357fb8d86fc31f7115b55b567a20ed1)
(cherry picked from commit d0a7c5833b90fe4d8fe8f968b53a7028720ffd8c)
WifiState: Don't aquire transitionwakelock in airplane mode

NetworkTransitionWakelock is for transition from Wifi to mobile.
It will cause device no sleep for 60s. There is no need to acquire
it in airplane mode.

Change-Id: I1487dc4787948d09e482f22e88d01768b54964da
ProcessList: use different polling interval when screen off

We are using the same time interval for both screen off and screen on.
For process on top: ActivityManager.PROCESS_STATE_TOP, we will poll PSS
information every 120 sec.
During polling PSS, we are grep /proc/%d/smaps which is a 10k lines file.
This cost quite a lot of CPU resource. But when screen off, we don't need to update
TOP process PSS so frequently since we are not operating it. Lower polling
circle to every 15min to reduce power.

Change-Id: Ia4cd26290d44d066f034d5270ce5523650a3c493
Keyguard: don't refresh ui when screen off

KeyguardStatusView is doing refresh all the time,
which cause high power when screen off.

Change-Id: Ifabdde4419a23e919cd52fe77e78ec3160575af1
onAccountsUpdated shouldn't be called back after listener unregistered

There is a problem of AccountManager that onAccountsUpdated() is
called back even after the OnAccountsUpdatedListener is unregistered.
It may cause application crash.

For example, when rotating a tablet 180 degree with Settings apk
running, com.android.settings.Settings is re-launched 2 times
successively. (Destroy->Create->Destroy->Create)
It repeats adding&removing OnAccountUpdatedListener.

When dialog was being opened in the following cases,
NullPointerException at BackStackRecord.getBreadCrumbTitle()
was happened on 10 inch tablet which has 2 panes on Settings.
* Settings > Language&input > Language
* Settings > Language & input > Text-to-speech output > Speech rate
* Settings > Wi-Fi > Menu > Advanced > Keep Wi-Fi on during sleep
* Settings > Wi-Fi > Menu > Wi-Fi Direct > Rename device

This fix prevents the undesirable callback.

Change-Id: I081f69c90539cca821cf686b4587495135f375e4
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
Use highp precision for scaled coordination

If scaled coordination is closer to zero than what
the medium precision can store, distance becomes
zero and it causes divided by zero.

Change-Id: I8ee921dd1f57564a442e685266b12d95fc08e165
Base: QuickSettings Improvement

rework and cleanup code

FlipTile now Truely movable (thanks @BigBrother1984)
based from
https://gerrit.paranoidandroid.co/#/c/500/

improve edit mode (thanks @D4rKn3sSyS)
based from
https://gerrit.paranoidandroid.co/#/c/3536/

fix http://jira.omnirom.org/browse/OMNI-482
fix inconsistent text in dynamic changes
this also fix QuickSwipe during SetupWizard

Change-Id: Ice7dcd9bee57835e100d0d94482d52eac80f51a6
[1/3] Base: Add MobileNetwork Flip Tile

base from

https://gerrit.paranoidandroid.co/457

with moarr changes to OmniRom

toggle Network Flip Tile

for device support 4G (GSM)
toggle will change into 2G only => 3G only => 2G/3G auto => 2G/3G pref => 4G lte => back to 2G only

for device support 4G (CDMA)
toggle will change into cdma/evdo => cdma only => 4G lte => back to cdma/evdo

for device unsupport 4G (GSM)
toggle will change into 2G only => 3G only => 2G/3G auto => 2G/3G pref => back to 2G only

for device unsupport 4G (CDMA)
toogle will change into cdma/evdo => cdma only => back to cdma/evdo

4G toggle requires that at least one (1) of the following configs
must be present in the device's build.prop in order to use it:
telephony.lteOnCdmaDevice=1
telephony.lteOnGsmDevice=1

Conflicts:
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsBasicNetworkTile.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Change-Id: I7183dddeab7b4bdd4562015dd3958f3b069039e4
[1/2] Base: QS Ribbon style

Allow choose 3 columns, 4 columns, Dynamic mode, and both (dynamic and ribbon)

Ribbon tiles can customized via OmniGears parts
allow can choose Ribbon tiles to linking with QuickSettings or independent

OmniGears parts taken from CyanogenMod (thanks)

also introduce Flip vertical on Ribbon mode

add new Image for Flip Tile
add Wifi AP enable/disable from WIFI Back tile
Split Ribbon mode and Dynamic mode into separate option

Change-Id: Ic622ae7cc5cefbe0265c504c554bd6c0d27a995a
[3/4] core: Add Dialer suggestions and reverse lookup

Change-Id: I01b27afb075e36d8d807d2fdbf5032ddb6e10641
[1/2] Base: Configurable rotation

Configurable rotation modes -
- 0 (portrait)
- 90 (landscape)
- 180 (upside down)
- 270 (landscape)

Also move the option to enable/disable auto rotate to display settings from accessibility settings if device supports it.

Settings: https://gerrit.omnirom.org/#/c/4527/

Change-Id: I311b14754702831197c007e4dfe42d8523b970c6

Conflicts:

	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
StatusUI: upgrade network traffic meter (1/2)

*Updated class name to be less ambiguous
*Replaced the multi-check in settings with a proper listview
*Added the ability to view up-stream, down-stream or both
*Added the option to change how often it refreshes
*Added a check before it updates the status bar to prevent it from
refreshing everything needlessly
*Added icons to show data direction

Icon artwork is courtesy android design downloads
Some features were inspired by previous work done by 0xD34D

Change-Id: I9f86292a6adbc5e30967df76fae510be248fc38b