Updater: Retrieve recovery update setting using the prop itself

This makes it easier to share the setting with SetupWizard.

Change-Id: I9a69df99c1b9a198ef9d5a039a090721b0195064
This commit is contained in:
Alessandro Astone
2020-11-13 00:44:34 +01:00
committed by Rashed Abdel-Tawab
parent a3c6c19a5f
commit 9689a6b8bb
2 changed files with 2 additions and 4 deletions

View File

@@ -434,7 +434,8 @@ public class UpdatesActivity extends UpdatesListActivity {
// Might be the case of A-only devices using prebuilt vendor images.
updateRecovery.setVisibility(View.GONE);
} else if (Utils.isRecoveryUpdateExecPresent()) {
updateRecovery.setChecked(prefs.getBoolean(Constants.PREF_UPDATE_RECOVERY, false));
updateRecovery.setChecked(
SystemProperties.getBoolean(Constants.UPDATE_RECOVERY_PROPERTY, false));
} else {
// There is no recovery updater script in the device, so the feature is considered
// forcefully enabled, just to avoid users to be confused and complain that
@@ -469,8 +470,6 @@ public class UpdatesActivity extends UpdatesListActivity {
dataWarning.isChecked())
.putBoolean(Constants.PREF_AB_PERF_MODE,
abPerfMode.isChecked())
.putBoolean(Constants.PREF_UPDATE_RECOVERY,
updateRecovery.isChecked())
.apply();
if (Utils.isUpdateCheckEnabled(this)) {

View File

@@ -34,7 +34,6 @@ public final class Constants {
public static final String PREF_AB_PERF_MODE = "ab_perf_mode";
public static final String PREF_MOBILE_DATA_WARNING = "pref_mobile_data_warning";
public static final String PREF_NEEDS_REBOOT_ID = "needs_reboot_id";
public static final String PREF_UPDATE_RECOVERY = "update_recovery";
public static final String UNCRYPT_FILE_EXT = ".uncrypt";