Merge "Fix checkKeyIntentParceledCorrectly's bypass" into tm-dev am: 176d76f1a6 am: 441a146338

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20709903

Change-Id: I89a930d5c2241c2704468df417fe2b7430b0e2a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hao Ke
2023-01-16 04:08:49 +00:00
committed by Automerger Merge Worker

View File

@@ -3091,7 +3091,7 @@ public class AccountManagerService
}
}
Intent intent = result.getParcelable(AccountManager.KEY_INTENT);
Intent intent = result.getParcelable(AccountManager.KEY_INTENT, Intent.class);
if (intent != null && notifyOnAuthFailure && !customTokens) {
/*
* Make sure that the supplied intent is owned by the authenticator
@@ -3516,8 +3516,7 @@ public class AccountManagerService
Bundle.setDefusable(result, true);
mNumResults++;
Intent intent = null;
if (result != null
&& (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
if (result != null) {
if (!checkKeyIntent(
Binder.getCallingUid(),
result)) {
@@ -4885,8 +4884,10 @@ public class AccountManagerService
EventLog.writeEvent(0x534e4554, "250588548", authUid, "");
return false;
}
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
if (intent == null) {
return true;
}
// Explicitly set an empty ClipData to ensure that we don't offer to
// promote any Uris contained inside for granting purposes
if (intent.getClipData() == null) {
@@ -4936,8 +4937,12 @@ public class AccountManagerService
Bundle simulateBundle = p.readBundle();
p.recycle();
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
return (intent.filterEquals(simulateBundle.getParcelable(AccountManager.KEY_INTENT,
Intent.class)));
Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT,
Intent.class);
if (intent == null) {
return (simulateIntent == null);
}
return intent.filterEquals(simulateIntent);
}
private boolean isExportedSystemActivity(ActivityInfo activityInfo) {
@@ -5082,8 +5087,7 @@ public class AccountManagerService
}
}
}
if (result != null
&& (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
if (result != null) {
if (!checkKeyIntent(
Binder.getCallingUid(),
result)) {