mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-22 00:44:26 +01:00
Clearing the task queues on disconnection
This commit is contained in:
@@ -1182,6 +1182,8 @@ public abstract class BleManager<E extends BleManagerCallbacks> implements ILogg
|
|||||||
Logger.w(mLogSession, "Error: (0x" + Integer.toHexString(status) + "): " + GattError.parseConnectionError(status));
|
Logger.w(mLogSession, "Error: (0x" + Integer.toHexString(status) + "): " + GattError.parseConnectionError(status));
|
||||||
|
|
||||||
mOperationInProgress = true; // no more calls are possible
|
mOperationInProgress = true; // no more calls are possible
|
||||||
|
mInitQueue.clear();
|
||||||
|
mTaskQueue.clear();
|
||||||
if (mConnected) {
|
if (mConnected) {
|
||||||
notifyDeviceDisconnected(gatt.getDevice());
|
notifyDeviceDisconnected(gatt.getDevice());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -611,6 +611,8 @@ public class BleManager implements BleProfileApi {
|
|||||||
} else {
|
} else {
|
||||||
if (newState == BluetoothProfile.STATE_DISCONNECTED) {
|
if (newState == BluetoothProfile.STATE_DISCONNECTED) {
|
||||||
mOperationInProgress = true; // no more calls are possible
|
mOperationInProgress = true; // no more calls are possible
|
||||||
|
mInitQueue.clear();
|
||||||
|
mTaskQueue.clear();
|
||||||
if (mConnected) {
|
if (mConnected) {
|
||||||
notifyDeviceDisconnected(gatt.getDevice());
|
notifyDeviceDisconnected(gatt.getDevice());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user