Updater: Assume older Android version to be incompatible

* Issue happens when both 15.1 and 16.0 are built.

Change-Id: I0cb7c834824056f450129524a7aec8091c9d3dc7
This commit is contained in:
Han Wang
2019-03-05 05:10:46 +01:00
parent 2849967e61
commit f4a3c575f4

View File

@@ -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");