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

Commit 5ae6ec2f authored by Sanket Agarwal's avatar Sanket Agarwal Committed by android-build-merger
Browse files

Merge "Fix connection state broadcasts" am: f0e92bd5

am: 30954806

Change-Id: I6094c6e9e6774cbd342cc97bfc36969acbe16821
parents 3c70c64a 30954806
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -437,9 +437,12 @@ final class A2dpSinkStateMachine extends StateMachine {
                    }
                } else {
                    loge("Unknown device Connected: " + device);
                    // something is wrong here, but sync our state with stack
                    // something is wrong here, but sync our state with stack by connecting to
                    // the new device and disconnect from previous device.
                    broadcastConnectionState(device, BluetoothProfile.STATE_CONNECTED,
                                             BluetoothProfile.STATE_DISCONNECTED);
                    broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED,
                        BluetoothProfile.STATE_CONNECTING);
                    synchronized (A2dpSinkStateMachine.this) {
                        mCurrentDevice = device;
                        mTargetDevice = null;
+3 −3
Original line number Diff line number Diff line
@@ -1092,8 +1092,8 @@ final class HeadsetClientStateMachine extends StateMachine {
                      transitionTo(mDisconnected);
                      broadcastConnectionState(
                          mCurrentDevice,
                          BluetoothProfile.STATE_CONNECTING,
                          BluetoothProfile.STATE_DISCONNECTED);
                          BluetoothProfile.STATE_DISCONNECTED,
                          BluetoothProfile.STATE_CONNECTING);
                      break;

                default:
@@ -1240,7 +1240,7 @@ final class HeadsetClientStateMachine extends StateMachine {
                    if (!disconnectNative(getByteAddress(dev))) {
                        // disconnecting failed
                        broadcastConnectionState(dev, BluetoothProfile.STATE_CONNECTED,
                                BluetoothProfile.STATE_DISCONNECTED);
                                BluetoothProfile.STATE_DISCONNECTING);
                        break;
                    }
                    break;