am cb7d3838: Subscribe to subscribedfeeds whenever the accounts change, this is basically a giant hack to let the gsync server know about the subscriptions for accounts.

Merge commit 'cb7d38380cb2ca57e98cd39a96b32a1e804bf00b' into eclair-plus-aosp

* commit 'cb7d38380cb2ca57e98cd39a96b32a1e804bf00b':
  Subscribe to subscribedfeeds whenever the accounts change, this is basically a giant hack to let the gsync server know about the subscriptions for accounts.
This commit is contained in:
Cynthia Wong
2009-08-24 14:44:11 -07:00
committed by Android Git Automerger

View File

@ -16,6 +16,7 @@
package com.android.providers.subscribedfeeds; package com.android.providers.subscribedfeeds;
import android.accounts.Account;
import android.content.UriMatcher; import android.content.UriMatcher;
import android.content.*; import android.content.*;
import android.database.Cursor; import android.database.Cursor;
@ -122,6 +123,14 @@ public class SubscribedFeedsProvider extends AbstractSyncableContentProvider {
"UNIQUE(_sync_id))"); "UNIQUE(_sync_id))");
} }
@Override
protected void onAccountsChanged(Account[] accountsArray) {
super.onAccountsChanged(accountsArray);
for (Account account : accountsArray) {
ContentResolver.setSyncAutomatically(account, "subscribedfeeds", true);
}
}
@Override @Override
protected void onDatabaseOpened(SQLiteDatabase db) { protected void onDatabaseOpened(SQLiteDatabase db) {
db.markTableSyncable("feeds", "_deleted_feeds"); db.markTableSyncable("feeds", "_deleted_feeds");