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

Commit 4e51173c authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Fix semantics of a null address with BT_AUDIO_LOST" am: d1dd9399

am: 20b65a22

Change-Id: Ic0001ec021f366b7922e1d43149e7ab58ac2673f
parents 22bcd6da 20b65a22
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ public class BluetoothRouteManager extends StateMachine {
                        }
                        break;
                    case BT_AUDIO_LOST:
                        if (Objects.equals(mDeviceAddress, address)) {
                        if (Objects.equals(mDeviceAddress, address) || address == null) {
                            Log.i(LOG_TAG, "Connection with device %s failed.",
                                    mDeviceAddress);
                            transitionToActualState();
@@ -406,7 +406,7 @@ public class BluetoothRouteManager extends StateMachine {
                        }
                        break;
                    case BT_AUDIO_LOST:
                        if (Objects.equals(mDeviceAddress, address)) {
                        if (Objects.equals(mDeviceAddress, address) || address == null) {
                            Log.i(LOG_TAG, "HFP connection with device %s lost.", mDeviceAddress);
                            transitionToActualState();
                        } else {
+12 −0
Original line number Diff line number Diff line
@@ -538,6 +538,18 @@ public class BluetoothRouteTransitionTests extends TelecomTestCase {
                .setExpectedFinalStateName(BluetoothRouteManager.AUDIO_OFF_STATE_NAME)
                .build());

        result.add(new BluetoothRouteTestParametersBuilder()
                .setName("Audio disconnect comes with a null device")
                .setInitialBluetoothState(BluetoothRouteManager.AUDIO_CONNECTED_STATE_NAME_PREFIX)
                .setInitialDevice(DEVICE2)
                .setConnectedDevices(DEVICE2)
                .setMessageType(BluetoothRouteManager.BT_AUDIO_LOST)
                .setMessageDevice(null)
                .setExpectedListenerUpdates(ListenerUpdate.AUDIO_DISCONNECTED)
                .setExpectedBluetoothInteraction(NONE)
                .setExpectedFinalStateName(BluetoothRouteManager.AUDIO_OFF_STATE_NAME)
                .build());

        result.add(new BluetoothRouteTestParametersBuilder()
                .setName("Device gets disconnected while pending. No fallback.")
                .setInitialBluetoothState(BluetoothRouteManager.AUDIO_CONNECTING_STATE_NAME_PREFIX)