avoid android.* classes to allow for direct JUnit tests
When running tests on the host machine, android.jar contains no code at all which is totally stupid. We can keep android.util.Log in there because it does not affect the logic at all. Then just set that android.jar to return generic values using: unitTests.returnDefaultValues = true
This commit is contained in:
parent
a1d6917ec7
commit
f2621dcb55
@ -167,6 +167,11 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
testOptions {
|
||||
// prevent tests from dying on android.util.Log calls
|
||||
unitTests.returnDefaultValues = true
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.fdroid.fdroid.net;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
|
||||
@ -108,8 +107,8 @@ public class HttpDownloader extends Downloader {
|
||||
// workaround until NetCipher supports HTTPS SNI
|
||||
// https://gitlab.com/fdroid/fdroidclient/issues/431
|
||||
if (connection instanceof HttpsURLConnection
|
||||
&& !TextUtils.equals(sourceUrl.getHost(), "f-droid.org")
|
||||
&& !TextUtils.equals(sourceUrl.getHost(), "guardianproject.info")) {
|
||||
&& "f-droid.org".equals(sourceUrl.getHost())
|
||||
&& "guardianproject.info".equals(sourceUrl.getHost())) {
|
||||
((HttpsURLConnection) connection).setSSLSocketFactory(HttpsURLConnection.getDefaultSSLSocketFactory());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user