From b752098e8d12d6e7925d97458078dbb896ca8a05 Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Wed, 2 Sep 2009 18:03:05 -0700 Subject: Sync status was ignoring account - the new UI has specific sync status for each account, so we need to use it. --- core/java/android/content/ContentService.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/java/android/content/ContentService.java') diff --git a/core/java/android/content/ContentService.java b/core/java/android/content/ContentService.java index f742448..974a667 100644 --- a/core/java/android/content/ContentService.java +++ b/core/java/android/content/ContentService.java @@ -241,7 +241,7 @@ public final class ContentService extends IContentService.Stub { restoreCallingIdentity(identityToken); } } - + public boolean getSyncAutomatically(Account account, String providerName) { mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_SETTINGS, "no permission to read the sync settings"); @@ -318,7 +318,7 @@ public final class ContentService extends IContentService.Stub { } return false; } - + public void setMasterSyncAutomatically(boolean flag) { mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS, "no permission to write the sync settings"); @@ -348,7 +348,7 @@ public final class ContentService extends IContentService.Stub { } return false; } - + public ActiveSyncInfo getActiveSync() { mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); @@ -363,7 +363,7 @@ public final class ContentService extends IContentService.Stub { } return null; } - + public SyncStatusInfo getSyncStatus(Account account, String authority) { mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); @@ -371,15 +371,15 @@ public final class ContentService extends IContentService.Stub { try { SyncManager syncManager = getSyncManager(); if (syncManager != null) { - return syncManager.getSyncStorageEngine().getStatusByAuthority( - authority); + return syncManager.getSyncStorageEngine().getStatusByAccountAndAuthority( + account, authority); } } finally { restoreCallingIdentity(identityToken); } return null; } - + public boolean isSyncPending(Account account, String authority) { mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); @@ -394,7 +394,7 @@ public final class ContentService extends IContentService.Stub { } return false; } - + public void addStatusChangeListener(int mask, ISyncStatusObserver callback) { long identityToken = clearCallingIdentity(); try { @@ -406,7 +406,7 @@ public final class ContentService extends IContentService.Stub { restoreCallingIdentity(identityToken); } } - + public void removeStatusChangeListener(ISyncStatusObserver callback) { long identityToken = clearCallingIdentity(); try { @@ -418,7 +418,7 @@ public final class ContentService extends IContentService.Stub { restoreCallingIdentity(identityToken); } } - + public static IContentService main(Context context, boolean factoryTest) { ContentService service = new ContentService(context, factoryTest); ServiceManager.addService(ContentResolver.CONTENT_SERVICE_NAME, service); -- cgit v1.1