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

Commit 527b25ca authored by Eduard Dumitrescul's avatar Eduard Dumitrescul Committed by Android Build Coastguard Worker
Browse files

Get all accounts no matter the visibility

Bug: 417988098
Test: manual
Flag: EXEMPT BUGFIX
(cherry picked from commit a8819d3bdc496d3a4b5ea041434ff5d71b1f8c95)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:d2dc58edebde0bba298c08291a3c3444a4c13dfb
Merged-In: I51c7253b124ab524b817b17dc0aabbdb5ab12ac7
Change-Id: I51c7253b124ab524b817b17dc0aabbdb5ab12ac7
parent c8880490
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -489,6 +489,7 @@ import com.android.server.PersistentDataBlockManagerInternal;
import com.android.server.SystemServerInitThreadPool;
import com.android.server.SystemService;
import com.android.server.SystemServiceManager;
import com.android.server.accounts.AccountManagerService;
import com.android.server.devicepolicy.ActiveAdmin.TrustAgentInfo;
import com.android.server.inputmethod.InputMethodManagerInternal;
import com.android.server.net.NetworkPolicyManagerInternal;
@@ -22784,22 +22785,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }
    private boolean hasAccountsOnAnyUser() {
        long callingIdentity = Binder.clearCallingIdentity();
        try {
            for (UserInfo user : mUserManagerInternal.getUsers(/* excludeDying= */ true)) {
                AccountManager am = mContext.createContextAsUser(
                                UserHandle.of(user.id), /* flags= */ 0)
                        .getSystemService(AccountManager.class);
                Account[] accounts = am.getAccounts();
                if (accounts.length != 0) {
                    return true;
                }
            }
            return false;
        } finally {
            Binder.restoreCallingIdentity(callingIdentity);
        }
        AccountManagerService accountManagerService = AccountManagerService.getSingleton();
        return accountManagerService.getAllAccountsForSystemProcess().length != 0;
    }
    private void setBypassDevicePolicyManagementRoleQualificationStateInternal(