diff options
| author | Wei Wang <weiwa@google.com> | 2014-05-20 06:30:20 +0000 |
|---|---|---|
| committer | Wei Wang <weiwa@google.com> | 2014-05-19 23:52:45 -0700 |
| commit | b464cfd7ac9eb108f89356a3764a6dfe247ce3b6 (patch) | |
| tree | 4194566688013e934da5ed0145a2897b8c9e626c /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | 39eb6801bb37a327a7460d9c830571448de19319 (diff) | |
Revert "Revert "APIs for BLE scan, scan filter, batch scan, onFound/onLost and multiple advertising.""
This reverts commit b1d9fbc0f8dea0c77ed810190b325bfdaaf21789.
Change-Id: Ic8dec9385a7c763170ebeb1bcddd221c72f46e88
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index e79deeccbd..9e1c995bbb 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -498,6 +498,34 @@ public final class BluetoothAdapter { } /** + * Returns a {@link BluetoothLeAdvertiser} object for Bluetooth LE Advertising operations. + */ + public BluetoothLeAdvertiser getBluetoothLeAdvertiser() { + // TODO: Return null if this feature is not supported by hardware. + try { + IBluetoothGatt iGatt = mManagerService.getBluetoothGatt(); + return new BluetoothLeAdvertiser(iGatt); + } catch (RemoteException e) { + Log.e(TAG, "failed to get BluetoothLeAdvertiser, error: " + e); + return null; + } + } + + /** + * Returns a {@link BluetoothLeScanner} object for Bluetooth LE scan operations. + */ + public BluetoothLeScanner getBluetoothLeScanner() { + // TODO: Return null if BLE scan is not supported by hardware. + try { + IBluetoothGatt iGatt = mManagerService.getBluetoothGatt(); + return new BluetoothLeScanner(iGatt); + } catch (RemoteException e) { + Log.e(TAG, "failed to get BluetoothLeScanner, error: " + e); + return null; + } + } + + /** * Interface for BLE advertising callback. * * @hide @@ -2024,6 +2052,10 @@ public final class BluetoothAdapter { } } + @Override + public void onMultiAdvertiseCallback(int status) { + // no op + } /** * Callback reporting LE ATT MTU. * @hide |
