From 2f1ebbbf7487a98d35c8173186af9a667be811a3 Mon Sep 17 00:00:00 2001 From: rezanejati Date: Wed, 7 Aug 2019 09:11:55 +0430 Subject: [PATCH] Add brackets for condition - add new line in ProxyConfig --- .../main/java/de/danoeh/antennapod/dialog/ProxyDialog.java | 3 ++- .../danoeh/antennapod/core/service/download/ProxyConfig.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 cff21eaa7..1fac5c193 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java @@ -114,8 +114,9 @@ public class ProxyDialog { types.add(Proxy.Type.DIRECT.name()); types.add(Proxy.Type.HTTP.name()); - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){ types.add(Proxy.Type.SOCKS.name()); + } ArrayAdapter adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, types); diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/ProxyConfig.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/ProxyConfig.java index 348b523cb..c4096c3da 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/ProxyConfig.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/ProxyConfig.java @@ -21,9 +21,11 @@ public class ProxyConfig { public static ProxyConfig http(String host, int port, String username, String password) { return new ProxyConfig(Proxy.Type.HTTP, host, port, username, password); } + public static ProxyConfig socks(String host, int port, String username, String password) { return new ProxyConfig(Proxy.Type.SOCKS, host, port, username, password); } + public ProxyConfig(Proxy.Type type, String host, int port, String username, String password) { this.type = type; this.host = host; @@ -31,4 +33,4 @@ public class ProxyConfig { this.username = username; this.password = password; } -} +} \ No newline at end of file