Loading app/src/main/java/org/lineageos/updater/download/HttpURLConnectionClient.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package org.lineageos.updater.download; import android.os.SystemClock; import android.os.SystemProperties; import android.util.Log; import java.io.File; Loading @@ -32,6 +34,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"; Loading @@ -58,6 +62,11 @@ public class HttpURLConnectionClient implements DownloadClient { DownloadClient.DownloadCallback callback, boolean useDuplicateLinks) throws IOException { mClient = (HttpURLConnection) new URL(url).openConnection(); String defaultUserAgent = mClient.getRequestProperty("User-Agent"); String newUserAgent = defaultUserAgent + " eOS v" + SystemProperties.get(Constants.PROP_BUILD_VERSION); mClient.setRequestProperty("User-Agent", newUserAgent); mDestination = destination; mProgressListener = progressListener; mCallback = callback; Loading Loading
app/src/main/java/org/lineageos/updater/download/HttpURLConnectionClient.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package org.lineageos.updater.download; import android.os.SystemClock; import android.os.SystemProperties; import android.util.Log; import java.io.File; Loading @@ -32,6 +34,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"; Loading @@ -58,6 +62,11 @@ public class HttpURLConnectionClient implements DownloadClient { DownloadClient.DownloadCallback callback, boolean useDuplicateLinks) throws IOException { mClient = (HttpURLConnection) new URL(url).openConnection(); String defaultUserAgent = mClient.getRequestProperty("User-Agent"); String newUserAgent = defaultUserAgent + " eOS v" + SystemProperties.get(Constants.PROP_BUILD_VERSION); mClient.setRequestProperty("User-Agent", newUserAgent); mDestination = destination; mProgressListener = progressListener; mCallback = callback; Loading