summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stanley Tng <stng@google.com> 2018-02-03 04:10:22 +0000
committer android-build-merger <android-build-merger@google.com> 2018-02-03 04:10:22 +0000
commitc3afcfc38cc8cc29f35c8eaeaf79e8f58136f9af (patch)
treede08e26a6cd8c0eee26a19606526631b00759c1c
parenta21fa41755feb1068d28e42094682cf71a07e5ae (diff)
parent853628db726caf4109bb116aec2e6defe5b1b49d (diff)
Merge "Add function to update LE connection parameters"
am: 853628db72 Change-Id: I7a6a653fa9d007a71e5155180fc8e78289ad9b81
-rw-r--r--core/java/android/bluetooth/BluetoothGatt.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index a2af3422eaec..3df433643b00 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -1507,6 +1507,38 @@ public final class BluetoothGatt implements BluetoothProfile {
}
/**
+ * Request an LE connection parameter update.
+ *
+ * <p>This function will send an LE connection parameters update request to the remote device.
+ *
+ * @return true, if the request is send to the Bluetooth stack.
+ * @hide
+ */
+ public boolean requestLeConnectionUpdate(int minConnectionInterval,
+ int maxConnectionInterval,
+ int slaveLatency, int supervisionTimeout) {
+ if (DBG) {
+ Log.d(TAG, "requestLeConnectionUpdate() - min=(" + minConnectionInterval
+ + ")" + (1.25 * minConnectionInterval)
+ + "msec, max=(" + maxConnectionInterval + ")"
+ + (1.25 * maxConnectionInterval) + "msec, latency=" + slaveLatency
+ + ", timeout=" + supervisionTimeout + "msec");
+ }
+ if (mService == null || mClientIf == 0) return false;
+
+ try {
+ mService.leConnectionUpdate(mClientIf, mDevice.getAddress(),
+ minConnectionInterval, maxConnectionInterval,
+ slaveLatency, supervisionTimeout);
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
* Not supported - please use {@link BluetoothManager#getConnectedDevices(int)}
* with {@link BluetoothProfile#GATT} as argument
*