diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-08 02:08:28 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-08 02:08:28 +0000 |
commit | 22389fee67a014fed221aadadcfbc1dc9cd7335f (patch) | |
tree | 24b5864c0fccfd1ae7549e3616dbc5ee1aa5bafb /framework/java/android/bluetooth/BluetoothLeAudioCodecStatus.java | |
parent | 4739b8feb4c2a5becbb584b1f62f0e5321079d17 (diff) | |
parent | c4c4f9227fb198e838b5b7de5d1a048f2d3a0c52 (diff) |
Snap for 8270536 from c4c4f9227fb198e838b5b7de5d1a048f2d3a0c52 to tm-release
Change-Id: I11136ce6eeaed10d012ef29fb7c081cbc5c1ced2
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) |