Skip to content

Commit a08ff44

Browse files
Replace PendingIntent.FLAG_UPDATE_CURRENT with PendingIntent.FLAG_CANCEL_CURRENT in InstrumentationActivityInvoker.
FLAG_CANCEL_CURRENT solves the issue where the system caches the extras from the previous intent for the PendingIntent and thus the extras passed to the PendingIntent for the new Intent would be ignored when the action between previous intent and new intent are same. PiperOrigin-RevId: 789036449
1 parent 4d65832 commit a08ff44

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
**Bug Fixes**
88

9+
* Fixes the issue where the system caches the extras from the previous intent for the PendingIntent and thus the extras passed to the PendingIntent for the new Intent would be ignored.
10+
911
**New Features**
1012

1113
**Breaking Changes**

core/java/androidx/test/core/app/InstrumentationActivityInvoker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public void startActivityForResult(Intent intent, @Nullable Bundle activityOptio
464464
getApplicationContext(),
465465
/* requestCode= */ 0,
466466
intent,
467-
/* flags= */ PendingIntent.FLAG_UPDATE_CURRENT | intentMutability))
467+
/* flags= */ PendingIntent.FLAG_CANCEL_CURRENT | intentMutability))
468468
.putExtra(TARGET_ACTIVITY_OPTIONS_BUNDLE_KEY, activityOptionsBundle);
469469

470470
getApplicationContext().startActivity(bootstrapIntent, activityOptionsBundle);

0 commit comments

Comments
 (0)