diff options
| author | Alexandra Gherghina <alexgherghina@google.com> | 2014-07-02 17:07:16 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-02 16:34:47 +0000 |
| commit | 1e1f2e89267f17723a2afc90a7e894e01fc64701 (patch) | |
| tree | 85a6b363b9cbfeb16d7736309783edb8424f8ab3 /core/java/android | |
| parent | be55c0d23b02f9de9f295f3bca2f7cd7f016c4d6 (diff) | |
| parent | cb22807ffcf79db1b62162842d0a90251a463ea7 (diff) | |
| download | frameworks_base-1e1f2e89267f17723a2afc90a7e894e01fc64701.zip frameworks_base-1e1f2e89267f17723a2afc90a7e894e01fc64701.tar.gz frameworks_base-1e1f2e89267f17723a2afc90a7e894e01fc64701.tar.bz2 | |
Merge "Adds per-user APIs required by the Settings app"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/content/ContentResolver.java | 21 | ||||
| -rw-r--r-- | core/java/android/content/IContentService.aidl | 4 |
2 files changed, 23 insertions, 2 deletions
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index be70411..de3b881 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -1926,8 +1926,17 @@ public abstract class ContentResolver { * @param sync true if the provider should be synced when tickles are received for it */ public static void setSyncAutomatically(Account account, String authority, boolean sync) { + setSyncAutomaticallyAsUser(account, authority, sync, UserHandle.getCallingUserId()); + } + + /** + * @see #setSyncAutomatically(Account, String, boolean) + * @hide + */ + public static void setSyncAutomaticallyAsUser(Account account, String authority, boolean sync, + int userId) { try { - getContentService().setSyncAutomatically(account, authority, sync); + getContentService().setSyncAutomaticallyAsUser(account, authority, sync, userId); } catch (RemoteException e) { // exception ignored; if this is thrown then it means the runtime is in the midst of // being restarted @@ -2268,8 +2277,16 @@ public abstract class ContentResolver { * @return true if there is a pending sync with the matching account and authority */ public static boolean isSyncPending(Account account, String authority) { + return isSyncPendingAsUser(account, authority, UserHandle.getCallingUserId()); + } + + /** + * @see #requestSync(Account, String, Bundle) + * @hide + */ + public static boolean isSyncPendingAsUser(Account account, String authority, int userId) { try { - return getContentService().isSyncPending(account, authority, null); + return getContentService().isSyncPendingAsUser(account, authority, null, userId); } catch (RemoteException e) { throw new RuntimeException("the ContentService should always be reachable", e); } diff --git a/core/java/android/content/IContentService.aidl b/core/java/android/content/IContentService.aidl index 1e96713..d363ad1 100644 --- a/core/java/android/content/IContentService.aidl +++ b/core/java/android/content/IContentService.aidl @@ -82,6 +82,8 @@ interface IContentService { * @param sync true if the provider should be synced when tickles are received for it */ void setSyncAutomatically(in Account account, String providerName, boolean sync); + void setSyncAutomaticallyAsUser(in Account account, String providerName, boolean sync, + int userId); /** * Get a list of periodic operations for a specified authority, or service. @@ -170,6 +172,8 @@ interface IContentService { * non-null. */ boolean isSyncPending(in Account account, String authority, in ComponentName cname); + boolean isSyncPendingAsUser(in Account account, String authority, in ComponentName cname, + int userId); void addStatusChangeListener(int mask, ISyncStatusObserver callback); |
