Commit f4a3c575 authored by Han Wang's avatar Han Wang

Updater: Assume older Android version to be incompatible

 * Issue happens when both 15.1 and 16.0 are built.

Change-Id: I0cb7c834824056f450129524a7aec8091c9d3dc7
parent 2849967e
...@@ -95,6 +95,10 @@ public class Utils { ...@@ -95,6 +95,10 @@ public class Utils {
} }
public static boolean isCompatible(UpdateBaseInfo update) { 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) && if (!SystemProperties.getBoolean(Constants.PROP_UPDATER_ALLOW_DOWNGRADING, false) &&
update.getTimestamp() <= SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) { update.getTimestamp() <= SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) {
Log.d(TAG, update.getName() + " is older than/equal to the current build"); Log.d(TAG, update.getName() + " is older than/equal to the current build");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment