Loading android/app/src/com/android/bluetooth/bass_client/BassClientStateMachine.java +6 −1 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class BassClientStateMachine extends StateMachine { private boolean mForceSB = false; private int mBroadcastSourceIdLength = 3; private byte mNextSourceId = 0; private boolean mAllowReconnect = false; BluetoothGatt mBluetoothGatt = null; BluetoothGattCallback mGattCallback = null; Loading Loading @@ -1080,7 +1081,7 @@ public class BassClientStateMachine extends StateMachine { mDevice, mLastConnectionState, BluetoothProfile.STATE_DISCONNECTED); if (mLastConnectionState != BluetoothProfile.STATE_DISCONNECTED) { // Reconnect in background if not disallowed by the service if (mService.okToConnect(mDevice)) { if (mService.okToConnect(mDevice) && mAllowReconnect) { connectGatt(false); } } Loading @@ -1107,6 +1108,7 @@ public class BassClientStateMachine extends StateMachine { mBluetoothGatt.close(); mBluetoothGatt = null; } mAllowReconnect = true; if (connectGatt(mIsAllowedList)) { transitionTo(mConnecting); } else { Loading @@ -1115,6 +1117,7 @@ public class BassClientStateMachine extends StateMachine { break; case DISCONNECT: // Disconnect if there's an ongoing background connection mAllowReconnect = false; if (mBluetoothGatt != null) { log("Cancelling the background connection to " + mDevice); mBluetoothGatt.disconnect(); Loading Loading @@ -1473,6 +1476,7 @@ public class BassClientStateMachine extends StateMachine { break; case DISCONNECT: log("Disconnecting from " + mDevice); mAllowReconnect = false; if (mBluetoothGatt != null) { mBluetoothGatt.disconnect(); mBluetoothGatt.close(); Loading Loading @@ -1735,6 +1739,7 @@ public class BassClientStateMachine extends StateMachine { break; case DISCONNECT: Log.w(TAG, "DISCONNECT requested!: " + mDevice); mAllowReconnect = false; if (mBluetoothGatt != null) { mBluetoothGatt.disconnect(); mBluetoothGatt.close(); Loading Loading
android/app/src/com/android/bluetooth/bass_client/BassClientStateMachine.java +6 −1 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class BassClientStateMachine extends StateMachine { private boolean mForceSB = false; private int mBroadcastSourceIdLength = 3; private byte mNextSourceId = 0; private boolean mAllowReconnect = false; BluetoothGatt mBluetoothGatt = null; BluetoothGattCallback mGattCallback = null; Loading Loading @@ -1080,7 +1081,7 @@ public class BassClientStateMachine extends StateMachine { mDevice, mLastConnectionState, BluetoothProfile.STATE_DISCONNECTED); if (mLastConnectionState != BluetoothProfile.STATE_DISCONNECTED) { // Reconnect in background if not disallowed by the service if (mService.okToConnect(mDevice)) { if (mService.okToConnect(mDevice) && mAllowReconnect) { connectGatt(false); } } Loading @@ -1107,6 +1108,7 @@ public class BassClientStateMachine extends StateMachine { mBluetoothGatt.close(); mBluetoothGatt = null; } mAllowReconnect = true; if (connectGatt(mIsAllowedList)) { transitionTo(mConnecting); } else { Loading @@ -1115,6 +1117,7 @@ public class BassClientStateMachine extends StateMachine { break; case DISCONNECT: // Disconnect if there's an ongoing background connection mAllowReconnect = false; if (mBluetoothGatt != null) { log("Cancelling the background connection to " + mDevice); mBluetoothGatt.disconnect(); Loading Loading @@ -1473,6 +1476,7 @@ public class BassClientStateMachine extends StateMachine { break; case DISCONNECT: log("Disconnecting from " + mDevice); mAllowReconnect = false; if (mBluetoothGatt != null) { mBluetoothGatt.disconnect(); mBluetoothGatt.close(); Loading Loading @@ -1735,6 +1739,7 @@ public class BassClientStateMachine extends StateMachine { break; case DISCONNECT: Log.w(TAG, "DISCONNECT requested!: " + mDevice); mAllowReconnect = false; if (mBluetoothGatt != null) { mBluetoothGatt.disconnect(); mBluetoothGatt.close(); Loading