From 0c116e1573184f33883bc3722277ecc6560ebca9 Mon Sep 17 00:00:00 2001 From: Prerepa Viswanadham Date: Wed, 2 Jul 2014 12:30:38 -0700 Subject: [PATCH] Obtain capabilities from chipset for it's support of various features Change-Id: I01bdb31136be63e4e46fb4e054c902eddc5647ab --- .../android/bluetooth/BluetoothAdapter.java | 48 +++++++++++++++++++ core/java/android/bluetooth/IBluetooth.aidl | 4 ++ 2 files changed, 52 insertions(+) diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 22872465b7326..d75304feefe70 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1038,6 +1038,54 @@ public final class BluetoothAdapter { return false; } + /** + * Return true if the multi advertisement is supported by the chipset + * + * @hide + * @return true if Multiple Advertisement feature is supported + */ + public boolean isMultipleAdvertisementSupported() { + if (getState() != STATE_ON) return false; + try { + return mService.isMultiAdvertisementSupported(); + } catch (RemoteException e) { + Log.e(TAG, "failed to get isMultipleAdvertisementSupported, error: ", e); + } + return false; + } + + /** + * Return true if offloaded filters are supported + * + * @hide + * @return true if chipset supports on-chip filtering + */ + public boolean isOffloadedFilteringSupported() { + if (getState() != STATE_ON) return false; + try { + return mService.isOffloadedFilteringSupported(); + } catch (RemoteException e) { + Log.e(TAG, "failed to get isOffloadedFilteringSupported, error: ", e); + } + return false; + } + + /** + * Return true if offloaded scan batching is supported + * + * @hide + * @return true if chipset supports on-chip scan batching + */ + public boolean isOffloadedScanBatchingSupported() { + if (getState() != STATE_ON) return false; + try { + return mService.isOffloadedScanBatchingSupported(); + } catch (RemoteException e) { + Log.e(TAG, "failed to get isOffloadedScanBatchingSupported, error: ", e); + } + return false; + } + /** * Returns whether BLE is currently advertising. *

Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}. diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl index df6037ecc5fcd..d334b9193c203 100644 --- a/core/java/android/bluetooth/IBluetooth.aidl +++ b/core/java/android/bluetooth/IBluetooth.aidl @@ -84,4 +84,8 @@ interface IBluetooth ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag); boolean configHciSnoopLog(boolean enable); + + boolean isMultiAdvertisementSupported(); + boolean isOffloadedFilteringSupported(); + boolean isOffloadedScanBatchingSupported(); }