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

Commit 6a184878 authored by Simranjit Singh Kohli's avatar Simranjit Singh Kohli
Browse files

[Fix Potential for error]:

Init for accounts maybe called when non-system app asks for accounts.
That might lead to deletion of accounts and broadcast from the user,
which requires permission. Hence, we should clear calling identity
before requesting it.

Bug: 21140169

Change-Id: I057ac6778ea53d3f96b3e5c42fe3a2fe60c3cf28
parent 00d1fcf7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2355,9 +2355,9 @@ public class AccountManagerService
            callingUid = packageUid;
        }
        checkReadAccountsPermission();
        UserAccounts accounts = getUserAccounts(userId);
        long identityToken = clearCallingIdentity();
        try {
            UserAccounts accounts = getUserAccounts(userId);
            synchronized (accounts.cacheLock) {
                return getAccountsFromCacheLocked(accounts, type, callingUid, callingPackage);
            }