Add the mutability flag to the pendingIntent

Since Android S, it's required to specify a mutability flag
when creating a PendingIntent.

Fixes: 172812025
Fixes: 172811729
Test: robotests
Change-Id: Ia77c189c99712eea524fb1bf68e39a087dcba95c
This commit is contained in:
Mill Chen
2021-01-07 20:10:32 +08:00
parent 88d1033150
commit 63c4595b65
2 changed files with 2 additions and 4 deletions

View File

@@ -48,8 +48,6 @@ import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import java.util.Collections;
@RunWith(RobolectricTestRunner.class)
public class SliceFullCardRendererHelperTest {
@@ -138,7 +136,7 @@ public class SliceFullCardRendererHelperTest {
mActivity,
title.hashCode() /* requestCode */,
new Intent("test action"),
0 /* flags */);
PendingIntent.FLAG_IMMUTABLE);
final SliceAction action
= SliceAction.createDeeplink(pendingIntent, icon, ListBuilder.SMALL_IMAGE, title);
return new ListBuilder(mActivity, TEST_SLICE_URI, ListBuilder.INFINITY)

View File

@@ -106,7 +106,7 @@ public class SliceHalfCardRendererHelperTest {
mActivity,
title.hashCode() /* requestCode */,
new Intent("test action"),
0 /* flags */);
PendingIntent.FLAG_IMMUTABLE);
final SliceAction action
= SliceAction.createDeeplink(pendingIntent, icon, ListBuilder.SMALL_IMAGE, title);
return new ListBuilder(mActivity, TEST_SLICE_URI, ListBuilder.INFINITY)