Loading android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +2 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ class A2dpCodecConfig { void enableOptionalCodecs(BluetoothDevice device, BluetoothCodecConfig currentCodecConfig) { if (currentCodecConfig != null && !currentCodecConfig.isMandatoryCodec()) { Log.i(TAG, "enableOptionalCodecs: already using optional codec " + currentCodecConfig.getCodecName()); + BluetoothCodecConfig.getCodecName(currentCodecConfig.getCodecType())); return; } Loading Loading @@ -245,7 +245,7 @@ class A2dpCodecConfig { BluetoothCodecConfig codecConfig; BluetoothCodecConfig[] codecConfigArray = new BluetoothCodecConfig[BluetoothCodecConfig.getMaxCodecType()]; new BluetoothCodecConfig[6]; codecConfig = new BluetoothCodecConfig.Builder() .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC) .setCodecPriority(mA2dpSourceCodecPrioritySbc) Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +2 −1 Original line number Diff line number Diff line Loading @@ -1583,7 +1583,8 @@ public class A2dpService extends ProfileService { if (mA2dpCodecConfig != null) { ProfileService.println(sb, "codecConfigPriorities:"); for (BluetoothCodecConfig codecConfig : mA2dpCodecConfig.codecConfigPriorities()) { ProfileService.println(sb, " " + codecConfig.getCodecName() + ": " ProfileService.println(sb, " " + BluetoothCodecConfig.getCodecName( codecConfig.getCodecType()) + ": " + codecConfig.getCodecPriority()); } ProfileService.println(sb, "mA2dpOffloadEnabled: " + mA2dpOffloadEnabled); Loading android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpCodecConfigTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -607,7 +607,7 @@ public class A2dpCodecConfigTest { @Test public void testDisableOptionalCodecs() { BluetoothCodecConfig[] codecConfigsArray = new BluetoothCodecConfig[BluetoothCodecConfig.getMaxCodecType()]; new BluetoothCodecConfig[6]; codecConfigsArray[0] = buildBluetoothCodecConfig( BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST, Loading Loading @@ -640,7 +640,7 @@ public class A2dpCodecConfigTest { @Test public void testEnableOptionalCodecs() { BluetoothCodecConfig[] codecConfigsArray = new BluetoothCodecConfig[BluetoothCodecConfig.getMaxCodecType()]; new BluetoothCodecConfig[6]; codecConfigsArray[0] = buildBluetoothCodecConfig( BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, SBC_PRIORITY_DEFAULT, Loading framework/api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -422,7 +422,6 @@ package android.bluetooth { method public long getCodecSpecific3(); method public long getCodecSpecific4(); method public int getCodecType(); method public static int getMaxCodecType(); method public int getSampleRate(); method public void writeToParcel(android.os.Parcel, int); field public static final int BITS_PER_SAMPLE_16 = 1; // 0x1 Loading framework/java/android/bluetooth/BluetoothCodecConfig.java +5 −13 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) Loading Loading @@ -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: Loading @@ -469,7 +468,7 @@ public final class BluetoothCodecConfig implements Parcelable { default: break; } return "UNKNOWN CODEC(" + mCodecType + ")"; return "UNKNOWN CODEC(" + codecType + ")"; } /** Loading @@ -479,13 +478,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. * <p> The actual mandatory codec type for Android Bluetooth audio is SBC. Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +2 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ class A2dpCodecConfig { void enableOptionalCodecs(BluetoothDevice device, BluetoothCodecConfig currentCodecConfig) { if (currentCodecConfig != null && !currentCodecConfig.isMandatoryCodec()) { Log.i(TAG, "enableOptionalCodecs: already using optional codec " + currentCodecConfig.getCodecName()); + BluetoothCodecConfig.getCodecName(currentCodecConfig.getCodecType())); return; } Loading Loading @@ -245,7 +245,7 @@ class A2dpCodecConfig { BluetoothCodecConfig codecConfig; BluetoothCodecConfig[] codecConfigArray = new BluetoothCodecConfig[BluetoothCodecConfig.getMaxCodecType()]; new BluetoothCodecConfig[6]; codecConfig = new BluetoothCodecConfig.Builder() .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC) .setCodecPriority(mA2dpSourceCodecPrioritySbc) Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +2 −1 Original line number Diff line number Diff line Loading @@ -1583,7 +1583,8 @@ public class A2dpService extends ProfileService { if (mA2dpCodecConfig != null) { ProfileService.println(sb, "codecConfigPriorities:"); for (BluetoothCodecConfig codecConfig : mA2dpCodecConfig.codecConfigPriorities()) { ProfileService.println(sb, " " + codecConfig.getCodecName() + ": " ProfileService.println(sb, " " + BluetoothCodecConfig.getCodecName( codecConfig.getCodecType()) + ": " + codecConfig.getCodecPriority()); } ProfileService.println(sb, "mA2dpOffloadEnabled: " + mA2dpOffloadEnabled); Loading
android/app/tests/unit/src/com/android/bluetooth/a2dp/A2dpCodecConfigTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -607,7 +607,7 @@ public class A2dpCodecConfigTest { @Test public void testDisableOptionalCodecs() { BluetoothCodecConfig[] codecConfigsArray = new BluetoothCodecConfig[BluetoothCodecConfig.getMaxCodecType()]; new BluetoothCodecConfig[6]; codecConfigsArray[0] = buildBluetoothCodecConfig( BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST, Loading Loading @@ -640,7 +640,7 @@ public class A2dpCodecConfigTest { @Test public void testEnableOptionalCodecs() { BluetoothCodecConfig[] codecConfigsArray = new BluetoothCodecConfig[BluetoothCodecConfig.getMaxCodecType()]; new BluetoothCodecConfig[6]; codecConfigsArray[0] = buildBluetoothCodecConfig( BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, SBC_PRIORITY_DEFAULT, Loading
framework/api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -422,7 +422,6 @@ package android.bluetooth { method public long getCodecSpecific3(); method public long getCodecSpecific4(); method public int getCodecType(); method public static int getMaxCodecType(); method public int getSampleRate(); method public void writeToParcel(android.os.Parcel, int); field public static final int BITS_PER_SAMPLE_16 = 1; // 0x1 Loading
framework/java/android/bluetooth/BluetoothCodecConfig.java +5 −13 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) Loading Loading @@ -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: Loading @@ -469,7 +468,7 @@ public final class BluetoothCodecConfig implements Parcelable { default: break; } return "UNKNOWN CODEC(" + mCodecType + ")"; return "UNKNOWN CODEC(" + codecType + ")"; } /** Loading @@ -479,13 +478,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. * <p> The actual mandatory codec type for Android Bluetooth audio is SBC. Loading