summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-04-22 11:42:36 +0200
committerParménides GV <parmegv@sdf.org>2014-04-22 11:42:36 +0200
commit3b74a663480d9d241816f0eeaf44bb326c2b8b9c (patch)
tree089415576569b2d0b70b5be94001cc96f58ac08a /app/src
parentb7d3a5a1582306e380ee07cb3c2a3066e16bcf1b (diff)
Save eip status while updating state.
This fixes https://leap.se/code/issues/5556
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/se/leap/openvpn/OpenVpnService.java17
1 files changed, 10 insertions, 7 deletions
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
}