[bluetooth.bluez] Fix the unpairing of all devices on binding disposal (#9011)
Signed-off-by: Benjamin Lafois <benjamin.lafois@gmail.com>
This commit is contained in:
parent
821a84067a
commit
2730bc8a2e
@ -120,6 +120,10 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv
|
|||||||
public void dispose() {
|
public void dispose() {
|
||||||
BluetoothDevice dev = device;
|
BluetoothDevice dev = device;
|
||||||
if (dev != null) {
|
if (dev != null) {
|
||||||
|
if (Boolean.TRUE.equals(dev.isPaired())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dev.getAdapter().removeDevice(dev.getRawDevice());
|
dev.getAdapter().removeDevice(dev.getRawDevice());
|
||||||
} catch (DBusException ex) {
|
} catch (DBusException ex) {
|
||||||
@ -359,8 +363,10 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv
|
|||||||
}
|
}
|
||||||
BluetoothCharacteristic c = getCharacteristic(UUID.fromString(characteristic.getUuid()));
|
BluetoothCharacteristic c = getCharacteristic(UUID.fromString(characteristic.getUuid()));
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
c.setValue(event.getData());
|
synchronized (c) {
|
||||||
notifyListeners(BluetoothEventType.CHARACTERISTIC_UPDATED, c, BluetoothCompletionStatus.SUCCESS);
|
c.setValue(event.getData());
|
||||||
|
notifyListeners(BluetoothEventType.CHARACTERISTIC_UPDATED, c, BluetoothCompletionStatus.SUCCESS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user