diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-03-07 19:01:54 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-03-07 19:01:54 +0000 |
commit | bed02b07083eb966abaab6f5dd988f04336bf260 (patch) | |
tree | 83e9a0a76f9df3ca07a5da08ae52b298b2d4f095 /framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java | |
parent | 33267bd87bacba4fab05f3782d3f2920648c6119 (diff) | |
parent | fb679a0e1516a3e0333ee45e8f063d944094c72d (diff) |
Merge "Add implementation for unimplemented APIs and add description for return value"
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java b/framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java index dea0642041..399ffa743c 100644 --- a/framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java +++ b/framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java @@ -109,8 +109,15 @@ public final class BluetoothLeAudioCodecStatus implements Parcelable { * @return {@code true} if the codec config matches, {@code false} otherwise */ public boolean isCodecConfigSelectable(@Nullable BluetoothLeAudioCodecConfig codecConfig) { - // TODO: Add the implementation to check the config is selectable - return true; + if (codecConfig == null) { + return false; + } + for (BluetoothLeAudioCodecConfig selectableConfig : mCodecsSelectableCapabilities) { + if (codecConfig.equals(selectableConfig)) { + return true; + } + } + return false; } /** @@ -171,6 +178,8 @@ public final class BluetoothLeAudioCodecStatus implements Parcelable { /** * Returns the current codec configuration. + * + * @return The current codec config. */ public @Nullable BluetoothLeAudioCodecConfig getCodecConfig() { return mCodecConfig; @@ -178,6 +187,8 @@ public final class BluetoothLeAudioCodecStatus implements Parcelable { /** * Returns the codecs local capabilities. + * + * @return The list of codec config that supported by the local system. */ public @NonNull List<BluetoothLeAudioCodecConfig> getCodecLocalCapabilities() { return (mCodecsLocalCapabilities == null) @@ -186,6 +197,9 @@ public final class BluetoothLeAudioCodecStatus implements Parcelable { /** * Returns the codecs selectable capabilities. + * + * @return The list of codec config that supported by both of the local system and + * remote devices. */ public @NonNull List<BluetoothLeAudioCodecConfig> getCodecSelectableCapabilities() { return (mCodecsSelectableCapabilities == null) |