From f4a3c575f4448f66792934374e382cc480ff260f Mon Sep 17 00:00:00 2001 From: Han Wang <416810799@qq.com> Date: Tue, 5 Mar 2019 05:10:46 +0100 Subject: [PATCH] Updater: Assume older Android version to be incompatible * Issue happens when both 15.1 and 16.0 are built. Change-Id: I0cb7c834824056f450129524a7aec8091c9d3dc7 --- src/org/lineageos/updater/misc/Utils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 6ca7f941..9299114d 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -95,6 +95,10 @@ public class Utils { } public static boolean isCompatible(UpdateBaseInfo update) { + if (update.getVersion().compareTo(SystemProperties.get(Constants.PROP_BUILD_VERSION)) < 0) { + Log.d(TAG, update.getName() + " is older than current Android version"); + return false; + } if (!SystemProperties.getBoolean(Constants.PROP_UPDATER_ALLOW_DOWNGRADING, false) && update.getTimestamp() <= SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) { Log.d(TAG, update.getName() + " is older than/equal to the current build"); -- GitLab