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

Commit f7178f56 authored by Satheesh Kumar Pallemoni's avatar Satheesh Kumar Pallemoni Committed by Bruno Martins
Browse files

A2dpSrc: Bluetooth codec Dev-UI support for QVA codecs

Added Bluetooth codec Dev-UI support for QVA codecs.

CRs-Fixed: 2663248
Change-Id: I035d760bbf4de27f2216c4ffb42df26a0c0ce476
parent 7a6c634f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -600,6 +600,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra

    @Override
    public void onBluetoothHDAudioEnabled(boolean enabled) {
        Log.d(TAG, "onBluetoothHDAudioEnabled: " + enabled);
        for (AbstractPreferenceController controller : mPreferenceControllers) {
            if (controller instanceof AbstractBluetoothDialogPreferenceController) {
                ((AbstractBluetoothDialogPreferenceController) controller).onHDAudioEnabled(
+15 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public class BluetoothCodecDialogPreferenceController extends

    @Override
    public void onHDAudioEnabled(boolean enabled) {
        Log.d(TAG, " onHDAudioEnabled: " + enabled);
        if (!enabled) {
            // If option codec is disabled, SBC is the only only one available codec.
            onIndexUpdated(convertCfgToBtnIndex(BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC));
@@ -125,6 +126,14 @@ public class BluetoothCodecDialogPreferenceController extends
                codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC;
                codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
                break;
            case 6:
                codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_ADAPTIVE;
                codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
                break;
            case 7:
                codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_TWSP;
                codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
                break;
            default:
                break;
        }
@@ -179,9 +188,15 @@ public class BluetoothCodecDialogPreferenceController extends
            case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD:
                index = 4;
                break;
            case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_ADAPTIVE:
                index = 6;
                break;
            case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC:
                index = 5;
                break;
            case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_TWSP:
                index = 7;
                break;
            default:
                Log.e(TAG, "Unsupported config:" + config);
                break;
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ public class BluetoothHDAudioPreferenceController extends AbstractBluetoothPrefe
            return true;
        }
        final boolean enabled = (Boolean) newValue;
        Log.e(TAG, "onPreferenceChange: " + enabled);
        final int prefValue = enabled
                ? BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED
                : BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED;
+2 −1
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ public class BluetoothQualityDialogPreferenceController extends

    @Override
    public void onHDAudioEnabled(boolean enabled) {
        mPreference.setEnabled(false);
        Log.d(TAG, "onHDAudioEnabled: " + enabled);
        mPreference.setEnabled(enabled);
    }

    @VisibleForTesting