When communicating with my BLE device onCharacteristicChanged
is trigged as expected for all versions of android prior to Android N. The issue is seen only on Android N.
For Android N onCharacteristicChanged
is never triggered. Is there something that has changed in the way BluetoothGattCallback
behaves on Android Nougat?
Initialization of descriptor:
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(MyDeviceUuid.CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID);
if (descriptor != null) {
descriptor.setValue(enable ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE);
mBluetoothGatt.writeDescriptor(descriptor);
}