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

Commit 10c9d118 authored by Kweku Adams's avatar Kweku Adams
Browse files

Make Battery Saver notification PendingIntent immutable.

Require that the PendingIntent be immutable so that a malicious app is
not able to hijack and mutate any of the details.

Bug: 153879099
Test: Android builds
Change-Id: Id5811568a051753d3b44e56d553c421198e964e3
parent cd220824
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -838,7 +838,8 @@ public class BatterySaverStateMachine {
        Intent intent = new Intent(intentAction);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        PendingIntent batterySaverIntent = PendingIntent.getActivity(
                mContext, 0 /* requestCode */, intent, PendingIntent.FLAG_UPDATE_CURRENT);
                mContext, 0 /* requestCode */, intent,
                PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
        final String title = res.getString(titleId);
        final String summary = res.getString(summaryId);