From 4a9a733d6b1c40b6e91b3a4f7046b8e2214977cd Mon Sep 17 00:00:00 2001 From: Sekyeong Date: Wed, 11 Jan 2023 13:02:51 +0900 Subject: [PATCH] Add FLAG_IMMUTABLE in DevTools app Happened IllegalArgumentException on DevTools app. package : com.android.development Because PendingIntent requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE. Test : DevTools - Connectivity - press START SCREEN TOGGLE button Change-Id: I998c74f974d8f555e8016b2a319e1a9a4a4f2669 Signed-off-by: Sekyeong --- apps/Development/src/com/android/development/Connectivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/Development/src/com/android/development/Connectivity.java b/apps/Development/src/com/android/development/Connectivity.java index 1d8a98b76..e548fbf31 100644 --- a/apps/Development/src/com/android/development/Connectivity.java +++ b/apps/Development/src/com/android/development/Connectivity.java @@ -631,7 +631,8 @@ public class Connectivity extends Activity { i.putExtra(TEST_ALARM_OFF_EXTRA, Long.toString(mSCOffDuration)); i.putExtra(TEST_ALARM_CYCLE_EXTRA, Integer.toString(mSCCycleCount)); - PendingIntent p = PendingIntent.getBroadcast(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent p = PendingIntent.getBroadcast(this, 0, i, + PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE); am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + delayMs, p); }