Remove the text for untethered bt device

Bug: 204066796
Test: make -j64 RunSettingsRoboTests
Change-Id: I35fec4ff998332e6937fc9c360ea488b35b477f8
This commit is contained in:
Hugh Chen
2021-11-02 07:02:21 +00:00
parent d9db89af86
commit ab3a70cf1e
3 changed files with 1 additions and 23 deletions

View File

@@ -1923,9 +1923,6 @@
<!-- Bluetooth device details companion apps. The body of confirmation dialog for remove association. [CHAR LIMIT=60] -->
<string name="bluetooth_companion_app_body"><xliff:g id="app_name" example="App Name">%1$s</xliff:g> app will no longer connect to your <xliff:g id="device_name" example="Device Name">%2$s</xliff:g></string>
<!-- Bluetooth device details. The body of a confirmation dialog for unpairing a paired device. [CHAR LIMIT=NONE] -->
<string name="bluetooth_untethered_unpair_dialog_body"><xliff:g id="device_name" example="Jack's headphone">%1$s</xliff:g> will no longer be paired with any device linked to this account</string>
<!-- Bluetooth device details. In the confirmation dialog for unpairing a paired device, this is the label on the button that will complete the unpairing action. -->
<string name="bluetooth_unpair_dialog_forget_confirm_button">Forget device</string>
<!-- Bluetooth device details companion apps. In the confirmation dialog for removing an associated app, this is the label on the button that will complete the disassociate action. [CHAR LIMIT=80] -->

View File

@@ -29,7 +29,6 @@ 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;
@@ -73,8 +72,6 @@ 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,
@@ -82,9 +79,7 @@ public class ForgetDeviceDialogFragment extends InstrumentedDialogFragment {
.setNegativeButton(android.R.string.cancel, null)
.create();
dialog.setTitle(R.string.bluetooth_unpair_dialog_title);
dialog.setMessage(context.getString(untetheredHeadset
? R.string.bluetooth_untethered_unpair_dialog_body
: R.string.bluetooth_unpair_dialog_body,
dialog.setMessage(context.getString(R.string.bluetooth_unpair_dialog_body,
mDevice.getName()));
return dialog;
}

View File

@@ -98,20 +98,6 @@ public class ForgetDeviceDialogFragmentTest {
assertThat(mActivity.isFinishing()).isTrue();
}
@Test
public void createDialog_untetheredDevice_showUntetheredMessage() {
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
.thenReturn("true".getBytes());
FragmentController.setupFragment(mFragment, FragmentActivity.class,
0 /* containerViewId */, null /* bundle */);
final AlertDialog dialog = ShadowAlertDialogCompat.getLatestAlertDialog();
ShadowAlertDialogCompat shadowDialog = ShadowAlertDialogCompat.shadowOf(dialog);
assertThat(shadowDialog.getMessage()).isEqualTo(
mContext.getString(R.string.bluetooth_untethered_unpair_dialog_body, DEVICE_NAME));
}
@Test
public void createDialog_normalDevice_showNormalMessage() {
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))