Merge "Update dialog text for untethered BT device" into qt-dev
This commit is contained in:
@@ -29,6 +29,7 @@ import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settingslib.bluetooth.BluetoothUtils;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
|
||||
@@ -72,13 +73,18 @@ public class ForgetDeviceDialogFragment extends InstrumentedDialogFragment {
|
||||
};
|
||||
Context context = getContext();
|
||||
mDevice = getDevice(context);
|
||||
final boolean untetheredHeadset = BluetoothUtils.getBooleanMetaData(
|
||||
mDevice.getDevice(), BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET);
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(context)
|
||||
.setPositiveButton(R.string.bluetooth_unpair_dialog_forget_confirm_button,
|
||||
onConfirm)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.create();
|
||||
dialog.setTitle(R.string.bluetooth_unpair_dialog_title);
|
||||
dialog.setMessage(context.getString(R.string.bluetooth_unpair_dialog_body,
|
||||
dialog.setMessage(context.getString(untetheredHeadset
|
||||
? R.string.bluetooth_untethered_unpair_dialog_body
|
||||
: R.string.bluetooth_unpair_dialog_body,
|
||||
mDevice.getName()));
|
||||
return dialog;
|
||||
}
|
||||
|
Reference in New Issue
Block a user