Loading android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkStateMachine.java +3 −23 Original line number Original line Diff line number Diff line Loading @@ -304,7 +304,7 @@ public class A2dpSinkStateMachine extends StateMachine { boolean retValue = HANDLED; boolean retValue = HANDLED; switch (message.what) { switch (message.what) { case CONNECT: case CONNECT: deferMessage(message); logd("Disconnect before connecting to another target"); break; break; case CONNECT_TIMEOUT: case CONNECT_TIMEOUT: onConnectionStateChanged(getByteAddress(mTargetDevice), onConnectionStateChanged(getByteAddress(mTargetDevice), Loading @@ -320,8 +320,6 @@ public class A2dpSinkStateMachine extends StateMachine { synchronized (A2dpSinkStateMachine.this) { synchronized (A2dpSinkStateMachine.this) { mTargetDevice = null; mTargetDevice = null; } } } else { deferMessage(message); } } break; break; case STACK_EVENT: case STACK_EVENT: Loading Loading @@ -516,26 +514,8 @@ public class A2dpSinkStateMachine extends StateMachine { } } switch (message.what) { switch (message.what) { case CONNECT: { case CONNECT: BluetoothDevice device = (BluetoothDevice) message.obj; logd("Disconnect before connecting to another target"); if (mCurrentDevice.equals(device)) { break; } broadcastConnectionState(device, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); if (!disconnectA2dpNative(getByteAddress(mCurrentDevice))) { broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); break; } synchronized (A2dpSinkStateMachine.this) { mTargetDevice = device; mStreaming.obtainMessage(A2dpSinkStreamHandler.DISCONNECT).sendToTarget(); transitionTo(mPending); } } break; break; case DISCONNECT: { case DISCONNECT: { Loading Loading
android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkStateMachine.java +3 −23 Original line number Original line Diff line number Diff line Loading @@ -304,7 +304,7 @@ public class A2dpSinkStateMachine extends StateMachine { boolean retValue = HANDLED; boolean retValue = HANDLED; switch (message.what) { switch (message.what) { case CONNECT: case CONNECT: deferMessage(message); logd("Disconnect before connecting to another target"); break; break; case CONNECT_TIMEOUT: case CONNECT_TIMEOUT: onConnectionStateChanged(getByteAddress(mTargetDevice), onConnectionStateChanged(getByteAddress(mTargetDevice), Loading @@ -320,8 +320,6 @@ public class A2dpSinkStateMachine extends StateMachine { synchronized (A2dpSinkStateMachine.this) { synchronized (A2dpSinkStateMachine.this) { mTargetDevice = null; mTargetDevice = null; } } } else { deferMessage(message); } } break; break; case STACK_EVENT: case STACK_EVENT: Loading Loading @@ -516,26 +514,8 @@ public class A2dpSinkStateMachine extends StateMachine { } } switch (message.what) { switch (message.what) { case CONNECT: { case CONNECT: BluetoothDevice device = (BluetoothDevice) message.obj; logd("Disconnect before connecting to another target"); if (mCurrentDevice.equals(device)) { break; } broadcastConnectionState(device, BluetoothProfile.STATE_CONNECTING, BluetoothProfile.STATE_DISCONNECTED); if (!disconnectA2dpNative(getByteAddress(mCurrentDevice))) { broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); break; } synchronized (A2dpSinkStateMachine.this) { mTargetDevice = device; mStreaming.obtainMessage(A2dpSinkStreamHandler.DISCONNECT).sendToTarget(); transitionTo(mPending); } } break; break; case DISCONNECT: { case DISCONNECT: { Loading