Set FLAG_IMMUTABLE flag on FirstScreenBroadcast PendingIntent.

Bug: 179289753
Bug: 183927137
Test: restore phone and ensure broadcast is sent
Change-Id: I8d8e38a1aa6bdf13879d460cfa84cabe6c6bb1f2
(cherry picked from commit b62fba0d01)
Merged-In: I8d8e38a1aa6bdf13879d460cfa84cabe6c6bb1f2
This commit is contained in:
Jon Miranda
2021-04-01 13:14:23 -04:00
committed by Jonathan Miranda
parent 170be9beb0
commit 6a7a7f6bad
@@ -15,6 +15,15 @@
*/
package com.android.launcher3.model;
import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.app.PendingIntent.FLAG_ONE_SHOT;
import static android.os.Process.myUserHandle;
import static com.android.launcher3.pm.InstallSessionHelper.getUserHandle;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.mapping;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@@ -140,7 +149,7 @@ public class FirstScreenBroadcast {
.putStringArrayListExtra(HOTSEAT_ITEM_EXTRA, new ArrayList<>(hotseatItems))
.putStringArrayListExtra(WIDGET_ITEM_EXTRA, new ArrayList<>(widgetItems))
.putExtra(VERIFICATION_TOKEN_EXTRA, PendingIntent.getActivity(context, 0,
new Intent(), PendingIntent.FLAG_ONE_SHOT)));
new Intent(), FLAG_ONE_SHOT | FLAG_IMMUTABLE)));
}
private static String getPackageName(ItemInfo info) {