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

Commit d94eb445 authored by Cole Faust's avatar Cole Faust
Browse files

Add FLAG_IMMUTABLE to PendingIntents

If your app targets Android 12, you must specify the mutability of each
PendingIntent object that your app creates. This additional requirement
improves your app's security.
https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability

Android Lint is being updated, and adds an error-level check for this.

Bug: 247885568
Test: Presubmits
Change-Id: I0634a7cf0c05e69f66c882158eb5f3fd1431bb7e
parent ad65af00
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -230,8 +230,8 @@ public class CandidateSuggestion {
                .setSummary(summary)
                .setFlags(flags)
                .setIcon(icon)
                .setPendingIntent(PendingIntent
                        .getActivity(mContext, 0 /* requestCode */, mIntent, 0 /* flags */));
                .setPendingIntent(PendingIntent.getActivity(
                        mContext, 0 /* requestCode */, mIntent, PendingIntent.FLAG_IMMUTABLE));
    }

    /**