SAP: Mark the PendingIntents with FLAG_IMMUTABLE
Bug: 178354484
Tag: #stability
Test: atest BluetoothInstrumentationTests
Change-Id: Ibfb4d60f2b1416bc2dab4bf2243f2236dbd20d3c
diff --git a/android/app/src/com/android/bluetooth/sap/SapService.java b/android/app/src/com/android/bluetooth/sap/SapService.java
index 4092284..7bce98c 100644
--- a/android/app/src/com/android/bluetooth/sap/SapService.java
+++ b/android/app/src/com/android/bluetooth/sap/SapService.java
@@ -730,7 +730,8 @@
cancelUserTimeoutAlarm();
mRemoveTimeoutMsg = true;
Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION);
- PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0);
+ PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent,
+ PendingIntent.FLAG_IMMUTABLE);
mAlarmManager.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis() + USER_CONFIRM_TIMEOUT_VALUE, pIntent);
}
@@ -744,7 +745,8 @@
}
if (mRemoveTimeoutMsg) {
Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION);
- PendingIntent sender = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0);
+ PendingIntent sender = PendingIntent.getBroadcast(this, 0, timeoutIntent,
+ PendingIntent.FLAG_IMMUTABLE);
mAlarmManager.cancel(sender);
mRemoveTimeoutMsg = false;
}