Merge "Fix DND crash from SpringboardActivity" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-05-29 18:47:23 +00:00
committed by Android (Google) Code Review
6 changed files with 132 additions and 45 deletions

View File

@@ -98,6 +98,17 @@ public class BluetoothSliceBuilder {
.build();
}
public static Intent getIntent(Context context) {
final String screenTitle = context.getText(R.string.bluetooth_settings_title).toString();
final Uri contentUri = new Uri.Builder().appendPath(
SettingsSlicesContract.KEY_BLUETOOTH).build();
return DatabaseIndexingUtils.buildSearchResultPageIntent(context,
BluetoothDashboardFragment.class.getName(), null /* key */, screenTitle,
MetricsProto.MetricsEvent.SETTINGS_CONNECTED_DEVICE_CATEGORY)
.setClassName(context.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
}
/**
* Update the current Bluetooth status to the boolean value keyed by
* {@link android.app.slice.Slice#EXTRA_TOGGLE_STATE} on {@param intent}.
@@ -119,15 +130,7 @@ public class BluetoothSliceBuilder {
}
private static PendingIntent getPrimaryAction(Context context) {
final String screenTitle = context.getText(R.string.bluetooth_settings_title).toString();
final Uri contentUri = new Uri.Builder().appendPath(
SettingsSlicesContract.KEY_BLUETOOTH).build();
final Intent intent = DatabaseIndexingUtils.buildSearchResultPageIntent(context,
BluetoothDashboardFragment.class.getName(), null /* key */, screenTitle,
MetricsProto.MetricsEvent.SETTINGS_CONNECTED_DEVICE_CATEGORY)
.setClassName(context.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
final Intent intent = getIntent(context);
return PendingIntent.getActivity(context, 0 /* requestCode */,
intent, 0 /* flags */);
}