diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-01-21 20:11:29 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-01-21 20:11:29 +0000 |
| commit | 6deb66b2718ff1fea66a8ec63b683cbb14ba5fa1 (patch) | |
| tree | 7a442c48d6a6969636b76b6199d8ea0d76d0fc47 /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | 3b832b70be789fb2eb78ebbd7f5192c5ada18ec3 (diff) | |
| parent | 005953a20628dd68413da3766e33903331beb1e8 (diff) | |
Merge "Add broadcast feature supported API" am: 754da27e6e am: 005953a206
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1952563
Change-Id: Icccdbf614dd3d3834f8b1dbcf1b37377686f68a2
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 f94ee8579e..b70d268dee 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; } /** |
