diff options
| author | Jakub Pawlowski <jpawlowski@google.com> | 2017-03-08 19:09:43 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-03-08 19:09:43 +0000 |
| commit | 7934d71bfd50b52011c6341647cd108bfc953f2a (patch) | |
| tree | 89b543eccd0d668d9549995ca51d3e2ba6271a68 /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | 0136921846c2d39ec396cb185066d226848b1827 (diff) | |
| parent | eed95db01e274d0f22730f9b358dcb52ff832d9f (diff) | |
Merge "Bluetooth 5 feature check API (1/2)"
am: eed95db01e
Change-Id: I59cf0e8f496e6a1201a3a6ec832c33cd1c8972df
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index e71b9687cf..c403487e60 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 |
