Commit ee2c39b2 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

updater: Enable auto deletion of updates by default on existing devices as well



- This commit should be reverted after a considerable number of OTAs when we are sure
  that none of the users are on older builds anymore
Signed-off-by: Aayush Gupta's avatarAayush Gupta <theimpulson@e.email>
parent 154cb1fe
......@@ -34,6 +34,7 @@ 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_FORCED_AUTO_DELETE_UPDATES = "force_auto_delete_updates";
public static final String UNCRYPT_FILE_EXT = ".uncrypt";
......
......@@ -310,6 +310,15 @@ public class Utils {
removeUncryptFiles(downloadPath);
// TODO: Remove after a considerable numbers of OTA
boolean forcedDeleteUpdates = preferences.getBoolean(Constants.PREF_FORCED_AUTO_DELETE_UPDATES, true);
if (forcedDeleteUpdates == true) {
preferences.edit()
.putBoolean(Constants.PREF_AUTO_DELETE_UPDATES, true)
.putBoolean(Constants.PREF_FORCED_AUTO_DELETE_UPDATES, false)
.apply();
}
long buildTimestamp = SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0);
long prevTimestamp = preferences.getLong(Constants.PREF_INSTALL_OLD_TIMESTAMP, 0);
String lastUpdatePath = preferences.getString(Constants.PREF_INSTALL_PACKAGE_PATH, null);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment