summaryrefslogtreecommitdiffstats
path: root/packages/SubscribedFeedsProvider
diff options
context:
space:
mode:
authorFred Quintana <fredq@google.com>2009-06-22 18:00:59 -0700
committerFred Quintana <fredq@google.com>2009-06-23 15:53:16 -0700
commitac9385ef3105fb7464e1f46049c62755a8b7f0e9 (patch)
tree922fb69a8ec88aaa1ade3be16a9f7aa0d46fa25b /packages/SubscribedFeedsProvider
parentf86a58ff3d14fa6af3fa447809b45895bbb365f6 (diff)
downloadframeworks_base-ac9385ef3105fb7464e1f46049c62755a8b7f0e9.zip
frameworks_base-ac9385ef3105fb7464e1f46049c62755a8b7f0e9.tar.gz
frameworks_base-ac9385ef3105fb7464e1f46049c62755a8b7f0e9.tar.bz2
- clean up the sync settings names to:
(get|set)SyncAutomatically (get|set)MasterSyncAutomatically - change SYNC_EXTRAS_FORCE to SYNC_EXTRAS_MANUAL to mace clear that this overrides the .*SyncAutomatically settings - make ContentResolver methods that call the sync controls methods in IContentService so that SDK users can use them - rename startSync to requestSync to reinforce the fact that a sync is not immediately or always started when this method is called - add an Account parameter to all the sync settings and control methods - change the sync control methods to take a String authority rather than a Uri uri
Diffstat (limited to 'packages/SubscribedFeedsProvider')
-rw-r--r--packages/SubscribedFeedsProvider/src/com/android/providers/subscribedfeeds/SubscribedFeedsIntentService.java21
1 files changed, 6 insertions, 15 deletions
diff --git a/packages/SubscribedFeedsProvider/src/com/android/providers/subscribedfeeds/SubscribedFeedsIntentService.java b/packages/SubscribedFeedsProvider/src/com/android/providers/subscribedfeeds/SubscribedFeedsIntentService.java
index 9992420..3cd2cc4 100644
--- a/packages/SubscribedFeedsProvider/src/com/android/providers/subscribedfeeds/SubscribedFeedsIntentService.java
+++ b/packages/SubscribedFeedsProvider/src/com/android/providers/subscribedfeeds/SubscribedFeedsIntentService.java
@@ -16,9 +16,7 @@ import android.database.sqlite.SQLiteFullException;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.os.Bundle;
-import android.os.RemoteException;
import android.text.TextUtils;
-import android.net.Uri;
import android.accounts.Account;
import java.util.ArrayList;
@@ -113,8 +111,9 @@ public class SubscribedFeedsIntentService extends IntentService {
+ "and " + SubscribedFeeds.Feeds.FEED + "= ?";
try {
// TODO(fredq) fix the hardcoded type
+ final Account account = new Account(accountName, "com.google.GAIA");
c = context.getContentResolver().query(SubscribedFeeds.Feeds.CONTENT_URI,
- null, where, new String[]{accountName, "com.google.GAIA", feed}, null);
+ null, where, new String[]{account.mName, account.mType, feed}, null);
if (c.getCount() == 0) {
Log.w(TAG, "received tickle for non-existent feed: "
+ "account " + accountName + ", feed " + feed);
@@ -125,22 +124,14 @@ public class SubscribedFeedsIntentService extends IntentService {
String authority = c.getString(c.getColumnIndexOrThrow(
SubscribedFeeds.Feeds.AUTHORITY));
EventLog.writeEvent(LOG_TICKLE, authority);
- try {
- if (!ContentResolver.getContentService()
- .getSyncProviderAutomatically(authority)) {
- Log.d(TAG, "supressing tickle since provider " + authority
- + " is configured to not sync automatically");
- continue;
- }
- } catch (RemoteException e) {
+ if (!ContentResolver.getSyncAutomatically(account, authority)) {
+ Log.d(TAG, "supressing tickle since provider " + authority
+ + " is configured to not sync automatically");
continue;
}
- Uri uri = Uri.parse("content://" + authority);
Bundle extras = new Bundle();
- extras.putParcelable(ContentResolver.SYNC_EXTRAS_ACCOUNT,
- new Account(accountName, "com.google.GAIA"));
extras.putString("feed", feed);
- context.getContentResolver().startSync(uri, extras);
+ ContentResolver.requestSync(account, authority, extras);
}
} finally {
if (c != null) c.deactivate();