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

Commit 16df2cee authored by Antonino Faraone's avatar Antonino Faraone
Browse files

Add a configurable default value for WIFI_ALWAYS_REQUESTED

Bug: 294156275
Test: Manual
Change-Id: I876afd543b7bb6c38e686e54657674f23761712a
parent 37a5f990
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -324,4 +324,7 @@

    <!-- Whether predictive back animation is enabled by default. -->
    <bool name="def_enable_back_animation">false</bool>

    <!-- Whether wifi is always requested by default. -->
    <bool name="def_enable_wifi_always_requested">false</bool>
</resources>
+18 −1
Original line number Diff line number Diff line
@@ -3876,7 +3876,7 @@ public class SettingsProvider extends ContentProvider {
        }

        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 221;
            private static final int SETTINGS_VERSION = 222;

            private final int mUserId;

@@ -5985,6 +5985,23 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 221;
                }

                if (currentVersion == 221) {
                    // Version 221: Set a default value for wifi always requested
                    final SettingsState globalSettings = getGlobalSettingsLocked();
                    final Setting enableWifiAlwaysRequested =
                            globalSettings.getSettingLocked(Global.WIFI_ALWAYS_REQUESTED);
                    if (enableWifiAlwaysRequested.isNull()) {
                        final boolean defEnableWifiAlwaysRequested =
                                getContext()
                                        .getResources()
                                        .getBoolean(R.bool.def_enable_wifi_always_requested);
                        initGlobalSettingsDefaultValLocked(
                                Settings.Global.WIFI_ALWAYS_REQUESTED,
                                defEnableWifiAlwaysRequested);
                    }
                    currentVersion = 222;
                }

                // vXXX: Add new settings above this point.

                if (currentVersion != newVersion) {