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

Commit f4a3c575 authored by Han Wang's avatar Han Wang
Browse files

Updater: Assume older Android version to be incompatible

 * Issue happens when both 15.1 and 16.0 are built.

Change-Id: I0cb7c834824056f450129524a7aec8091c9d3dc7
parent 2849967e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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");