From 4d1eabb0c7bbd3daec9fb794b689390dbc208c77 Mon Sep 17 00:00:00 2001 From: Etienne Ruffieux Date: Tue, 8 Feb 2022 13:11:27 +0000 Subject: Removed getMaxCodecType and made getcodecName static Bug: 218311980 Test: manual Tag: #feature Change-Id: Ic587d1838bed51bb6d758b14faf0a334ec24e444 --- .../java/android/bluetooth/BluetoothCodecConfig.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'framework/java/android/bluetooth/BluetoothCodecConfig.java') diff --git a/framework/java/android/bluetooth/BluetoothCodecConfig.java b/framework/java/android/bluetooth/BluetoothCodecConfig.java index 2ee171b996..59eabbcf34 100644 --- a/framework/java/android/bluetooth/BluetoothCodecConfig.java +++ b/framework/java/android/bluetooth/BluetoothCodecConfig.java @@ -83,8 +83,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; @@ -389,7 +388,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) @@ -449,8 +448,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: @@ -468,7 +467,7 @@ public final class BluetoothCodecConfig implements Parcelable { default: break; } - return "UNKNOWN CODEC(" + mCodecType + ")"; + return "UNKNOWN CODEC(" + codecType + ")"; } /** @@ -478,13 +477,6 @@ public final class BluetoothCodecConfig implements Parcelable { return mCodecType; } - /** - * Returns the valid codec types count. - */ - public static int getMaxCodecType() { - return SOURCE_CODEC_TYPE_MAX; - } - /** * Checks whether the codec is mandatory. *

The actual mandatory codec type for Android Bluetooth audio is SBC. -- cgit v1.2.3