diff options
| author | Alice Kuo <aliceypkuo@google.com> | 2022-01-19 22:28:36 +0800 |
|---|---|---|
| committer | Alice Kuo <aliceypkuo@google.com> | 2022-01-20 13:05:19 +0800 |
| commit | d542a97765592029959002b8ea00093796e394fb (patch) | |
| tree | 292f5570084a7d73aee322d41eb1f0a1cc2224c8 /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | b39256939dac2b6d99c54e79185bd0f32873ca00 (diff) | |
Add the broadcast feature supported APIs
Expose isLeAudioBroadcastSourceSupported and isLeAudioBroadcastAssistantSupported APIs. It would just check the controller capabilities for now, and plan to check the profile enable status later.
Ignore-AOSP-First: Fix merge conflict
Bug: 150670922
Bug: 208368819
Test: make build
Change-Id: Ic68a19575e09dc8cf525c28afaca92ea44158981
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 65 |
1 files changed, 45 insertions, 20 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 661291c6f1..28d7aaf994 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -2303,29 +2303,54 @@ public final class BluetoothAdapter { } /** - * Returns {@link BluetoothStatusCodes#FEATURE_SUPPORTED} if LE Periodic Advertising Sync - * Transfer Sender feature is supported, - * {@link BluetoothStatusCodes#FEATURE_NOT_SUPPORTED} if the feature is not supported, or - * an error code + * Returns {@link BluetoothStatusCodes#FEATURE_SUPPORTED} if the LE audio broadcast source + * feature is supported, {@link BluetoothStatusCodes#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#FEATURE_SUPPORTED} if the LE audio broadcast assistant + * feature is supported, {@link BluetoothStatusCodes#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; } /** |
