Merge "Error handler for start dialog from adb command"

This commit is contained in:
TreeHugger Robot
2019-09-25 08:27:51 +00:00
committed by Android (Google) Code Review

View File

@@ -65,6 +65,11 @@ public class BluetoothPairingDialog extends FragmentActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
if (intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE) == null) {
// Error handler for the case that dialog is started from adb command.
finish();
return;
}
mBluetoothPairingController = new BluetoothPairingController(intent, this);
// build the dialog fragment
boolean fragmentFound = true;