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

Commit 349ac1ee authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Android Build Coastguard Worker
Browse files

Update checkKeyIntent

1) Explicityly set  component after target activity check.
2) Update Intent subclass check.

Bug: 360846772
Test: manual
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2bd443154fd447b6a6792b85a77f47f9edcad8a2)
Merged-In: Iafc1e2260107f7ecc18c90ce12f8987b4fc76350
Change-Id: Iafc1e2260107f7ecc18c90ce12f8987b4fc76350
parent 896c14f0
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -4916,6 +4916,8 @@ public class AccountManagerService
                    Log.e(TAG, String.format(tmpl, activityName, pkgName, mAccountType));
                    return false;
                }
                intent.setComponent(targetActivityInfo.getComponentName());
                bundle.putParcelable(AccountManager.KEY_INTENT, intent);
                return true;
            } finally {
                Binder.restoreCallingIdentity(bid);
@@ -4937,13 +4939,14 @@ public class AccountManagerService
            Bundle simulateBundle = p.readBundle();
            p.recycle();
            Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
            if (intent != null && intent.getClass() != Intent.class) {
                return false;
            }
            Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT);
            if (intent == null) {
                return (simulateIntent == null);
            }
            if (intent.getClass() != Intent.class || simulateIntent.getClass() != Intent.class) {
                return false;
            }

            if (!intent.filterEquals(simulateIntent)) {
                return false;
            }