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

Commit cdb9ea79 authored by Carlos Valdivia's avatar Carlos Valdivia Committed by Android (Google) Code Review
Browse files

Merge "Package checks for resloving recovery tokens should be user sensitive." into klp-dev

parents cf8a6ca9 416747ae
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -2167,16 +2167,21 @@ public class AccountManagerService
                 * this can be very bad when those apps are in the system like
                 * the System Settings.
                 */
                int authenticatorUid = Binder.getCallingUid();
                long bid = Binder.clearCallingIdentity();
                try {
                    PackageManager pm = mContext.getPackageManager();
                ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
                    ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId);
                    int targetUid = resolveInfo.activityInfo.applicationInfo.uid;
                int authenticatorUid = Binder.getCallingUid();
                    if (PackageManager.SIGNATURE_MATCH !=
                            pm.checkSignatures(authenticatorUid, targetUid)) {
                        throw new SecurityException(
                                "Activity to be started with KEY_INTENT must " +
                               "share Authenticator's signatures");
                    }
                } finally {
                    Binder.restoreCallingIdentity(bid);
                }
            }
            if (result != null
                    && !TextUtils.isEmpty(result.getString(AccountManager.KEY_AUTHTOKEN))) {