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

Commit 0c4304ab authored by Kholoud Mohamed's avatar Kholoud Mohamed
Browse files

Clear caller identity before calling dpm#getAccountTypesWithManagementDisabled

Bug: 273494642
Test: btest android.devicepolicy.cts.AccountManagementTest
Change-Id: I3df1f6cec7af068d31c8d61577889e22055ecfc4
parent eb96d2bb
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -5912,6 +5912,7 @@ public class AccountManagerService
    }

    private boolean canUserModifyAccountsForType(int userId, String accountType, int callingUid) {
        return Binder.withCleanCallingIdentity(() -> {
            // the managing app can always modify accounts
            if (isProfileOwner(callingUid)) {
                return true;
@@ -5928,6 +5929,7 @@ public class AccountManagerService
                }
            }
            return true;
        });
    }

    private boolean isProfileOwner(int uid) {