Loading core/java/android/bluetooth/BluetoothCodecConfig.java +4 −3 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ public final class BluetoothCodecConfig implements Parcelable { public static final int CHANNEL_MODE_NONE = 0; public static final int CHANNEL_MODE_MONO = 0x1 << 0; public static final int CHANNEL_MODE_STEREO = 0x1 << 1; public static final int CHANNEL_MODE_DUAL_CHANNEL = 0x1 << 2; private final int mCodecType; private int mCodecPriority; Loading packages/SettingsLib/res/values/arrays.xml +1 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ <item>0</item> <item>1</item> <item>2</item> <item>3</item> </string-array> <!-- Summaries for Bluetooth Audio Codec Channel Mode selection preference. [CHAR LIMIT=50]--> Loading packages/SettingsLib/res/values/cm_arrays.xml 0 → 100644 +38 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** ** Copyright (C) 2018 The LineageOS Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Titles for Bluetooth Audio Codec Channel Mode selection preference. [CHAR LIMIT=50] --> <string-array name="lineage_bluetooth_a2dp_codec_channel_mode_titles"> <item>Use System Selection (Default)</item> <item>Mono</item> <item>Stereo</item> <item>Dual Channel</item> </string-array> <!-- Summaries for Bluetooth Audio Codec Channel Mode selection preference. [CHAR LIMIT=50]--> <string-array name="lineage_bluetooth_a2dp_codec_channel_mode_summaries" > <item>Use System Selection (Default)</item> <item>Mono</item> <item>Stereo</item> <item>Dual Channel</item> </string-array> </resources> packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ public class A2dpProfile implements LocalBluetoothProfile { final BluetoothCodecConfig codecConfig = (selectable == null || selectable.length < 1) ? null : selectable[0]; final int codecType = (codecConfig == null || codecConfig.isMandatoryCodec()) final int codecType = (codecConfig == null) ? BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID : codecConfig.getCodecType(); int index = -1; Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,9 @@ public class A2dpProfileTest { when(status.getCodecsSelectableCapabilities()).thenReturn(configs); when(config.isMandatoryCodec()).thenReturn(true); assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo(UNKNOWN_CODEC_LABEL); when(config.getCodecName()).thenReturn("SBC"); assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo( String.format(KNOWN_CODEC_LABEL, config.getCodecName())); } @Test Loading Loading
core/java/android/bluetooth/BluetoothCodecConfig.java +4 −3 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ public final class BluetoothCodecConfig implements Parcelable { public static final int CHANNEL_MODE_NONE = 0; public static final int CHANNEL_MODE_MONO = 0x1 << 0; public static final int CHANNEL_MODE_STEREO = 0x1 << 1; public static final int CHANNEL_MODE_DUAL_CHANNEL = 0x1 << 2; private final int mCodecType; private int mCodecPriority; Loading
packages/SettingsLib/res/values/arrays.xml +1 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,7 @@ <item>0</item> <item>1</item> <item>2</item> <item>3</item> </string-array> <!-- Summaries for Bluetooth Audio Codec Channel Mode selection preference. [CHAR LIMIT=50]--> Loading
packages/SettingsLib/res/values/cm_arrays.xml 0 → 100644 +38 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** ** Copyright (C) 2018 The LineageOS Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Titles for Bluetooth Audio Codec Channel Mode selection preference. [CHAR LIMIT=50] --> <string-array name="lineage_bluetooth_a2dp_codec_channel_mode_titles"> <item>Use System Selection (Default)</item> <item>Mono</item> <item>Stereo</item> <item>Dual Channel</item> </string-array> <!-- Summaries for Bluetooth Audio Codec Channel Mode selection preference. [CHAR LIMIT=50]--> <string-array name="lineage_bluetooth_a2dp_codec_channel_mode_summaries" > <item>Use System Selection (Default)</item> <item>Mono</item> <item>Stereo</item> <item>Dual Channel</item> </string-array> </resources>
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ public class A2dpProfile implements LocalBluetoothProfile { final BluetoothCodecConfig codecConfig = (selectable == null || selectable.length < 1) ? null : selectable[0]; final int codecType = (codecConfig == null || codecConfig.isMandatoryCodec()) final int codecType = (codecConfig == null) ? BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID : codecConfig.getCodecType(); int index = -1; Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,9 @@ public class A2dpProfileTest { when(status.getCodecsSelectableCapabilities()).thenReturn(configs); when(config.isMandatoryCodec()).thenReturn(true); assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo(UNKNOWN_CODEC_LABEL); when(config.getCodecName()).thenReturn("SBC"); assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo( String.format(KNOWN_CODEC_LABEL, config.getCodecName())); } @Test Loading