mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-22 17:04:23 +01:00
Bug fixed: close() should not change value of mUserDisconnected flag
In case of an error it may happen that the service is destroyed (and will call close()) before the onConnectionChange(..) callback finishes. By setting this flag to false in close() the onLinklossOccur callback may be called instead of onDeviceDisconnected.
This commit is contained in:
@@ -155,7 +155,6 @@ public abstract class BleManager<E extends BleManagerCallbacks> {
|
|||||||
public BleManager(final Context context) {
|
public BleManager(final Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mHandler = new Handler();
|
mHandler = new Handler();
|
||||||
mUserDisconnected = false;
|
|
||||||
|
|
||||||
// Register bonding broadcast receiver
|
// Register bonding broadcast receiver
|
||||||
context.registerReceiver(mBondingBroadcastReceiver, new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED));
|
context.registerReceiver(mBondingBroadcastReceiver, new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED));
|
||||||
@@ -256,7 +255,6 @@ public abstract class BleManager<E extends BleManagerCallbacks> {
|
|||||||
mBluetoothGatt = null;
|
mBluetoothGatt = null;
|
||||||
}
|
}
|
||||||
mBluetoothDevice = null;
|
mBluetoothDevice = null;
|
||||||
mUserDisconnected = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user