Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6bc9eeb authored by ValdikSS's avatar ValdikSS Committed by Luca Stefani
Browse files

Add Dual Channel into Bluetooth Audio Channel Mode developer options menu

Change-Id: Icd3179ac63310355547fd58060e75f25b4a8210d
parent 513e45d3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@
            <include
                android:id="@+id/bluetooth_audio_channel_mode_stereo"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_channel_mode_dual_channel"
                layout="@layout/preference_widget_dialog_radiobutton"/>
        </RadioGroup>

        <include
+2 −1
Original line number Diff line number Diff line
@@ -55,7 +55,8 @@ public abstract class AbstractBluetoothDialogPreferenceController extends
            BluetoothCodecConfig.BITS_PER_SAMPLE_24,
            BluetoothCodecConfig.BITS_PER_SAMPLE_16};
    protected static final int[] CHANNEL_MODES = {BluetoothCodecConfig.CHANNEL_MODE_STEREO,
            BluetoothCodecConfig.CHANNEL_MODE_MONO};
            BluetoothCodecConfig.CHANNEL_MODE_MONO,
            BluetoothCodecConfig.CHANNEL_MODE_DUAL_CHANNEL};

    protected final BluetoothA2dpConfigStore mBluetoothA2dpConfigStore;

+4 −2
Original line number Diff line number Diff line
@@ -59,13 +59,15 @@ public class BluetoothChannelModeDialogPreference extends BaseBluetoothDialogPre
        mRadioButtonIds.add(R.id.bluetooth_audio_channel_mode_default);
        mRadioButtonIds.add(R.id.bluetooth_audio_channel_mode_mono);
        mRadioButtonIds.add(R.id.bluetooth_audio_channel_mode_stereo);
        mRadioButtonIds.add(R.id.bluetooth_audio_channel_mode_dual_channel);
        String[] stringArray = context.getResources().getStringArray(
                R.array.bluetooth_a2dp_codec_channel_mode_titles);
                R.array.bluetooth_a2dp_codec_channel_mode_titles_cm);

        for (int i = 0; i < stringArray.length; i++) {
            mRadioButtonStrings.add(stringArray[i]);
        }
        stringArray = context.getResources().getStringArray(
                R.array.bluetooth_a2dp_codec_channel_mode_summaries);
                R.array.bluetooth_a2dp_codec_channel_mode_summaries_cm);
        for (int i = 0; i < stringArray.length; i++) {
            mSummaryStrings.add(stringArray[i]);
        }
+6 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ public class BluetoothChannelModeDialogPreferenceController extends
            case 2:
                channelModeValue = BluetoothCodecConfig.CHANNEL_MODE_STEREO;
                break;
            case 3:
                channelModeValue = BluetoothCodecConfig.CHANNEL_MODE_DUAL_CHANNEL;
                break;
            default:
                break;
        }
@@ -112,6 +115,9 @@ public class BluetoothChannelModeDialogPreferenceController extends
            case BluetoothCodecConfig.CHANNEL_MODE_STEREO:
                index = 2;
                break;
            case BluetoothCodecConfig.CHANNEL_MODE_DUAL_CHANNEL:
                index = 3;
                break;
            default:
                Log.e(TAG, "Unsupported config:" + config);
                break;