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

Commit 16e37891 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Remove conversion from uid to package name getAccountsFromCacheLocked

Conversion should happen in filerAccounts method to preserve
filterSharedAccounts logic.
Bug: 36485175
Test: cts

Change-Id: I4c7fd086de5883e68894c42476e2fe12f1adb97a
parent 541feb1c
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -5393,7 +5393,7 @@ public class AccountManagerService

    @NonNull
    private Account[] filterAccounts(UserAccounts accounts, Account[] unfiltered, int callingUid,
            String callingPackage, boolean includeManagedNotVisible) {
            @Nullable String callingPackage, boolean includeManagedNotVisible) {
        String visibilityFilterPackage = callingPackage;
        if (visibilityFilterPackage == null) {
            visibilityFilterPackage = getPackageNameForUid(callingUid);
@@ -5429,8 +5429,7 @@ public class AccountManagerService
        }
        UserInfo user = getUserManager().getUserInfo(userAccounts.userId);
        if (user != null && user.isRestricted()) {
            String[] packages =
                    mPackageManager.getPackagesForUid(callingUid);
            String[] packages = mPackageManager.getPackagesForUid(callingUid);
            if (packages == null) {
                packages = new String[] {};
            }
@@ -5501,9 +5500,6 @@ public class AccountManagerService
    @NonNull
    protected Account[] getAccountsFromCacheLocked(UserAccounts userAccounts, String accountType,
            int callingUid, @Nullable String callingPackage, boolean includeManagedNotVisible) {
        if (callingPackage == null) {
            callingPackage = getPackageNameForUid(callingUid);
        }
        if (accountType != null) {
            final Account[] accounts = userAccounts.accountCache.get(accountType);
            if (accounts == null) {