diff options
author | Etienne Ruffieux <eruffieux@google.com> | 2022-02-25 00:10:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-02-25 00:10:47 +0000 |
commit | 1b685804ab09deababf7a6b3ccff5dd79834171e (patch) | |
tree | 3a39d8467036b36f614498ec6e52e440bfb77580 /framework/java/android/bluetooth/BluetoothCodecConfig.java | |
parent | 1610c7c18d9d00a4ed50337d5db20db477704880 (diff) | |
parent | 4d1eabb0c7bbd3daec9fb794b689390dbc208c77 (diff) |
Merge "Removed getMaxCodecType and made getcodecName static"
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothCodecConfig.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothCodecConfig.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/framework/java/android/bluetooth/BluetoothCodecConfig.java b/framework/java/android/bluetooth/BluetoothCodecConfig.java index 098605b799..91e234aaaf 100644 --- a/framework/java/android/bluetooth/BluetoothCodecConfig.java +++ b/framework/java/android/bluetooth/BluetoothCodecConfig.java @@ -84,8 +84,7 @@ public final class BluetoothCodecConfig implements Parcelable { public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000; /** - * Represents the count of valid source codec types. Can be accessed via - * {@link #getMaxCodecType}. + * Represents the count of valid source codec types. */ private static final int SOURCE_CODEC_TYPE_MAX = 6; @@ -390,7 +389,7 @@ public final class BluetoothCodecConfig implements Parcelable { channelModeStr = appendCapabilityToString(channelModeStr, "STEREO"); } - return "{codecName:" + getCodecName() + return "{codecName:" + getCodecName(mCodecType) + ",mCodecType:" + mCodecType + ",mCodecPriority:" + mCodecPriority + ",mSampleRate:" + String.format("0x%x", mSampleRate) @@ -450,8 +449,8 @@ public final class BluetoothCodecConfig implements Parcelable { * Returns the codec name converted to {@link String}. * @hide */ - public @NonNull String getCodecName() { - switch (mCodecType) { + public static @NonNull String getCodecName(@SourceCodecType int codecType) { + switch (codecType) { case SOURCE_CODEC_TYPE_SBC: return "SBC"; case SOURCE_CODEC_TYPE_AAC: @@ -469,7 +468,7 @@ public final class BluetoothCodecConfig implements Parcelable { default: break; } - return "UNKNOWN CODEC(" + mCodecType + ")"; + return "UNKNOWN CODEC(" + codecType + ")"; } /** @@ -480,13 +479,6 @@ public final class BluetoothCodecConfig implements Parcelable { } /** - * Returns the valid codec types count. - */ - public static int getMaxCodecType() { - return SOURCE_CODEC_TYPE_MAX; - } - - /** * Checks whether the codec is mandatory. * <p> The actual mandatory codec type for Android Bluetooth audio is SBC. * See {@link #SOURCE_CODEC_TYPE_SBC}. |