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

Commit d01f0a85 authored by Ted Wang's avatar Ted Wang
Browse files

Do not switch codec to OPUS if optional codec has been disabled

Add optional codec enabled check when trying to swtich codec for low
letancy mode.

Bug: 241009138
Test: Manually
Ignore-AOSP-First: tm-qpr feature
Change-Id: Ifb86cf3a52e3b7dbd879731322146ff651a631d5
parent 51ac59bb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1641,6 +1641,9 @@ public class A2dpService extends ProfileService {
    }

    public void switchCodecByBufferSize(BluetoothDevice device, boolean isLowLatency) {
        if (getOptionalCodecsEnabled(device) != BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED) {
            return;
        }
        mA2dpCodecConfig.switchCodecByBufferSize(
                device, isLowLatency, getCodecStatus(device).getCodecConfig().getCodecType());
    }