Loading core/java/android/content/ContentResolver.java +19 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,25 @@ public abstract class ContentResolver { /** @hide */ public static final int SYNC_ERROR_INTERNAL = 8; private static final String[] SYNC_ERROR_NAMES = new String[] { "already-in-progress", "authentication-error", "io-error", "parse-error", "conflict", "too-many-deletions", "too-many-retries", "internal-error", }; /** @hide */ static String syncErrorToString(int error) { if (error < 1 || error > SYNC_ERROR_NAMES.length) { return String.valueOf(error); } return SYNC_ERROR_NAMES[error - 1]; } public static final int SYNC_OBSERVER_TYPE_SETTINGS = 1<<0; public static final int SYNC_OBSERVER_TYPE_PENDING = 1<<1; public static final int SYNC_OBSERVER_TYPE_ACTIVE = 1<<2; Loading core/java/android/content/ContentService.java +4 −2 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ public final class ContentService extends IContentService.Stub { } } final int uid = Binder.getCallingUid(); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. long identityToken = clearCallingIdentity(); Loading Loading @@ -264,7 +265,7 @@ public final class ContentService extends IContentService.Stub { if (syncToNetwork) { SyncManager syncManager = getSyncManager(); if (syncManager != null) { syncManager.scheduleLocalSync(null /* all accounts */, callingUserHandle, syncManager.scheduleLocalSync(null /* all accounts */, callingUserHandle, uid, uri.getAuthority()); } } Loading Loading @@ -300,6 +301,7 @@ public final class ContentService extends IContentService.Stub { public void requestSync(Account account, String authority, Bundle extras) { ContentResolver.validateSyncExtrasBundle(extras); int userId = UserHandle.getCallingUserId(); int uId = Binder.getCallingUid(); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. Loading @@ -307,7 +309,7 @@ public final class ContentService extends IContentService.Stub { try { SyncManager syncManager = getSyncManager(); if (syncManager != null) { syncManager.scheduleSync(account, userId, authority, extras, 0 /* no delay */, syncManager.scheduleSync(account, userId, uId, authority, extras, 0 /* no delay */, false /* onlyThoseWithUnkownSyncableState */); } } finally { Loading Loading
core/java/android/content/ContentResolver.java +19 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,25 @@ public abstract class ContentResolver { /** @hide */ public static final int SYNC_ERROR_INTERNAL = 8; private static final String[] SYNC_ERROR_NAMES = new String[] { "already-in-progress", "authentication-error", "io-error", "parse-error", "conflict", "too-many-deletions", "too-many-retries", "internal-error", }; /** @hide */ static String syncErrorToString(int error) { if (error < 1 || error > SYNC_ERROR_NAMES.length) { return String.valueOf(error); } return SYNC_ERROR_NAMES[error - 1]; } public static final int SYNC_OBSERVER_TYPE_SETTINGS = 1<<0; public static final int SYNC_OBSERVER_TYPE_PENDING = 1<<1; public static final int SYNC_OBSERVER_TYPE_ACTIVE = 1<<2; Loading
core/java/android/content/ContentService.java +4 −2 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ public final class ContentService extends IContentService.Stub { } } final int uid = Binder.getCallingUid(); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. long identityToken = clearCallingIdentity(); Loading Loading @@ -264,7 +265,7 @@ public final class ContentService extends IContentService.Stub { if (syncToNetwork) { SyncManager syncManager = getSyncManager(); if (syncManager != null) { syncManager.scheduleLocalSync(null /* all accounts */, callingUserHandle, syncManager.scheduleLocalSync(null /* all accounts */, callingUserHandle, uid, uri.getAuthority()); } } Loading Loading @@ -300,6 +301,7 @@ public final class ContentService extends IContentService.Stub { public void requestSync(Account account, String authority, Bundle extras) { ContentResolver.validateSyncExtrasBundle(extras); int userId = UserHandle.getCallingUserId(); int uId = Binder.getCallingUid(); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. Loading @@ -307,7 +309,7 @@ public final class ContentService extends IContentService.Stub { try { SyncManager syncManager = getSyncManager(); if (syncManager != null) { syncManager.scheduleSync(account, userId, authority, extras, 0 /* no delay */, syncManager.scheduleSync(account, userId, uId, authority, extras, 0 /* no delay */, false /* onlyThoseWithUnkownSyncableState */); } } finally { Loading