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

Commit c8c5d2ae 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 6f52dca6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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";

+9 −0
Original line number Diff line number Diff line
@@ -309,6 +309,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);