summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2013-07-30 15:32:19 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-30 15:32:19 -0700
commit46aae98b41fe6e6b61aeddff3ad3f41bc4ceace3 (patch)
tree59bedf6717fe92ac81a786bf850e825a2df480d3 /core/java/android
parentc40e46e8413c112186eadc8526d20306d81c9008 (diff)
parentf2d643cfc7405c1f771cacab365a0a5d9b547f36 (diff)
downloadframeworks_base-46aae98b41fe6e6b61aeddff3ad3f41bc4ceace3.zip
frameworks_base-46aae98b41fe6e6b61aeddff3ad3f41bc4ceace3.tar.gz
frameworks_base-46aae98b41fe6e6b61aeddff3ad3f41bc4ceace3.tar.bz2
am f2d643cf: Merge "Fixed a leaked partial wakelock in AbstractThreadedSyncAdapter."
* commit 'f2d643cfc7405c1f771cacab365a0a5d9b547f36': Fixed a leaked partial wakelock in AbstractThreadedSyncAdapter.
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/content/AbstractThreadedSyncAdapter.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/content/AbstractThreadedSyncAdapter.java b/core/java/android/content/AbstractThreadedSyncAdapter.java
index bafe67d..898cc4e 100644
--- a/core/java/android/content/AbstractThreadedSyncAdapter.java
+++ b/core/java/android/content/AbstractThreadedSyncAdapter.java
@@ -160,10 +160,13 @@ public abstract class AbstractThreadedSyncAdapter {
if (mAutoInitialize
&& extras != null
&& extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, false)) {
- if (ContentResolver.getIsSyncable(account, authority) < 0) {
- ContentResolver.setIsSyncable(account, authority, 1);
+ try {
+ if (ContentResolver.getIsSyncable(account, authority) < 0) {
+ ContentResolver.setIsSyncable(account, authority, 1);
+ }
+ } finally {
+ syncContextClient.onFinished(new SyncResult());
}
- syncContextClient.onFinished(new SyncResult());
return;
}
SyncThread syncThread = new SyncThread(