summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-09 23:33:55 +0100
committercyBerta <cyberta@riseup.net>2021-11-09 23:33:55 +0100
commit7cd76c3eb08f89be94642a57eca7d929d8d72c6d (patch)
treebdac4e2805168ef0fc19b944dc655b8ab09d347e /app/src/main/java/se
parent21927a346f6b2e948da254e8d1dbca7e0a49aa91 (diff)
check tor preferences before initiating a tor service connection
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/utils/PreferenceHelper.java4
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/utils/PreferenceHelper.java b/app/src/main/java/se/leap/bitmaskclient/base/utils/PreferenceHelper.java
index 7bbd032e..06fb25e9 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/utils/PreferenceHelper.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/utils/PreferenceHelper.java
@@ -165,6 +165,10 @@ public class PreferenceHelper {
return preferences.getBoolean(USE_TOR, true);
}
+ public static Boolean getUseTor(Context context) {
+ return getBoolean(context, USE_TOR, true);
+ }
+
public static void saveBattery(Context context, boolean isEnabled) {
putBoolean(context, DEFAULT_SHARED_PREFS_BATTERY_SAVER, isEnabled);
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
index c45d7ae9..94d3e0de 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
@@ -212,7 +212,7 @@ public class ProviderAPI extends JobIntentService implements ProviderApiManagerB
* @throws IllegalStateException thrown if this method was not called from a background thread
*/
private void initTorServiceConnection(Context context) throws InterruptedException, IllegalStateException {
- if (PreferenceHelper.getUseBridges(context)) {
+ if (PreferenceHelper.getUseTor(context)) {
if (torServiceConnection == null) {
Log.d(TAG, "serviceConnection is still null");
if (!TorService.hasClientTransportPlugin()) {