Loading core/java/android/content/ContentResolver.java +9 −1 Original line number Diff line number Diff line Loading @@ -2153,8 +2153,16 @@ public abstract class ContentResolver { * @param sync the master auto-sync setting that applies to all the providers and accounts */ public static void setMasterSyncAutomatically(boolean sync) { setMasterSyncAutomaticallyAsUser(sync, UserHandle.getCallingUserId()); } /** * @see #setMasterSyncAutomatically(boolean) * @hide */ public static void setMasterSyncAutomaticallyAsUser(boolean sync, int userId) { try { getContentService().setMasterSyncAutomatically(sync); getContentService().setMasterSyncAutomaticallyAsUser(sync, userId); } catch (RemoteException e) { // exception ignored; if this is thrown then it means the runtime is in the midst of // being restarted Loading core/java/android/content/IContentService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ interface IContentService { void setIsSyncable(in Account account, String providerName, int syncable); void setMasterSyncAutomatically(boolean flag); void setMasterSyncAutomaticallyAsUser(boolean flag, int userId); boolean getMasterSyncAutomatically(); boolean getMasterSyncAutomaticallyAsUser(int userId); Loading services/core/java/com/android/server/content/ContentService.java +7 −1 Original line number Diff line number Diff line Loading @@ -719,10 +719,16 @@ public final class ContentService extends IContentService.Stub { @Override public void setMasterSyncAutomatically(boolean flag) { setMasterSyncAutomaticallyAsUser(flag, UserHandle.getCallingUserId()); } @Override public void setMasterSyncAutomaticallyAsUser(boolean flag, int userId) { enforceCrossUserPermission(userId, "no permission to set the sync status for user " + userId); mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS, "no permission to write the sync settings"); int userId = UserHandle.getCallingUserId(); long identityToken = clearCallingIdentity(); try { SyncManager syncManager = getSyncManager(); Loading Loading
core/java/android/content/ContentResolver.java +9 −1 Original line number Diff line number Diff line Loading @@ -2153,8 +2153,16 @@ public abstract class ContentResolver { * @param sync the master auto-sync setting that applies to all the providers and accounts */ public static void setMasterSyncAutomatically(boolean sync) { setMasterSyncAutomaticallyAsUser(sync, UserHandle.getCallingUserId()); } /** * @see #setMasterSyncAutomatically(boolean) * @hide */ public static void setMasterSyncAutomaticallyAsUser(boolean sync, int userId) { try { getContentService().setMasterSyncAutomatically(sync); getContentService().setMasterSyncAutomaticallyAsUser(sync, userId); } catch (RemoteException e) { // exception ignored; if this is thrown then it means the runtime is in the midst of // being restarted Loading
core/java/android/content/IContentService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ interface IContentService { void setIsSyncable(in Account account, String providerName, int syncable); void setMasterSyncAutomatically(boolean flag); void setMasterSyncAutomaticallyAsUser(boolean flag, int userId); boolean getMasterSyncAutomatically(); boolean getMasterSyncAutomaticallyAsUser(int userId); Loading
services/core/java/com/android/server/content/ContentService.java +7 −1 Original line number Diff line number Diff line Loading @@ -719,10 +719,16 @@ public final class ContentService extends IContentService.Stub { @Override public void setMasterSyncAutomatically(boolean flag) { setMasterSyncAutomaticallyAsUser(flag, UserHandle.getCallingUserId()); } @Override public void setMasterSyncAutomaticallyAsUser(boolean flag, int userId) { enforceCrossUserPermission(userId, "no permission to set the sync status for user " + userId); mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS, "no permission to write the sync settings"); int userId = UserHandle.getCallingUserId(); long identityToken = clearCallingIdentity(); try { SyncManager syncManager = getSyncManager(); Loading