Loading src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java +7 −5 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class BluetoothDevicesSlice implements CustomSliceable { return PendingIntent .getActivity(mContext, device.hashCode() /* requestCode */, subSettingLauncher.toIntent(), 0 /* flags */); PendingIntent.FLAG_IMMUTABLE); } @VisibleForTesting Loading Loading @@ -236,7 +236,8 @@ public class BluetoothDevicesSlice implements CustomSliceable { .setClass(mContext, SliceBroadcastReceiver.class) .putExtra(EXTRA_ENABLE_BLUETOOTH, true); final SliceAction action = SliceAction.create(PendingIntent.getBroadcast(mContext, 0 /* requestCode */, intent, 0 /* flags */), icon, ListBuilder.ICON_IMAGE, title); 0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE), icon, ListBuilder.ICON_IMAGE, title); return new ListBuilder.RowBuilder() .setTitleItem(icon, ListBuilder.ICON_IMAGE) Loading @@ -252,7 +253,7 @@ public class BluetoothDevicesSlice implements CustomSliceable { final IconCompat icon = Utils.createIconWithDrawable(drawable); final CharSequence title = mContext.getText(R.string.bluetooth_devices); final PendingIntent primaryActionIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */, getIntent(), 0 /* flags */); 0 /* requestCode */, getIntent(), PendingIntent.FLAG_IMMUTABLE); final SliceAction primarySliceAction = SliceAction.createDeeplink(primaryActionIntent, icon, ListBuilder.ICON_IMAGE, title); Loading @@ -274,7 +275,7 @@ public class BluetoothDevicesSlice implements CustomSliceable { .setSourceMetricsCategory(SettingsEnums.BLUETOOTH_PAIRING) .toIntent(); final PendingIntent pi = PendingIntent.getActivity(mContext, intent.hashCode(), intent, 0 /* flags */); PendingIntent.FLAG_IMMUTABLE); return SliceAction.createDeeplink(pi, icon, ListBuilder.ICON_IMAGE, title); } Loading Loading @@ -341,7 +342,8 @@ public class BluetoothDevicesSlice implements CustomSliceable { .putExtra(BLUETOOTH_DEVICE_HASH_CODE, bluetoothDevice.hashCode()); return SliceAction.create( PendingIntent.getBroadcast(mContext, bluetoothDevice.hashCode(), intent, 0), PendingIntent.getBroadcast(mContext, bluetoothDevice.hashCode(), intent, PendingIntent.FLAG_IMMUTABLE), getBluetoothDeviceIcon(bluetoothDevice), ListBuilder.ICON_IMAGE, bluetoothDevice.getName()); Loading tests/robotests/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSliceTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,8 @@ public class BluetoothDevicesSliceTest { // Mock the icon and detail intent of Bluetooth. mIcon = IconCompat.createWithResource(mContext, com.android.internal.R.drawable.ic_settings_bluetooth); mDetailIntent = PendingIntent.getActivity(mContext, 0, new Intent("test action"), 0); mDetailIntent = PendingIntent.getActivity(mContext, 0, new Intent("test action"), PendingIntent.FLAG_IMMUTABLE); doReturn(mIcon).when(mBluetoothDevicesSlice).getBluetoothDeviceIcon(any()); doReturn(mDetailIntent).when(mBluetoothDevicesSlice).getBluetoothDetailIntent(any()); Loading Loading
src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java +7 −5 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class BluetoothDevicesSlice implements CustomSliceable { return PendingIntent .getActivity(mContext, device.hashCode() /* requestCode */, subSettingLauncher.toIntent(), 0 /* flags */); PendingIntent.FLAG_IMMUTABLE); } @VisibleForTesting Loading Loading @@ -236,7 +236,8 @@ public class BluetoothDevicesSlice implements CustomSliceable { .setClass(mContext, SliceBroadcastReceiver.class) .putExtra(EXTRA_ENABLE_BLUETOOTH, true); final SliceAction action = SliceAction.create(PendingIntent.getBroadcast(mContext, 0 /* requestCode */, intent, 0 /* flags */), icon, ListBuilder.ICON_IMAGE, title); 0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE), icon, ListBuilder.ICON_IMAGE, title); return new ListBuilder.RowBuilder() .setTitleItem(icon, ListBuilder.ICON_IMAGE) Loading @@ -252,7 +253,7 @@ public class BluetoothDevicesSlice implements CustomSliceable { final IconCompat icon = Utils.createIconWithDrawable(drawable); final CharSequence title = mContext.getText(R.string.bluetooth_devices); final PendingIntent primaryActionIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */, getIntent(), 0 /* flags */); 0 /* requestCode */, getIntent(), PendingIntent.FLAG_IMMUTABLE); final SliceAction primarySliceAction = SliceAction.createDeeplink(primaryActionIntent, icon, ListBuilder.ICON_IMAGE, title); Loading @@ -274,7 +275,7 @@ public class BluetoothDevicesSlice implements CustomSliceable { .setSourceMetricsCategory(SettingsEnums.BLUETOOTH_PAIRING) .toIntent(); final PendingIntent pi = PendingIntent.getActivity(mContext, intent.hashCode(), intent, 0 /* flags */); PendingIntent.FLAG_IMMUTABLE); return SliceAction.createDeeplink(pi, icon, ListBuilder.ICON_IMAGE, title); } Loading Loading @@ -341,7 +342,8 @@ public class BluetoothDevicesSlice implements CustomSliceable { .putExtra(BLUETOOTH_DEVICE_HASH_CODE, bluetoothDevice.hashCode()); return SliceAction.create( PendingIntent.getBroadcast(mContext, bluetoothDevice.hashCode(), intent, 0), PendingIntent.getBroadcast(mContext, bluetoothDevice.hashCode(), intent, PendingIntent.FLAG_IMMUTABLE), getBluetoothDeviceIcon(bluetoothDevice), ListBuilder.ICON_IMAGE, bluetoothDevice.getName()); Loading
tests/robotests/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSliceTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,8 @@ public class BluetoothDevicesSliceTest { // Mock the icon and detail intent of Bluetooth. mIcon = IconCompat.createWithResource(mContext, com.android.internal.R.drawable.ic_settings_bluetooth); mDetailIntent = PendingIntent.getActivity(mContext, 0, new Intent("test action"), 0); mDetailIntent = PendingIntent.getActivity(mContext, 0, new Intent("test action"), PendingIntent.FLAG_IMMUTABLE); doReturn(mIcon).when(mBluetoothDevicesSlice).getBluetoothDeviceIcon(any()); doReturn(mDetailIntent).when(mBluetoothDevicesSlice).getBluetoothDetailIntent(any()); Loading