From 5e7b841c8d5111e6b63e74944903a168939ca723 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 12 Aug 2012 18:52:38 +0200 Subject: Implement starting a VPN on boot. (closes issue #62) --- src/de/blinkt/openvpn/LaunchVPN.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/de/blinkt/openvpn/LaunchVPN.java') diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java index bfc6256e..a2a0de3f 100644 --- a/src/de/blinkt/openvpn/LaunchVPN.java +++ b/src/de/blinkt/openvpn/LaunchVPN.java @@ -75,12 +75,14 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { static final String EXTRA_KEY = "de.blinkt.openvpn.shortcutProfileUUID"; static final String EXTRA_NAME = "de.blinkt.openvpn.shortcutProfileName"; + public static final String EXTRA_HIDELOG = "de.blinkt.openvpn.showNoLogWindow";; private static final int START_VPN_PROFILE= 70; + private ProfileManager mPM; private VpnProfile mSelectedProfile; - + private boolean mhideLog=false; private boolean mCmfixed=false; @@ -102,10 +104,12 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { // If the intent is a request to create a shortcut, we'll do that and exit + if(Intent.ACTION_MAIN.equals(action)) { // we got called to be the starting point, most likely a shortcut String shortcutUUID = intent.getStringExtra( EXTRA_KEY); String shortcutName = intent.getStringExtra( EXTRA_NAME); + mhideLog = intent.getBooleanExtra(EXTRA_HIDELOG, false); VpnProfile profileToConnect = ProfileManager.get(shortcutUUID); if(shortcutName != null && profileToConnect ==null) @@ -122,18 +126,9 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { mSelectedProfile = profileToConnect; launchVPN(); - - } else if (Intent.ACTION_CREATE_SHORTCUT.equals(action)) { createListView(); } - - - - - - - } private void createListView() { @@ -318,7 +313,8 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { } else { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean showlogwindow = prefs.getBoolean("showlogwindow", true); - if(showlogwindow) + + if(!mhideLog && showlogwindow) showLogWindow(); new startOpenVpnThread().start(); } @@ -372,7 +368,6 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { } - if (intent != null) { // Start the query try { -- cgit v1.2.3