summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-06-23 16:45:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-23 16:45:50 +0000
commit6af40c833890356e6a48c8f32feab1bd768d2480 (patch)
tree4daa36b85a2c86e0056d41417bd17caa395c1c41 /core/java/android/content
parentde1e281bbc062410a9079d2640b760271bde1043 (diff)
parentd01ed46c633912895ac4d9dc0804dac8f7fe9069 (diff)
downloadframeworks_base-6af40c833890356e6a48c8f32feab1bd768d2480.zip
frameworks_base-6af40c833890356e6a48c8f32feab1bd768d2480.tar.gz
frameworks_base-6af40c833890356e6a48c8f32feab1bd768d2480.tar.bz2
Merge "Fix issue #21799741: AbstractThreadedSyncAdapter crashes..." into mnc-dev
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/AbstractThreadedSyncAdapter.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/content/AbstractThreadedSyncAdapter.java b/core/java/android/content/AbstractThreadedSyncAdapter.java
index d4dee5b..58bd5cd 100644
--- a/core/java/android/content/AbstractThreadedSyncAdapter.java
+++ b/core/java/android/content/AbstractThreadedSyncAdapter.java
@@ -274,6 +274,10 @@ public abstract class AbstractThreadedSyncAdapter {
} else {
syncResult.databaseError = true;
}
+ } catch (SecurityException e) {
+ AbstractThreadedSyncAdapter.this.onSecurityException(mAccount, mExtras,
+ mAuthority, syncResult);
+ syncResult.databaseError = true;
} finally {
Trace.traceEnd(Trace.TRACE_TAG_SYNC_MANAGER);
@@ -319,6 +323,20 @@ public abstract class AbstractThreadedSyncAdapter {
String authority, ContentProviderClient provider, SyncResult syncResult);
/**
+ * Report that there was a security exception when opening the content provider
+ * prior to calling {@link #onPerformSync}. This will be treated as a sync
+ * database failure.
+ *
+ * @param account the account that attempted to sync
+ * @param extras SyncAdapter-specific parameters
+ * @param authority the authority of the failed sync request
+ * @param syncResult SyncAdapter-specific parameters
+ */
+ public void onSecurityException(Account account, Bundle extras,
+ String authority, SyncResult syncResult) {
+ }
+
+ /**
* Indicates that a sync operation has been canceled. This will be invoked on a separate
* thread than the sync thread and so you must consider the multi-threaded implications
* of the work that you do in this method.