aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2017-02-07 18:05:39 -0800
committerAndre Eisenbach <eisenbach@google.com>2017-03-08 18:20:03 +0000
commit60d90308de61d0a54605829a0328b8d34670c6ba (patch)
treecff568b9d26693a4a8ac48310472d88a1be6e1e9 /framework/java/android/bluetooth/BluetoothAdapter.java
parent0849d40e0b2c0f91ac5c161f672c4f17d424eec0 (diff)
Bluetooth 5 feature check API (1/2)
Bug: 30622771 Test: manual Change-Id: I90e2efe989745c07c2f2fb8f4ea5bc3b718382f6 (cherry picked from commit 79d66495c32996a5b532328571bf6ceecca70ca5)
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java72
1 files changed, 72 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index dbc25afcd0..4ecf1249d1 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -1385,6 +1385,78 @@ public final class BluetoothAdapter {
}
/**
+ * Return true if LE 2M PHY feature is supported.
+ *
+ * @return true if chipset supports LE 2M PHY feature
+ */
+ public boolean isLe2MPhySupported() {
+ if (!getLeAccess()) return false;
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) return mService.isLe2MPhySupported();
+ } catch (RemoteException e) {
+ Log.e(TAG, "failed to get isExtendedAdvertisingSupported, error: ", e);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ return false;
+ }
+
+ /**
+ * Return true if LE Coded PHY feature is supported.
+ *
+ * @return true if chipset supports LE Coded PHY feature
+ */
+ public boolean isLeCodedPhySupported() {
+ if (!getLeAccess()) return false;
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) return mService.isLeCodedPhySupported();
+ } catch (RemoteException e) {
+ Log.e(TAG, "failed to get isLeCodedPhySupported, error: ", e);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ return false;
+ }
+
+ /**
+ * Return true if LE Periodic Advertising feature is supported.
+ *
+ * @return true if chipset supports LE Periodic Advertising feature
+ */
+ public boolean isLeExtendedAdvertisingSupported() {
+ if (!getLeAccess()) return false;
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) return mService.isLeExtendedAdvertisingSupported();
+ } catch (RemoteException e) {
+ Log.e(TAG, "failed to get isLeExtendedAdvertisingSupported, error: ", e);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ return false;
+ }
+
+ /**
+ * Return true if LE Periodic Advertising feature is supported.
+ *
+ * @return true if chipset supports LE Periodic Advertising feature
+ */
+ public boolean isLePeriodicAdvertisingSupported() {
+ if (!getLeAccess()) return false;
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) return mService.isLePeriodicAdvertisingSupported();
+ } catch (RemoteException e) {
+ Log.e(TAG, "failed to get isLePeriodicAdvertisingSupported, error: ", e);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ return false;
+ }
+
+ /**
* Return true if hardware has entries available for matching beacons
*
* @return true if there are hw entries available for matching beacons