diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-01-21 20:41:23 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-01-21 20:41:23 +0000 |
| commit | 16d3ae7ce5c22d447382281fe30d8976877c06df (patch) | |
| tree | 3258092321438918d571bf77653d334d786f78e3 /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | ddff074b0bd3d8a5f2b44d3c8161441ea99e8e97 (diff) | |
| parent | 6deb66b2718ff1fea66a8ec63b683cbb14ba5fa1 (diff) | |
Merge "Add broadcast feature supported API" am: 754da27e6e am: 005953a206 am: 6deb66b271
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1952563
Change-Id: I234cf2b39a6fdd597bb33603a2021c3115176fae
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 64 |
1 files changed, 45 insertions, 19 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index ecbad5d60e..fef305950d 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -2325,28 +2325,54 @@ public final class BluetoothAdapter { } /** - * Returns {@link BluetoothStatusCodes#SUCCESS} if LE Periodic Advertising Sync Transfer Sender - * feature is supported, returns {@link BluetoothStatusCodes#ERROR_FEATURE_NOT_SUPPORTED} if the - * feature is not supported or an error code + * Returns {@link BluetoothStatusCodes#SUCCESS} if the LE audio broadcast source + * feature is supported, {@link BluetoothStatusCodes#ERROR_FEATURE_NOT_SUPPORTED} if the + * feature is not supported, or an error code. * - * @return whether the chipset supports the LE Periodic Advertising Sync Transfer Sender feature + * @return whether the LE audio broadcast source is supported */ @RequiresNoPermission - public @LeFeatureReturnValues int isLePeriodicAdvertisingSyncTransferSenderSupported() { - if (!getLeAccess()) { - return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; - } - try { - mServiceLock.readLock().lock(); - if (mService != null) { - return mService.isLePeriodicAdvertisingSyncTransferSenderSupported(); - } - } catch (RemoteException e) { - e.rethrowFromSystemServer(); - } finally { - mServiceLock.readLock().unlock(); - } - return BluetoothStatusCodes.ERROR_UNKNOWN; + public @LeFeatureReturnValues int isLeAudioBroadcastSourceSupported() { + if (!getLeAccess()) { + return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; + } + try { + mServiceLock.readLock().lock(); + if (mService != null) { + return mService.isLeAudioBroadcastSourceSupported(); + } + } catch (RemoteException e) { + e.rethrowFromSystemServer(); + } finally { + mServiceLock.readLock().unlock(); + } + + return BluetoothStatusCodes.ERROR_UNKNOWN; + } + + /** + * Returns {@link BluetoothStatusCodes#SUCCESS} if the LE audio broadcast assistant + * feature is supported, {@link BluetoothStatusCodes#ERROR_FEATURE_NOT_SUPPORTED} if the + * feature is not supported, or an error code. + * + * @return whether the LE audio broadcast assistent is supported + */ + @RequiresNoPermission + public @LeFeatureReturnValues int isLeAudioBroadcastAssistantSupported() { + if (!getLeAccess()) { + return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; + } + try { + mServiceLock.readLock().lock(); + if (mService != null) { + return mService.isLeAudioBroadcastAssistantSupported(); + } + } catch (RemoteException e) { + e.rethrowFromSystemServer(); + } finally { + mServiceLock.readLock().unlock(); + } + return BluetoothStatusCodes.ERROR_UNKNOWN; } /** |
