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

Commit 4b4b620a authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Android (Google) Code Review
Browse files

Merge "Return empty list if getAccounts is called for removed user." into main

parents 0c1a7229 1cf3e8e6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -4532,8 +4532,13 @@ public class AccountManagerService
    public Account[] getAccountsAsUser(String type, int userId, String opPackageName) {
        int callingUid = Binder.getCallingUid();
        mAppOpsManager.checkPackage(callingUid, opPackageName);
        try {
            return getAccountsAsUserForPackage(type, userId, opPackageName /* callingPackage */, -1,
                    opPackageName, false /* includeUserManagedNotVisible */);
        } catch (SQLiteCantOpenDatabaseException e) {
            Log.e(TAG, "Could not get accounts for user " + userId, e);
            return new Account[]{};
        }
    }

    @NonNull