commit | 1e6c7f615eb78811b8ba3136c6f4a052ca3b6cf0 | [log] [tgz] |
---|---|---|
author | Shuo Qian <shuoq@google.com> | Wed May 06 17:42:00 2020 -0700 |
committer | Shuo Qian <shuoq@google.com> | Fri May 15 22:24:44 2020 +0000 |
tree | 152cbf7529b1a96c383e719ead49f02077db8f22 | |
parent | 2c39575764f5aa4718b5e68be0441e84d3aa9ce7 [diff] |
Use FLAG_IMMUTABLE for ServiceStateTracker Require that the PendingIntent be immutable so that a malicious app is not able to hijack and mutate any of the details. Test: Android builds Bug: 155094269 Change-Id: If127b73c975b5b3f004500de7f9baa6a7bc00ce4 Merged-In: If127b73c975b5b3f004500de7f9baa6a7bc00ce4
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java index de677c9..333dae9 100644 --- a/src/java/com/android/internal/telephony/ServiceStateTracker.java +++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -2363,7 +2363,8 @@ AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(ACTION_RADIO_OFF); - mRadioOffIntent = PendingIntent.getBroadcast(context, 0, intent, 0); + mRadioOffIntent = PendingIntent.getBroadcast( + context, 0, intent, PendingIntent.FLAG_IMMUTABLE); mAlarmSwitch = true; if (DBG) log("Alarm setting");