Suppress notifyCharacteristicChanged deprecation warnings
The deprecation itself is already handled, and suppressing the warning is sufficient. For suppression the code using the old API is isolated into its own function. Pick-to: 6.9 6.8 6.5 Task-number: QTBUG-132455 Change-Id: I39cae1187d3bf88850fc340f60155d807dd6e4e5 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
This commit is contained in:
parent
8c9ce93271
commit
432a082ed3
|
@ -806,6 +806,15 @@ class QtBluetoothLEServer {
|
|||
}
|
||||
}
|
||||
|
||||
// API-level < 33
|
||||
@SuppressWarnings("deprecation")
|
||||
private void notifyCharacteristicChange(BluetoothDevice device,
|
||||
BluetoothGattCharacteristic characteristic,
|
||||
boolean confirm)
|
||||
{
|
||||
mGattServer.notifyCharacteristicChanged(device, characteristic, confirm);
|
||||
}
|
||||
|
||||
/*
|
||||
Check the client characteristics configuration for the given characteristic
|
||||
and sends notifications or indications as per required.
|
||||
|
@ -832,7 +841,7 @@ class QtBluetoothLEServer {
|
|||
mGattServer.notifyCharacteristicChanged(device, characteristic, false,
|
||||
((QtBluetoothGattCharacteristic)characteristic).getLocalValue());
|
||||
} else {
|
||||
mGattServer.notifyCharacteristicChanged(device, characteristic, false);
|
||||
notifyCharacteristicChange(device, characteristic, false);
|
||||
}
|
||||
} else if (Arrays.equals(clientCharacteristicConfig,
|
||||
BluetoothGattDescriptor.ENABLE_INDICATION_VALUE)) {
|
||||
|
@ -840,7 +849,7 @@ class QtBluetoothLEServer {
|
|||
mGattServer.notifyCharacteristicChanged(device, characteristic, true,
|
||||
((QtBluetoothGattCharacteristic)characteristic).getLocalValue());
|
||||
} else {
|
||||
mGattServer.notifyCharacteristicChanged(device, characteristic, true);
|
||||
notifyCharacteristicChange(device, characteristic, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue