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

Commit 55abf844 authored by Scott Mertz's avatar Scott Mertz Committed by Gerrit Code Review
Browse files

DevelopmentSettings: initialize recovery update property at boot

Android behavior has changed to load & trigger build.prop & default.prop
at every boot.  Once data is mounted, it reloads & triggers properties
set by the user.  If we set persist.sys.recovery_update to true in build.prop
or default.prop, the user's preference will never be honored.  Instead,
ensure the default always comes from userdata.

Accompanying patches to remove the default properties are required.

OPO-490
Change-Id: I3a5245088059f083554063ba6d345783114fa7a0
parent 69f45f56
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1773,13 +1773,19 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        pokeSystemProperties();
    }

    private void resetUpdateRecoveryOptions() {
    private static void resetUpdateRecoveryOptions() {
        // User builds should update recovery by default
        if ("user".equals(Build.TYPE)) {
            SystemProperties.set(UPDATE_RECOVERY_PROPERTY, "true");
        }
    }

    public static void initializeUpdateRecoveryOption() {
        if (TextUtils.isEmpty(SystemProperties.get(UPDATE_RECOVERY_PROPERTY))) {
            resetUpdateRecoveryOptions();
        }
    }

    @Override
    public void onSwitchChanged(Switch switchView, boolean isChecked) {
        if (switchView != mSwitchBar.getSwitch()) {
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.settings.hardware.VibratorIntensity;
import com.android.settings.inputmethod.InputMethodAndLanguageSettings;
import com.android.settings.livedisplay.DisplayGamma;
import com.android.settings.location.LocationSettings;
import com.android.settings.DevelopmentSettings;

public class BootReceiver extends BroadcastReceiver {

@@ -43,5 +44,7 @@ public class BootReceiver extends BroadcastReceiver {

        // Extract the contributors database
        ContributorsCloudFragment.extractContributorsCloudDatabase(ctx);

        DevelopmentSettings.initializeUpdateRecoveryOption();
    }
}