diff options
author | Jakub Pawlowski <jpawlowski@google.com> | 2017-03-30 19:10:08 -0700 |
---|---|---|
committer | Jakub Pawlowski <jpawlowski@google.com> | 2017-04-01 04:34:40 +0000 |
commit | 89268ba576c2ee0f290e28b5710c1f69aff0a953 (patch) | |
tree | d203189180ca3780919c1819b32b0e46e2e4cead /framework/java/android/bluetooth/le/AdvertisingSet.java | |
parent | c4844e9aa4b524cb6bab4d502365b1a1dd1246dd (diff) |
Bluetooth 5 advertising duration refactoring (4/4)
Expose both duration and maximum extended advertising events to limit
advertising time.
Test: manual
Bug: 30622771
Change-Id: I44df300995ef985526b93f8c24389775720b3432
Diffstat (limited to 'framework/java/android/bluetooth/le/AdvertisingSet.java')
-rw-r--r-- | framework/java/android/bluetooth/le/AdvertisingSet.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/framework/java/android/bluetooth/le/AdvertisingSet.java b/framework/java/android/bluetooth/le/AdvertisingSet.java index d6991bf876..51571b2746 100644 --- a/framework/java/android/bluetooth/le/AdvertisingSet.java +++ b/framework/java/android/bluetooth/le/AdvertisingSet.java @@ -63,11 +63,18 @@ public final class AdvertisingSet { * Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} * * @param enable whether the advertising should be enabled (true), or disabled (false) - * @param timeoutMillis duration for which that advertising set is enabled. + * @param duration advertising duration, in 10ms unit. Valid range is from 1 (10ms) to + * 65535 (655,350 ms) + * @param maxExtendedAdvertisingEvents maximum number of extended advertising events the + * controller shall attempt to send prior to terminating the extended + * advertising, even if the duration has not expired. Valid range is + * from 1 to 255. */ - public void enableAdvertising(boolean enable, int timeout) { + public void enableAdvertising(boolean enable, int duration, + int maxExtendedAdvertisingEvents) { try { - gatt.enableAdvertisingSet(this.advertiserId, enable, timeout); + gatt.enableAdvertisingSet(this.advertiserId, enable, duration, + maxExtendedAdvertisingEvents); } catch (RemoteException e) { Log.e(TAG, "remote exception - ", e); } |