summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Surajit Chandra <surajitc@google.com> 2024-01-22 06:52:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-01-22 06:52:02 +0000
commit0c5b8e2764f516c28814f243fef2d5d1b5df4c5c (patch)
tree346d20720b42fc047096b86eceed82fc55fcdd65
parent07c634ab7c1fab39bfc9c4fbae118564d99fea8a (diff)
Revert "Check Bundle when creating/sending a PendingIntent"
Revert submission 25930905-b320664730 Reason for revert: Reason for revert: Potential culprit for b/321623319 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reverted changes: /q/submissionid:25930905-b320664730 Change-Id: I8a1a8cf753e2568499cb95fe8770185b019c0e30
-rw-r--r--core/java/android/app/PendingIntent.java8
-rw-r--r--services/core/java/com/android/server/am/PendingIntentController.java6
-rw-r--r--services/core/java/com/android/server/am/PendingIntentRecord.java12
3 files changed, 3 insertions, 23 deletions
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java
index 1ac08ac4cd24..0261f0a02174 100644
--- a/core/java/android/app/PendingIntent.java
+++ b/core/java/android/app/PendingIntent.java
@@ -179,14 +179,6 @@ public final class PendingIntent implements Parcelable {
@Overridable
public static final long BLOCK_MUTABLE_IMPLICIT_PENDING_INTENT = 236704164L;
- /**
- * Validate options passed in as bundle.
- * @hide
- */
- @ChangeId
- @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
- public static final long PENDING_INTENT_OPTIONS_CHECK = 320664730L;
-
/** @hide */
@IntDef(flag = true,
value = {
diff --git a/services/core/java/com/android/server/am/PendingIntentController.java b/services/core/java/com/android/server/am/PendingIntentController.java
index 5df910716ba6..a20623cd1ee9 100644
--- a/services/core/java/com/android/server/am/PendingIntentController.java
+++ b/services/core/java/com/android/server/am/PendingIntentController.java
@@ -30,7 +30,6 @@ import android.app.ActivityOptions;
import android.app.AppGlobals;
import android.app.PendingIntent;
import android.app.PendingIntentStats;
-import android.app.compat.CompatChanges;
import android.content.IIntentSender;
import android.content.Intent;
import android.os.Binder;
@@ -137,11 +136,6 @@ public class PendingIntentController {
+ "intent creator ("
+ packageName
+ ") because this option is meant for the pending intent sender");
- if (CompatChanges.isChangeEnabled(PendingIntent.PENDING_INTENT_OPTIONS_CHECK,
- callingUid)) {
- throw new IllegalArgumentException("pendingIntentBackgroundActivityStartMode "
- + "must not be set when creating a PendingIntent");
- }
opts.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED);
}
diff --git a/services/core/java/com/android/server/am/PendingIntentRecord.java b/services/core/java/com/android/server/am/PendingIntentRecord.java
index 95e130ed1194..10d5fd3f77b6 100644
--- a/services/core/java/com/android/server/am/PendingIntentRecord.java
+++ b/services/core/java/com/android/server/am/PendingIntentRecord.java
@@ -406,9 +406,6 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
String resolvedType, IBinder allowlistToken, IIntentReceiver finishedReceiver,
String requiredPermission, IBinder resultTo, String resultWho, int requestCode,
int flagsMask, int flagsValues, Bundle options) {
- final int callingUid = Binder.getCallingUid();
- final int callingPid = Binder.getCallingPid();
-
if (intent != null) intent.setDefusable(true);
if (options != null) options.setDefusable(true);
@@ -461,12 +458,6 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
+ key.packageName
+ ") because this option is meant for the pending intent "
+ "creator");
- if (CompatChanges.isChangeEnabled(PendingIntent.PENDING_INTENT_OPTIONS_CHECK,
- callingUid)) {
- throw new IllegalArgumentException(
- "pendingIntentCreatorBackgroundActivityStartMode "
- + "must not be set when sending a PendingIntent");
- }
opts.setPendingIntentCreatorBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED);
}
@@ -503,6 +494,9 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
}
// We don't hold the controller lock beyond this point as we will be calling into AM and WM.
+ final int callingUid = Binder.getCallingUid();
+ final int callingPid = Binder.getCallingPid();
+
// Only system senders can declare a broadcast to be alarm-originated. We check
// this here rather than in the general case handling below to fail before the other
// invocation side effects such as allowlisting.