summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-10-13 18:36:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-13 18:36:13 +0000
commit8e82755dfdfee837cb73d3db3f6319301d2a5903 (patch)
treeb770bbd4643389562439c2bc5b3ae088235c5c6b /media
parent977fe03b36a7783f9cee8497efe550a69b128473 (diff)
parentaf3e489c1ee3e1017d8aca53a1cf6c683b88ecc2 (diff)
downloadframeworks_base-8e82755dfdfee837cb73d3db3f6319301d2a5903.zip
frameworks_base-8e82755dfdfee837cb73d3db3f6319301d2a5903.tar.gz
frameworks_base-8e82755dfdfee837cb73d3db3f6319301d2a5903.tar.bz2
Merge "BluetoothMidiDevice: change write type to support JamStik" into mnc-dr-dev
Diffstat (limited to 'media')
-rw-r--r--media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java b/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java
index e6d59e4..444705c 100644
--- a/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java
+++ b/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java
@@ -147,14 +147,22 @@ public final class BluetoothMidiDevice {
// switch to receiving notifications after initial characteristic read
mBluetoothGatt.setCharacteristicNotification(characteristic, true);
+ // Use writeType that requests acknowledgement.
+ // This improves compatibility with various BLE-MIDI devices.
+ int originalWriteType = characteristic.getWriteType();
+ characteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT);
+
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(
CLIENT_CHARACTERISTIC_CONFIG);
if (descriptor != null) {
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
- mBluetoothGatt.writeDescriptor(descriptor);
+ boolean result = mBluetoothGatt.writeDescriptor(descriptor);
+ Log.d(TAG, "writeDescriptor returned " + result);
} else {
Log.e(TAG, "No CLIENT_CHARACTERISTIC_CONFIG for device " + mBluetoothDevice);
}
+
+ characteristic.setWriteType(originalWriteType);
}
@Override