Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb7d3838 authored by Cynthia Wong's avatar Cynthia Wong
Browse files

Subscribe to subscribedfeeds whenever the accounts change, this is basically a...

Subscribe to subscribedfeeds whenever the accounts change, this is basically a giant hack to let the gsync server know about the subscriptions for accounts.
parent 7bc08e9d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.providers.subscribedfeeds;

import android.accounts.Account;
import android.content.UriMatcher;
import android.content.*;
import android.database.Cursor;
@@ -122,6 +123,14 @@ public class SubscribedFeedsProvider extends AbstractSyncableContentProvider {
                    "UNIQUE(_sync_id))");
    }

    @Override
    protected void onAccountsChanged(Account[] accountsArray) {
        super.onAccountsChanged(accountsArray);
        for (Account account : accountsArray) {
            ContentResolver.setSyncAutomatically(account, "subscribedfeeds", true);
        }
    }

    @Override
    protected void onDatabaseOpened(SQLiteDatabase db) {
        db.markTableSyncable("feeds", "_deleted_feeds");