From 5087fa81221937259f9275d6efa0cc1c7fad1454 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 16 Feb 2019 14:41:57 +0100 Subject: improve vpn shutdown regarding the new gateway selection (cherry picked from commit fcc04ae) --- app/src/main/java/se/leap/bitmaskclient/eip/EIP.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/eip/EIP.java') 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 0779c69d..29e2199f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -43,12 +43,13 @@ import java.util.Observer; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import de.blinkt.openvpn.LaunchVPN; +import de.blinkt.openvpn.core.ConnectionStatus; import de.blinkt.openvpn.core.IOpenVPNServiceInternal; import de.blinkt.openvpn.core.OpenVPNService; import de.blinkt.openvpn.core.ProfileManager; import de.blinkt.openvpn.core.VpnStatus; import se.leap.bitmaskclient.OnBootReceiver; +import se.leap.bitmaskclient.R; import static android.app.Activity.RESULT_CANCELED; import static android.app.Activity.RESULT_OK; @@ -215,13 +216,10 @@ public final class EIP extends JobIntentService implements Observer { * The {@link OnBootReceiver} will care if there is no profile. */ private void startEIPAlwaysOnVpn() { - Log.d(TAG, "startEIPAlwaysOnVpn vpn"); - GatewaysManager gatewaysManager = gatewaysFromPreferences(); Gateway gateway = gatewaysManager.select(0); if (gateway != null && gateway.getProfile() != null) { - Log.d(TAG, "startEIPAlwaysOnVpn eip launch closest gateway."); launchActiveGateway(gateway, 0); } else { Log.d(TAG, "startEIPAlwaysOnVpn no active profile available!"); @@ -257,6 +255,7 @@ public final class EIP extends JobIntentService implements Observer { * terminates EIP if currently connected or connecting */ private void stopEIP() { + VpnStatus.updateStateString("STOPPING", "STOPPING VPN", R.string.state_exiting, ConnectionStatus.LEVEL_STOPPING); int resultCode = stop() ? RESULT_OK : RESULT_CANCELED; tellToReceiverOrBroadcast(EIP_ACTION_STOP, resultCode); } -- cgit v1.2.3