summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hao Ke <haok@google.com> 2023-01-11 20:02:36 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-01-11 20:02:36 +0000
commit7952c93b10f5b8df86b59bbafb974d6aa5d09cd7 (patch)
tree8bd3e6a59be142a74d822cb4e6aa4683cd18024d
parentf65a29538b90cf25ac038b5bdf07d8424b310588 (diff)
parent82a8fddc91ca0b9494cf9bd4e665c3991be1cfbd (diff)
Merge "Fix checkKeyIntentParceledCorrectly's bypass" into rvc-dev am: 82a8fddc91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20912010 Change-Id: Ia3f19e488ec06ad7bdb853ce26fafea2f59a8bcd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index ad41c129e96a..8d4337accc20 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -3430,8 +3430,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)) {
@@ -4790,8 +4789,10 @@ public class AccountManagerService
EventLog.writeEvent(0x534e4554, "250588548", authUid, "");
return false;
}
-
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
+ 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) {
@@ -4844,7 +4845,10 @@ public class AccountManagerService
p.recycle();
Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT);
- return (intent.filterEquals(simulateIntent));
+ if (intent == null) {
+ return (simulateIntent == null);
+ }
+ return intent.filterEquals(simulateIntent);
}
private boolean isExportedSystemActivity(ActivityInfo activityInfo) {
@@ -4989,8 +4993,7 @@ public class AccountManagerService
}
}
}
- if (result != null
- && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
+ if (result != null) {
if (!checkKeyIntent(
Binder.getCallingUid(),
result)) {