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

Unverified Commit 49f21cf6 authored by Satheesh Kumar Pallemoni's avatar Satheesh Kumar Pallemoni Committed by Michael Bestas
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 a8bb4ace
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -598,6 +598,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(
+23 −0
Original line number Diff line number Diff line
@@ -60,6 +60,15 @@ public class BluetoothCodecDialogPreferenceController extends
        ((BaseBluetoothDialogPreference) mPreference).setCallback(this);
    }

    @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));
        }
    }

    @Override
    public List<Integer> getSelectableIndex() {
        List<Integer> index = new ArrayList<>();
@@ -117,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;
        }
@@ -171,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