summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-07-12 18:02:49 +0200
committercyBerta <cyberta@riseup.net>2019-07-12 18:02:54 +0200
commit045675a8cf2b7bf377ab86fa3196949e1684cc44 (patch)
tree310f86ac51a66d44d4a62a7363b2ad2dcbb5918e /app/src/main/java/se
parent2979517d1401a42eedcadfbe33af4af02ef0afac (diff)
* use static atomicBoolean to save alwaysOn settings instead of sharedPrefs
>> avoid race conditions between sharedPreference writing and onBoot receiver reading * don't explicitly exclude Bitmask from routes
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java b/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java
index 8339b033..2efce9e4 100644
--- a/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java
+++ b/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java
@@ -6,6 +6,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
+import de.blinkt.openvpn.core.VpnStatus;
import se.leap.bitmaskclient.utils.PreferenceHelper;
import static android.content.Intent.ACTION_BOOT_COMPLETED;
@@ -29,7 +30,7 @@ public class OnBootReceiver extends BroadcastReceiver {
preferences = context.getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE);
boolean providerConfigured = !preferences.getString(PROVIDER_VPN_CERTIFICATE, "").isEmpty();
boolean startOnBoot = preferences.getBoolean(EIP_RESTART_ON_BOOT, false);
- boolean isAlwaysOnConfigured = PreferenceHelper.isAlwaysOn(context);
+ boolean isAlwaysOnConfigured = VpnStatus.isAlwaysOn();
Log.d("OpenVPN", "OpenVPN onBoot intent received. Provider configured? " + providerConfigured + " Start on boot? " + startOnBoot + " isAlwaysOn feature configured: " + isAlwaysOnConfigured);
if (providerConfigured) {
if (isAlwaysOnConfigured) {