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

Commit cde345a7 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Update checkKeyIntent

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

Bug: 360846772
Test: manual
Flag: EXEMPT bugfix
Change-Id: Ied7961c73299681aa5b523cf3f00fd905893116f
parent 3408c8bf
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -5062,6 +5062,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);
@@ -5083,14 +5085,15 @@ public class AccountManagerService
            Bundle simulateBundle = p.readBundle();
            p.recycle();
            Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
            if (intent != null && intent.getClass() != Intent.class) {
                return false;
            }
            Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT,
                    Intent.class);
            if (intent == null) {
                return (simulateIntent == null);
            }
            if (intent.getClass() != Intent.class || simulateIntent.getClass() != Intent.class) {
                return false;
            }

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