From ab3a70cf1eebc2e99e11ba10a66ae42d4f4b9262 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Tue, 2 Nov 2021 07:02:21 +0000 Subject: [PATCH] Remove the text for untethered bt device Bug: 204066796 Test: make -j64 RunSettingsRoboTests Change-Id: I35fec4ff998332e6937fc9c360ea488b35b477f8 --- res/values/strings.xml | 3 --- .../bluetooth/ForgetDeviceDialogFragment.java | 7 +------ .../bluetooth/ForgetDeviceDialogFragmentTest.java | 14 -------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index d6f22fbb102..fd789428869 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1923,9 +1923,6 @@ %1$s app will no longer connect to your %2$s - - %1$s will no longer be paired with any device linked to this account - Forget device diff --git a/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java b/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java index 6d8fb3380e1..1da8672b760 100644 --- a/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java +++ b/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java @@ -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; } diff --git a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java index b4f4f97f228..5c232386121 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/ForgetDeviceDialogFragmentTest.java @@ -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))