Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e9eb5fb authored by Shuo Qian's avatar Shuo Qian
Browse files

Use FLAG_IMMUTABLE

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
parent 1293973a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2822,7 +2822,8 @@ public class ServiceStateTracker extends Handler {
                    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");