diff --git a/src/org/lineageos/updater/download/HttpURLConnectionClient.java b/src/org/lineageos/updater/download/HttpURLConnectionClient.java index 609ac817ba8f2aea2ed9cc8bb2a7d72a4631bd64..3bbc2dc1d58d9d71c2393bbbc461c03664c93a05 100644 --- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java +++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java @@ -17,6 +17,8 @@ package org.lineageos.updater.download; import android.os.SystemClock; +import android.os.SystemProperties; + import android.util.Log; import java.io.File; @@ -33,6 +35,8 @@ import java.util.PriorityQueue; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.lineageos.updater.misc.Constants; + public class HttpURLConnectionClient implements DownloadClient { private final static String TAG = "HttpURLConnectionClient"; @@ -61,7 +65,7 @@ public class HttpURLConnectionClient implements DownloadClient { mClient = (HttpURLConnection) new URL(url).openConnection(); String defaultUserAgent = mClient.getRequestProperty("User-Agent"); - String newUserAgent = defaultUserAgent+" ota_007_eels"; + String newUserAgent = defaultUserAgent + " eOS v" + SystemProperties.get(Constants.PROP_BUILD_VERSION); mClient.setRequestProperty("User-Agent", newUserAgent); mDestination = destination; diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 050fcd7b40e1bf667ca0ed18c749f150c472e792..cdd187dfc2af7e25a6688e40ab02ab91d92de2c8 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -271,10 +271,8 @@ public class Utils { public static boolean checkForNewUpdates(File newJson) throws IOException, JSONException { List newList = parseJson(newJson, true); - float currentVersion = Float.parseFloat(BuildInfoUtils.getBuildVersion()); - for (UpdateInfo update : newList) { - if (Float.parseFloat(update.getVersion()) > currentVersion) { + if (isCompatible(update)) { Log.d(TAG, "New compatiable update available"); return true; }