Skip to content

Commit 033ef2e

Browse files
Dmitry Dementyevaoleary
Dmitry Dementyev
authored andcommitted
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 commit cde345a7ee06db716e613e12a2c218ce248ad1c4) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:eaa1db81807eb7631515fccfd4288ff1e170977a) Merged-In: Ied7961c73299681aa5b523cf3f00fd905893116f Change-Id: Ied7961c73299681aa5b523cf3f00fd905893116f
1 parent 3f228cb commit 033ef2e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

services/core/java/com/android/server/accounts/AccountManagerService.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -4926,6 +4926,8 @@ protected boolean checkKeyIntent(int authUid, Bundle bundle) {
49264926
Log.e(TAG, String.format(tmpl, activityName, pkgName, mAccountType));
49274927
return false;
49284928
}
4929+
intent.setComponent(targetActivityInfo.getComponentName());
4930+
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
49294931
return true;
49304932
} finally {
49314933
Binder.restoreCallingIdentity(bid);
@@ -4947,14 +4949,15 @@ private boolean checkKeyIntentParceledCorrectly(Bundle bundle) {
49474949
Bundle simulateBundle = p.readBundle();
49484950
p.recycle();
49494951
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
4950-
if (intent != null && intent.getClass() != Intent.class) {
4951-
return false;
4952-
}
49534952
Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT,
49544953
Intent.class);
49554954
if (intent == null) {
49564955
return (simulateIntent == null);
49574956
}
4957+
if (intent.getClass() != Intent.class || simulateIntent.getClass() != Intent.class) {
4958+
return false;
4959+
}
4960+
49584961
if (!intent.filterEquals(simulateIntent)) {
49594962
return false;
49604963
}

0 commit comments

Comments
 (0)