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

Commit 12480087 authored by Shuo Qian's avatar Shuo Qian
Browse files

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
parent 19999ba0
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2895,7 +2895,8 @@ public class ServiceStateTracker extends Handler {
                    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
                    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);


                    Intent intent = new Intent(ACTION_RADIO_OFF);
                    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;
                    mAlarmSwitch = true;
                    if (DBG) log("Alarm setting");
                    if (DBG) log("Alarm setting");