Home | History | Annotate | Download | only in content

Lines Matching refs:ACCOUNT

19 import android.accounts.Account;
353 private boolean containsAccountAndUser(AccountAndUser[] accounts, Account account, int userId) {
357 && accounts[i].account.equals(account)) {
365 /** target indicates endpoints that should be synced after account info is updated. */
378 Account[] accountsForUser = AccountManagerService.getSingleton().getAccounts(
599 scheduleSync(info.account, info.userId, reason, info.provider, extras,
680 mAccountManagerInternal.addOnAppPermissionChangeListener((Account account, int uid) -> {
681 // If the UID gained access to the account kick-off syncs lacking account access
682 if (mAccountManagerInternal.hasAccountAccess(account, uid)) {
683 scheduleSync(account, UserHandle.getUserId(uid),
740 // Register for account list updates for all users
760 // Sync adapters were able to access the synced account without the accounts
762 // sync adapters that don't have access to the account to get user consent.
764 // before we started checking for account access because they already know
765 // the account (they run before) which is the genie is out of the bottle.
804 for (Account account : mAccountManager.getAccountsByTypeAsUser(
806 if (!canAccessAccount(account, packageName, userId)) {
807 mAccountManager.updateAppPermission(account,
837 private int getIsSyncable(Account account, int userId, String providerName) {
838 int isSyncable = mSyncStorageEngine.getIsSyncable(account, userId, providerName);
847 SyncAdapterType.newKey(providerName, account.type), userId);
860 && pInfo.restrictedAccountType.equals(account.type)) {
897 * @param requestedAccount the account to sync, may be null to signify all accounts
918 public void scheduleSync(Account requestedAccount, int userId, int reason,
928 private void scheduleSync(Account requestedAccount, int userId, int reason,
950 if (requestedAccount.equals(runningAccount.account)) {
993 for (AccountAndUser account : accounts) {
995 if (userId >= UserHandle.USER_SYSTEM && account.userId >= UserHandle.USER_SYSTEM
996 && userId != account.userId) {
1000 // For each authority sync each account that matches a sync adapter.
1003 mSyncAdapters.getAllServices(account.userId)) {
1017 int isSyncable = computeSyncable(account.account, account.userId, authority,
1026 account.account.type), account.userId);
1040 // If the app did not run and has no account access, done
1049 mAccountManagerInternal.requestAccountAccess(account.account,
1054 scheduleSync(account.account, userId, reason, authority,
1068 account.account, account.userId, authority, AuthorityInfo.SYNCABLE,
1084 || (mSyncStorageEngine.getMasterSyncAutomatically(account.userId)
1085 && mSyncStorageEngine.getSyncAutomatically(account.account,
1086 account.userId, authority));
1089 Log.d(TAG, "scheduleSync: sync of " + account + ", " + authority
1096 account.account, authority, account.userId);
1106 sendOnUnsyncableAccount(mContext, syncAdapterInfo, account.userId,
1107 () -> scheduleSync(account.account, account.userId, reason,
1120 + ", account " + account
1125 new SyncOperation(account.account, account.userId,
1138 + ", account " + account
1143 new SyncOperation(account.account, account.userId,
1153 public int computeSyncable(Account account, int userId, String authority,
1155 final int status = getIsSyncable(account, userId, authority);
1159 final SyncAdapterType type = SyncAdapterType.newKey(authority, account.type);
1177 if (checkAccountAccess && !canAccessAccount(account, owningPackage, owningUid)) {
1178 Log.w(TAG, "Access to " + account + " denied for package "
1186 private boolean canAccessAccount(Account account, String packageName, int uid) {
1187 if (mAccountManager.hasAccountAccess(account, packageName,
1191 // We relax the account access rule to also include the system apps as
1193 // involvement is required to grant access to the synced account.
1246 periodicSyncs.add(new PeriodicSync(op.target.account, op.target.provider,
1258 public void scheduleLocalSync(Account account, int userId, int reason, String authority,
1262 scheduleSync(account, userId, reason, authority, extras,
1488 * have null account/provider info to specify all accounts/providers.
1687 * have null account/provider info to specify all accounts/providers.
1797 final Account[] accounts = AccountManagerService.getSingleton().getAccounts(userId,
1799 for (Account account : accounts) {
1800 scheduleSync(account, userId, SyncOperation.REASON_USER_START, null, null,
1810 null /* any account */,
1823 mSyncStorageEngine.doDatabaseCleanup(new Account[0], userId);
2023 res = stringComparator.compare(op1.target.account.type, op2.target.account.type);
2026 res = stringComparator.compare(op1.target.account.name, op2.target.account.name);
2237 for (AccountAndUser account : accounts) {
2238 pw.printf("Account %s u%d %s\n",
2239 account.account.name, account.userId, account.account.type);
2268 sorted.addAll(mSyncAdapters.getAllServices(account.userId));
2278 if (!syncAdapterType.type.accountType.equals(account.account.type)) {
2285 account.account,
2287 account.userId));
2356 pw.print(event.first.account.name);
2358 pw.print(event.first.account.type);
2437 accountKey = authorityInfo.target.account.name + "/"
2438 + authorityInfo.target.account.type
2567 accountKey = authorityInfo.target.account.name + "/"
2568 + authorityInfo.target.account.type
2635 accountKey = authorityInfo.target.account.name + "/"
2636 + authorityInfo.target.account.type
3316 currentSyncContext.mSyncOperation.target.account,
3318 Log.d(TAG, "canceling sync since the account is no longer running");
3324 // On account add, check if there are any settings to be restored.
3326 if (!containsAccountAndUser(oldAccounts, aau.account, aau.userId)) {
3328 Log.d(TAG, "Account " + aau.account + " added, checking sync restore data");
3339 if (!containsAccountAndUser(allAccounts, op.target.account, op.target.userId)) {
3346 scheduleSync(syncTargets.account, syncTargets.userId,
3406 target.provider, target.account.type),
3423 // If the app did not run and has no account access, done
3427 mAccountManagerInternal.requestAccountAccess(op.target.account,
3509 // Drop the sync if the account of this operation no longer exists.
3511 if (!containsAccountAndUser(accounts, target.account, target.userId)) {
3513 Slog.v(TAG, " Dropping sync operation: account doesn't exist.");
3518 state = computeSyncable(target.account, target.userId, target.provider, true);
3534 && mSyncStorageEngine.getSyncAutomatically(target.account,
3575 SyncAdapterType.newKey(info.provider, info.account.type);
3618 mLogger.log("Sync start: account=" + syncOperation.target.account,
3627 syncOperation.target.account, syncOperation.extras);
3795 installHandleTooManyDeletesNotification(info.account,
3800 Integer.toString(info.account.hashCode() ^ info.provider.hashCode()),
3806 new SyncOperation(info.account, info.userId,
3859 private void installHandleTooManyDeletesNotification(Account account, String authority,
3871 clickIntent.putExtra("account", account);
3891 new Notification.Builder(contextForUser, SystemNotificationChannels.ACCOUNT)
3905 Integer.toString(account.hashCode() ^ authority.hashCode()),