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

Commit a5f1a884 authored by Michael Bestas's avatar Michael Bestas Committed by Michael Bestas
Browse files

Don't reset A2DP offload when disabling developer settings

* We need to disable A2DP HW offload on FP4 for now, however
  disabling developer settings would enable offload again and
  break SBC and AAC audio. Just remove this section and allow
  this setting to persist after disabling developer settings.

Change-Id: I5b65b3887d68ac684d7ea78de0ee89fb7db9bb0f
parent 3528c87f
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -66,23 +66,10 @@ 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");
        }
    }

    public boolean isDefaultValue() {
        final boolean offloadSupported =
                SystemProperties.getBoolean(A2DP_OFFLOAD_SUPPORTED_PROPERTY, false);
        final boolean offloadDisabled =
                    SystemProperties.getBoolean(A2DP_OFFLOAD_DISABLED_PROPERTY, false);
        return offloadSupported ? !offloadDisabled : true;
        // Always return true here to avoid needing to reboot when disabling
        // developer options, since we aren't turning this off when doing so anymore.
        return true;
    }

    public void onA2dpHwDialogConfirmed() {