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

Commit d3d16bd3 authored by Mallikarjuna GB's avatar Mallikarjuna GB Committed by android-build-merger
Browse files

Merge "Properly update profile connection state" am: f0bf4968

am: a134983d

Change-Id: Idc977fe84565c5796510601600ddc0dcb9197213
parents f40e9644 a134983d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -625,6 +625,10 @@ final class A2dpStateMachine extends StateMachine {
                        broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED,
                                       BluetoothProfile.STATE_CONNECTING);
                        break;
                    } else {
                        broadcastConnectionState(mCurrentDevice,
                                BluetoothProfile.STATE_DISCONNECTING,
                                BluetoothProfile.STATE_CONNECTED);
                    }

                    synchronized (A2dpStateMachine.this) {
@@ -643,7 +647,7 @@ final class A2dpStateMachine extends StateMachine {
                                   BluetoothProfile.STATE_CONNECTED);
                    if (!disconnectA2dpNative(getByteAddress(device))) {
                        broadcastConnectionState(device, BluetoothProfile.STATE_CONNECTED,
                                       BluetoothProfile.STATE_DISCONNECTED);
                                BluetoothProfile.STATE_DISCONNECTING);
                        break;
                    }
                    synchronized (A2dpStateMachine.this) {
+12 −3
Original line number Diff line number Diff line
@@ -503,15 +503,24 @@ class AdapterProperties {
    private boolean updateCountersAndCheckForConnectionStateChange(int state, int prevState) {
        switch (prevState) {
            case BluetoothProfile.STATE_CONNECTING:
                if (mProfilesConnecting > 0)
                    mProfilesConnecting--;
                else
                    Log.e(TAG, "mProfilesConnecting " + mProfilesConnecting);
                break;

            case BluetoothProfile.STATE_CONNECTED:
                if (mProfilesConnected > 0)
                    mProfilesConnected--;
                else
                    Log.e(TAG, "mProfilesConnected " + mProfilesConnected);
                break;

            case BluetoothProfile.STATE_DISCONNECTING:
                if (mProfilesDisconnecting > 0)
                    mProfilesDisconnecting--;
                else
                    Log.e(TAG, "mProfilesDisconnecting " + mProfilesDisconnecting);
                break;
        }

+4 −0
Original line number Diff line number Diff line
@@ -753,6 +753,10 @@ final class HeadsetStateMachine extends StateMachine {
                    if (mConnectedDevicesList.contains(device)) {
                        Log.w(TAG, "Connected: CONNECT, device " + device + " is connected");
                        break;
                    } else {
                        broadcastConnectionState(mCurrentDevice,
                                BluetoothProfile.STATE_DISCONNECTING,
                                BluetoothProfile.STATE_CONNECTED);
                    }
                    if (mConnectedDevicesList.size() >= max_hf_connections) {
                        BluetoothDevice DisconnectConnectedDevice = null;