From 3b74a663480d9d241816f0eeaf44bb326c2b8b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 22 Apr 2014 11:42:36 +0200 Subject: Save eip status while updating state. This fixes https://leap.se/code/issues/5556 --- app/src/main/java/se/leap/openvpn/OpenVpnService.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/openvpn/OpenVpnService.java b/app/src/main/java/se/leap/openvpn/OpenVpnService.java index 475ed75b..ccac72c7 100644 --- a/app/src/main/java/se/leap/openvpn/OpenVpnService.java +++ b/app/src/main/java/se/leap/openvpn/OpenVpnService.java @@ -1,13 +1,8 @@ package se.leap.openvpn; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Vector; -import se.leap.bitmaskclient.Dashboard; -import se.leap.bitmaskclient.R; import android.annotation.TargetApi; +import android.app.Activity; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -20,11 +15,17 @@ import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.net.VpnService; import android.os.Binder; -import android.os.Handler.Callback; import android.os.Build; +import android.os.Handler.Callback; import android.os.IBinder; import android.os.Message; import android.os.ParcelFileDescriptor; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Vector; +import se.leap.bitmaskclient.Dashboard; +import se.leap.bitmaskclient.R; import se.leap.openvpn.OpenVPN.StateListener; public class OpenVpnService extends VpnService implements StateListener, Callback { @@ -482,6 +483,8 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac boolean persist = false; if (("NOPROCESS".equals(state) ) || ("EXITING").equals(state)){ showNotification(state, getString(R.string.eip_state_not_connected), ticker, false, 0, persist); + if(getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE) != null) + getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).edit().putBoolean(Dashboard.START_ON_BOOT, false).commit(); } else if (state.equals("GET_CONFIG") || state.equals("ASSIGN_IP")){ //don't show them in the notification message } -- cgit v1.2.3