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

Commit 4d85ee6e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6366237 from 840ef774 to mainline-release

Change-Id: I68d9b7a273d31ff01a699150ccc97b5bc17aa7ff
parents 5b6d5945 840ef774
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ public class A2dpSinkStateMachine extends StateMachine {
                                        + " turned off for " + mDevice);
                                mService.disconnectA2dpNative(mDeviceAddress);
                            } else {
                                mConnecting.mIncomingConnection = true;
                                transitionTo(mConnecting);
                            }
                            break;
@@ -190,7 +191,7 @@ public class A2dpSinkStateMachine extends StateMachine {
    }

    class Connecting extends State {
        boolean mIncommingConnection = false;
        boolean mIncomingConnection = false;

        @Override
        public void enter() {
@@ -198,7 +199,7 @@ public class A2dpSinkStateMachine extends StateMachine {
            onConnectionStateChanged(BluetoothProfile.STATE_CONNECTING);
            sendMessageDelayed(CONNECT_TIMEOUT, CONNECT_TIMEOUT_MS);

            if (!mIncommingConnection) {
            if (!mIncomingConnection) {
                mService.connectA2dpNative(mDeviceAddress);
            }

@@ -234,6 +235,7 @@ public class A2dpSinkStateMachine extends StateMachine {
        @Override
        public void exit() {
            removeMessages(CONNECT_TIMEOUT);
            mIncomingConnection = false;
        }

    }
+2 −1
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public class AdapterServiceTest {
    private @Mock IBluetoothCallback mIBluetoothCallback;
    private @Mock Binder mBinder;
    private @Mock AudioManager mAudioManager;
    private @Mock android.app.Application mApplication;

    private static final int CONTEXT_SWITCH_MS = 100;
    private static final int ONE_SECOND_MS = 1000;
@@ -162,7 +163,7 @@ public class AdapterServiceTest {
        when(mMockService2.getName()).thenReturn("Service2");

        // Attach a context to the service for permission checks.
        mAdapterService.attach(mMockContext, null, null, null, null, null);
        mAdapterService.attach(mMockContext, null, null, null, mApplication, null);

        mAdapterService.onCreate();
        mServiceBinder.registerCallback(mIBluetoothCallback);