diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-11-13 22:04:08 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-11-13 23:02:25 +0100 |
commit | 2682cbd784a23a627771bba36b123d4727ccfc24 (patch) | |
tree | 8d15cc9b73a6c5681af667b625c1f22876a73949 /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | 4a6b630e56fc486308b6fb53784264e36988fd78 (diff) | |
download | AntennaPod-2682cbd784a23a627771bba36b123d4727ccfc24.zip |
Upgrade to OkHttp3
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 1 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 202d33408..ac073141d 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -228,6 +228,7 @@ public class EpisodesApplyActionFragment extends Fragment { case R.id.check_has_media: checkWithMedia(); resId = R.string.selected_has_media_label; + break; case R.id.sort_title_a_z: sortByTitle(false); return true; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java index 98a4b5356..0bd75b5b0 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java @@ -18,10 +18,6 @@ import android.widget.TextView; import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; import com.afollestad.materialdialogs.internal.MDButton; -import com.squareup.okhttp.Credentials; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; import java.io.IOException; import java.net.InetSocketAddress; @@ -33,6 +29,10 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; import de.danoeh.antennapod.core.service.download.ProxyConfig; +import okhttp3.Credentials; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; import rx.Observable; import rx.Subscriber; import rx.Subscription; @@ -258,10 +258,11 @@ public class ProxyDialog { SocketAddress address = InetSocketAddress.createUnresolved(host, portValue); Proxy.Type proxyType = Proxy.Type.valueOf(type.toUpperCase()); Proxy proxy = new Proxy(proxyType, address); - OkHttpClient client = AntennapodHttpClient.newHttpClient(); - client.setConnectTimeout(10, TimeUnit.SECONDS); - client.setProxy(proxy); - client.interceptors().clear(); + OkHttpClient.Builder builder = AntennapodHttpClient.newBuilder() + .connectTimeout(10, TimeUnit.SECONDS) + .proxy(proxy); + builder.interceptors().clear(); + OkHttpClient client = builder.build(); if(!TextUtils.isEmpty(username)) { String credentials = Credentials.basic(username, password); client.interceptors().add(chain -> { |