Add a confirmation dialog when forgetting BT device
This adds a confirmation dialog for when you hit the "Forget" button to unpair with a device from the Bluetooth device details page. Bug: 37955181 Test: make RunSettingsRoboTests Change-Id: I7643ed09bf363c48078d6de8a47583bf91fc7729
This commit is contained in:
@@ -43,14 +43,19 @@ public class BluetoothDetailsButtonsController extends BluetoothDetailsControlle
|
||||
mIsConnected = device.isConnected();
|
||||
}
|
||||
|
||||
private void onForgetButtonPressed() {
|
||||
ForgetDeviceDialogFragment fragment =
|
||||
ForgetDeviceDialogFragment.newInstance(mCachedDevice.getAddress());
|
||||
fragment.show(mFragment.getFragmentManager(), ForgetDeviceDialogFragment.TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init(PreferenceScreen screen) {
|
||||
mActionButtons = (LayoutPreference) screen.findPreference(getPreferenceKey());
|
||||
Button rightButton = (Button) mActionButtons.findViewById(R.id.right_button);
|
||||
rightButton.setText(R.string.forget);
|
||||
rightButton.setOnClickListener((view) -> {
|
||||
mCachedDevice.unpair();
|
||||
mFragment.getActivity().finish();
|
||||
onForgetButtonPressed();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user