diff options
author | cyBerta <cyberta@riseup.net> | 2018-02-13 04:41:00 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2018-02-13 04:41:00 +0100 |
commit | 1da539ddf8c0f651dd9dd363641fd7641b5b13be (patch) | |
tree | 235875feea535f7709c376e6dfc2e8002f26587f /app/src/main/java/se/leap/bitmaskclient/eip | |
parent | b37575a680cd1e345339bdc5c4c4bc1137b2e4f1 (diff) |
#8831 add a progress animation to EipFragment and don't start blocking vpn when user triggered vpn start from UI
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/EIP.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index b8858c1e..894ad672 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -41,6 +41,7 @@ import static se.leap.bitmaskclient.Constants.EIP_ACTION_UPDATE; import static se.leap.bitmaskclient.Constants.EIP_RECEIVER; import static se.leap.bitmaskclient.Constants.EIP_REQUEST; import static se.leap.bitmaskclient.Constants.EIP_RESTART_ON_BOOT; +import static se.leap.bitmaskclient.Constants.EIP_TRIGGERED_FROM_UI; import static se.leap.bitmaskclient.Constants.PROVIDER_KEY; import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE; import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; @@ -93,7 +94,7 @@ public final class EIP extends IntentService { switch (action) { case EIP_ACTION_START: - startEIP(); + startEIP(!intent.hasExtra(EIP_TRIGGERED_FROM_UI)); break; case EIP_ACTION_START_ALWAYS_ON_VPN: startEIPAlwaysOnVpn(); @@ -118,13 +119,13 @@ public final class EIP extends IntentService { * Intent to {@link de.blinkt.openvpn.LaunchVPN}. * It also sets up early routes. */ - private void startEIP() { + private void startEIP(boolean earlyRoutes) { if (!preferences.getBoolean(EIP_RESTART_ON_BOOT, false)){ preferences.edit().putBoolean(EIP_RESTART_ON_BOOT, true).commit(); } if (gatewaysManager.isEmpty()) updateEIPService(); - if (!EipStatus.getInstance().isBlockingVpnEstablished()) { + if (!EipStatus.getInstance().isBlockingVpnEstablished() && earlyRoutes) { earlyRoutes(); } |