2022-05-08 05:09:58 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2022-05-02 02:39:49 +00:00
|
|
|
From: Erfan Abdi <erfangplus@gmail.com>
|
|
|
|
Date: Tue, 26 Apr 2022 00:18:03 +0430
|
|
|
|
Subject: [PATCH] Updater: Add prop for allowing major updates
|
|
|
|
|
|
|
|
Change-Id: Ida461cab7f0c4953fbdd6ea4928bf14fff386056
|
|
|
|
---
|
|
|
|
src/org/lineageos/updater/misc/Constants.java | 1 +
|
|
|
|
src/org/lineageos/updater/misc/Utils.java | 3 ++-
|
|
|
|
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/src/org/lineageos/updater/misc/Constants.java b/src/org/lineageos/updater/misc/Constants.java
|
2024-06-17 06:18:04 +00:00
|
|
|
index d6f22d2..e8a0031 100644
|
2022-05-02 02:39:49 +00:00
|
|
|
--- a/src/org/lineageos/updater/misc/Constants.java
|
|
|
|
+++ b/src/org/lineageos/updater/misc/Constants.java
|
2024-06-17 06:18:04 +00:00
|
|
|
@@ -58,6 +58,7 @@ public final class Constants {
|
2022-05-02 02:39:49 +00:00
|
|
|
public static final String PROP_RELEASE_TYPE = "ro.lineage.releasetype";
|
|
|
|
public static final String PROP_UPDATER_ALLOW_DOWNGRADING = "lineage.updater.allow_downgrading";
|
|
|
|
public static final String PROP_UPDATER_URI = "lineage.updater.uri";
|
|
|
|
+ public static final String PROP_UPDATER_ALLOW_MAJOR_UPDATE = "lineage.updater.allow_major_update";
|
|
|
|
|
|
|
|
public static final String PREF_INSTALL_OLD_TIMESTAMP = "install_old_timestamp";
|
|
|
|
public static final String PREF_INSTALL_NEW_TIMESTAMP = "install_new_timestamp";
|
|
|
|
diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java
|
2024-06-17 06:18:04 +00:00
|
|
|
index 1577b3d..b295df0 100644
|
2022-05-02 02:39:49 +00:00
|
|
|
--- a/src/org/lineageos/updater/misc/Utils.java
|
|
|
|
+++ b/src/org/lineageos/updater/misc/Utils.java
|
2022-05-08 05:09:58 +00:00
|
|
|
@@ -114,8 +114,9 @@ public class Utils {
|
2022-05-02 02:39:49 +00:00
|
|
|
public static boolean canInstall(UpdateBaseInfo update) {
|
|
|
|
return (SystemProperties.getBoolean(Constants.PROP_UPDATER_ALLOW_DOWNGRADING, false) ||
|
|
|
|
update.getTimestamp() > SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) &&
|
|
|
|
+ (SystemProperties.getBoolean(Constants.PROP_UPDATER_ALLOW_MAJOR_UPDATE, false) ||
|
|
|
|
update.getVersion().equalsIgnoreCase(
|
|
|
|
- SystemProperties.get(Constants.PROP_BUILD_VERSION));
|
|
|
|
+ SystemProperties.get(Constants.PROP_BUILD_VERSION)));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<UpdateInfo> parseJson(File file, boolean compatibleOnly)
|