Add the mutability flag to the pendingIntent.
Starting Android S, PendingIntent should have a explicit mutability flag to avoid vulnerability. Fixes: 172207853 Test: 1. Make AdaptiveSleepSlice available on the homepage and click on it. 2. Play with the volume panel. Change-Id: I9cd428b17f44f5215d8c06331d12a17f997ca557
This commit is contained in:
@@ -43,6 +43,7 @@ import com.google.common.annotations.VisibleForTesting;
|
|||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
// TODO(b/172310863): consider removing this slice.
|
||||||
public class ContextualAdaptiveSleepSlice implements CustomSliceable {
|
public class ContextualAdaptiveSleepSlice implements CustomSliceable {
|
||||||
private static final String TAG = "ContextualAdaptiveSleepSlice";
|
private static final String TAG = "ContextualAdaptiveSleepSlice";
|
||||||
private static final long DEFAULT_SETUP_TIME = 0;
|
private static final long DEFAULT_SETUP_TIME = 0;
|
||||||
@@ -122,7 +123,8 @@ public class ContextualAdaptiveSleepSlice implements CustomSliceable {
|
|||||||
|
|
||||||
private PendingIntent getPrimaryAction() {
|
private PendingIntent getPrimaryAction() {
|
||||||
final Intent intent = getIntent();
|
final Intent intent = getIntent();
|
||||||
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent, 0 /* flags */);
|
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent,
|
||||||
|
PendingIntent.FLAG_IMMUTABLE /* flags */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user