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

Commit 03305857 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 64a04eb0 4350408f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -212,4 +212,7 @@

    <!-- Default for Settings.Secure.NFC_PAYMENT_COMPONENT -->
    <string name="def_nfc_payment_component"></string>

    <!-- Default for Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED -->
    <integer name="def_captive_portal_detection_enabled" translatable="false">1</integer>
</resources>
+10 −2
Original line number Diff line number Diff line
@@ -1388,6 +1388,7 @@ class DatabaseHelper extends SQLiteOpenHelper {
        if (upgradeVersion == 88) {
            if (mUserHandle == UserHandle.USER_OWNER) {
                db.beginTransaction();
                SQLiteStatement stmt = null;
                try {
                    String[] settingsToMove = {
                            Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD,
@@ -1407,7 +1408,6 @@ class DatabaseHelper extends SQLiteOpenHelper {
                            Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES,
                            Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
                            Settings.Global.CONNECTIVITY_CHANGE_DELAY,
                            Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED,
                            Settings.Global.CAPTIVE_PORTAL_SERVER,
                            Settings.Global.NSD_ON,
                            Settings.Global.SET_INSTALL_LOCATION,
@@ -1423,9 +1423,16 @@ class DatabaseHelper extends SQLiteOpenHelper {
                            Settings.Global.DEFAULT_DNS_SERVER,
                    };
                    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();
                } finally {
                    db.endTransaction();
                    if (stmt != null) stmt.close();
                }
            }
            upgradeVersion = 89;
@@ -2709,7 +2716,6 @@ class DatabaseHelper extends SQLiteOpenHelper {
                    R.bool.def_guest_user_enabled);
            loadSetting(stmt, Settings.Global.ENHANCED_4G_MODE_ENABLED,
                    ImsConfig.FeatureValueConstants.ON);

            /*
             * IMPORTANT: Do not add any more upgrade steps here as the global,
             * secure, and system settings are no longer stored in a database
@@ -2717,6 +2723,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
             *
             * See: SettingsProvider.UpgradeController#onUpgradeLocked
             */
            loadIntegerSetting(stmt, Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED,
                    R.integer.def_captive_portal_detection_enabled);
        } finally {
            if (stmt != null) stmt.close();
        }