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

Commit e2f34a8b authored by Angela Wang's avatar Angela Wang
Browse files

Announce current state after clicking connect/disconnect buttons

Clearly indicate the current state is connecting or disconnecting after
clicking on the button for TalkBack users by setting the content
description respectively.

Flag: EXEMPT bugfix
Bug: 419160629
Test: manually test with TalkBack on, video attached in bug
Change-Id: Ic5c5dfe0065190427dd849a562cbc3204a7c4ece
parent 8cb24b2d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2097,6 +2097,10 @@
    <string name="bluetooth_device_context_disconnect">Disconnect</string>
    <!-- Bluetooth settings.  Context menu item for a device.  Action will first pair, and then connect to all profiles on the device. -->
    <string name="bluetooth_device_context_pair_connect">Pair &amp; connect</string>
    <!-- Bluetooth settings.  Message when connecting to a device -->
    <string name="bluetooth_connecting">Connecting</string>
    <!-- Bluetooth settings.  Message when disconnecting from a device -->
    <string name="bluetooth_disconnecting">Disconnecting</string>
    <!-- Bluetooth settings. Text displayed when Bluetooth is off and device list is empty [CHAR LIMIT=NONE]-->
    <string name="bluetooth_empty_list_bluetooth_off">When Bluetooth is turned on, your device can communicate with other nearby Bluetooth devices</string>
    <!-- Bluetooth settings. Text displayed when Bluetooth is off and device list is empty when auto-on feature is enabled [CHAR LIMIT=NONE]-->
+9 −6
Original line number Diff line number Diff line
@@ -70,10 +70,12 @@ public class BluetoothDetailsButtonsController extends BluetoothDetailsControlle
            if (!mConnectButtonInitialized || !previouslyConnected) {
                mActionButtons
                        .setButton2Text(R.string.bluetooth_device_context_disconnect)
                        .setButton2Description(R.string.bluetooth_device_context_disconnect)
                        .setButton2Icon(R.drawable.ic_settings_close)
                        .setButton2OnClickListener(view -> {
                            mMetricsFeatureProvider.action(mContext,
                                    SettingsEnums.ACTION_SETTINGS_BLUETOOTH_DISCONNECT);
                            mActionButtons.setButton2Description(R.string.bluetooth_disconnecting);
                            mCachedDevice.disconnect();
                        });
                mConnectButtonInitialized = true;
@@ -82,11 +84,12 @@ public class BluetoothDetailsButtonsController extends BluetoothDetailsControlle
            if (!mConnectButtonInitialized || previouslyConnected) {
                mActionButtons
                        .setButton2Text(R.string.bluetooth_device_context_connect)
                        .setButton2Description(R.string.bluetooth_device_context_connect)
                        .setButton2Icon(R.drawable.ic_add_24dp)
                        .setButton2OnClickListener(
                                view -> {
                        .setButton2OnClickListener(view -> {
                            mMetricsFeatureProvider.action(mContext,
                                    SettingsEnums.ACTION_SETTINGS_BLUETOOTH_CONNECT);
                            mActionButtons.setButton2Description(R.string.bluetooth_connecting);
                            mCachedDevice.connect();
                        });
                mConnectButtonInitialized = true;