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

Commit b0654810 authored by Aseem Kumar's avatar Aseem Kumar
Browse files

Improve logs in addAccountExplicitly

This helps debug tests and other cases.

Bug: 276975786
Test: atest AccountManagerTest
Change-Id: I5b66b2b5c7e40e61144896ac636fdcd1b857bed4
parent 58f660ab
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -482,14 +482,13 @@ public class AccountManagerService
        Bundle.setDefusable(extras, true);
        int callingUid = Binder.getCallingUid();
        int userId = UserHandle.getCallingUserId();
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "addAccountExplicitly: " + account + ", caller's uid " + callingUid
                    + ", pid " + Binder.getCallingPid());
        }
        Objects.requireNonNull(account, "account cannot be null");
        Log.v(TAG, "addAccountExplicitly: caller's uid=" + callingUid + ", pid="
                + Binder.getCallingPid() + ", packageName=" + opPackageName + ", accountType="
                + account.type);
        if (!isAccountManagedByCaller(account.type, callingUid, userId)) {
            String msg = String.format("uid %s cannot explicitly add accounts of type: %s",
                    callingUid, account.type);
            String msg = String.format("uid=%s, package=%s cannot explicitly add "
                    + "accounts of type: %s", callingUid, opPackageName, account.type);
            throw new SecurityException(msg);
        }
        /*