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

Commit 86f0c214 authored by Matthew Williams's avatar Matthew Williams
Browse files

Protect LOGIN_ACCOUNTS_CHANGED receiver in SyncManager

BUG: 17359770
Reuse the Manifest.permission.ACCOUNT_MANAGER to protect this receiver,
because when this intent lands it kicks off a sync for every account/provider
on the device.
Semantically this means "if you can't talk to an authenticator to do things like
get a token or add an account, then you can't send an intent to the SyncManager
that the accounts on the device have changed in some drastic way"

Change-Id: I7eccc38e135cb00ebb0aafc69afc802fe1c4f219
parent e04c75eb
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.server.content;
package com.android.server.content;


import android.Manifest;
import android.accounts.Account;
import android.accounts.Account;
import android.accounts.AccountAndUser;
import android.accounts.AccountAndUser;
import android.accounts.AccountManager;
import android.accounts.AccountManager;
@@ -478,7 +479,7 @@ public class SyncManager {
            mContext.registerReceiverAsUser(mAccountsUpdatedReceiver,
            mContext.registerReceiverAsUser(mAccountsUpdatedReceiver,
                    UserHandle.ALL,
                    UserHandle.ALL,
                    new IntentFilter(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION),
                    new IntentFilter(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION),
                    null, null);
                    Manifest.permission.ACCOUNT_MANAGER, null);
        }
        }


        // Pick a random second in a day to seed all periodic syncs
        // Pick a random second in a day to seed all periodic syncs