Skip to content

Commit

Permalink
Update checkKeyIntent
Browse files Browse the repository at this point in the history
1) Explicityly set  component after target activity check.
2) Update Intent subclass check.

Bug: 360846772
Test: manual
Flag: EXEMPT bugfix
(cherry picked from commit cde345a7ee06db716e613e12a2c218ce248ad1c4)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:58f3d5b2226cc9c6dc9fcca1427eb6574dcc0eb8)
Merged-In: Ied7961c73299681aa5b523cf3f00fd905893116f
Change-Id: Ied7961c73299681aa5b523cf3f00fd905893116f
  • Loading branch information
Dmitry Dementyev authored and Android Build Coastguard Worker committed Nov 6, 2024
1 parent 43240ad commit 985bdc6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4978,6 +4978,8 @@ protected boolean checkKeyIntent(int authUid, Bundle bundle) {
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);
Expand All @@ -4999,14 +5001,15 @@ private boolean checkKeyIntentParceledCorrectly(Bundle bundle) {
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;
}
Expand Down

0 comments on commit 985bdc6

Please sign in to comment.