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

Commit 5ff6e5a8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Support for configuring captive portal detection enabled by user"

parents 5ac5f997 2ae195ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -214,4 +214,6 @@
    <!-- Default for Settings.Global.GUEST_USER_ENABLED -->
    <!-- Default for Settings.Global.GUEST_USER_ENABLED -->
    <bool name="def_guest_user_enabled">true</bool>
    <bool name="def_guest_user_enabled">true</bool>


    <!-- Default for Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED -->
    <integer name="def_captive_portal_detection_enabled" translatable="false">1</integer>
</resources>
</resources>
+11 −1
Original line number Original line Diff line number Diff line
@@ -1356,6 +1356,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
        if (upgradeVersion == 88) {
        if (upgradeVersion == 88) {
            if (mUserHandle == UserHandle.USER_OWNER) {
            if (mUserHandle == UserHandle.USER_OWNER) {
                db.beginTransaction();
                db.beginTransaction();
                SQLiteStatement stmt = null;
                try {
                try {
                    String[] settingsToMove = {
                    String[] settingsToMove = {
                            Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD,
                            Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD,
@@ -1375,7 +1376,6 @@ public class DatabaseHelper extends SQLiteOpenHelper {
                            Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES,
                            Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES,
                            Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
                            Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
                            Settings.Global.CONNECTIVITY_CHANGE_DELAY,
                            Settings.Global.CONNECTIVITY_CHANGE_DELAY,
                            Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED,
                            Settings.Global.CAPTIVE_PORTAL_SERVER,
                            Settings.Global.CAPTIVE_PORTAL_SERVER,
                            Settings.Global.NSD_ON,
                            Settings.Global.NSD_ON,
                            Settings.Global.SET_INSTALL_LOCATION,
                            Settings.Global.SET_INSTALL_LOCATION,
@@ -1391,9 +1391,16 @@ public class DatabaseHelper extends SQLiteOpenHelper {
                            Settings.Global.DEFAULT_DNS_SERVER,
                            Settings.Global.DEFAULT_DNS_SERVER,
                    };
                    };
                    moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true);
                    moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true);

                    stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
                            + " VALUES(?,?);");
                    loadIntegerSetting(stmt, Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED,
                            R.integer.def_captive_portal_detection_enabled);
                    stmt.close();
                    db.setTransactionSuccessful();
                    db.setTransactionSuccessful();
                } finally {
                } finally {
                    db.endTransaction();
                    db.endTransaction();
                    if (stmt != null) stmt.close();
                }
                }
            }
            }
            upgradeVersion = 89;
            upgradeVersion = 89;
@@ -2760,6 +2767,9 @@ public class DatabaseHelper extends SQLiteOpenHelper {


            loadBooleanSetting(stmt, Settings.Global.GUEST_USER_ENABLED,
            loadBooleanSetting(stmt, Settings.Global.GUEST_USER_ENABLED,
                    R.bool.def_guest_user_enabled);
                    R.bool.def_guest_user_enabled);

            loadIntegerSetting(stmt, Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED,
                    R.integer.def_captive_portal_detection_enabled);
            // --- New global settings start here
            // --- New global settings start here
        } finally {
        } finally {
            if (stmt != null) stmt.close();
            if (stmt != null) stmt.close();