Merge "Add the mutability flag for SettingsSliceProvider"
This commit is contained in:
committed by
Android (Google) Code Review
commit
6cf77c6f88
@@ -343,7 +343,7 @@ public class SettingsSliceProvider extends SliceProvider {
|
|||||||
final Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS)
|
final Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS)
|
||||||
.setPackage(Utils.SETTINGS_PACKAGE_NAME);
|
.setPackage(Utils.SETTINGS_PACKAGE_NAME);
|
||||||
final PendingIntent noOpIntent = PendingIntent.getActivity(getContext(),
|
final PendingIntent noOpIntent = PendingIntent.getActivity(getContext(),
|
||||||
0 /* requestCode */, settingsIntent, 0 /* flags */);
|
0 /* requestCode */, settingsIntent, PendingIntent.FLAG_IMMUTABLE);
|
||||||
return noOpIntent;
|
return noOpIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -565,7 +565,8 @@ public class SettingsSliceProviderTest {
|
|||||||
final Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS)
|
final Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS)
|
||||||
.setPackage(Utils.SETTINGS_PACKAGE_NAME);
|
.setPackage(Utils.SETTINGS_PACKAGE_NAME);
|
||||||
PendingIntent settingsPendingIntent =
|
PendingIntent settingsPendingIntent =
|
||||||
PendingIntent.getActivity(mContext, 0, settingsIntent, 0);
|
PendingIntent.getActivity(mContext, 0, settingsIntent,
|
||||||
|
PendingIntent.FLAG_IMMUTABLE);
|
||||||
|
|
||||||
assertThat(pendingIntent).isEqualTo(settingsPendingIntent);
|
assertThat(pendingIntent).isEqualTo(settingsPendingIntent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user