Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8118b9ff authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove the text for untethered bt device" into sc-v2-dev

parents 12b7fd54 ab3a70cf
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1921,9 +1921,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] -->
+1 −6
Original line number Diff line number Diff line
@@ -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;
    }
+0 −14
Original line number Diff line number Diff line
@@ -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))