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

Commit 48668576 authored by Chienyuan's avatar Chienyuan Committed by Chienyuan Huang
Browse files

Set default value of A2DP HW offload toggle

When developer options is disabled, A2DP HW offload toggle
will switch to default value, we should decide default value
according to A2DP HW offload is supported of not.

Bug: 63932139
Bug: 79568680
Test: robotests
Change-Id: I3bf941edd3c0e0f70cfba32dc856e3f14fee07fa
parent e0e49140
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -69,9 +69,16 @@ public class BluetoothA2dpHwOffloadPreferenceController extends DeveloperOptions
    @Override
    protected void onDeveloperOptionsSwitchDisabled() {
        super.onDeveloperOptionsSwitchDisabled();
        final boolean offloadSupported =
                SystemProperties.getBoolean(A2DP_OFFLOAD_SUPPORTED_PROPERTY, false);
        if (offloadSupported) {
            ((SwitchPreference) mPreference).setChecked(false);
            SystemProperties.set(A2DP_OFFLOAD_DISABLED_PROPERTY, "false");
        } else {
            ((SwitchPreference) mPreference).setChecked(true);
            SystemProperties.set(A2DP_OFFLOAD_DISABLED_PROPERTY, "true");
        }
    }

    public void onA2dpHwDialogConfirmed() {
        final boolean offloadDisabled =