summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/LaunchVPN.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-08-12 18:52:38 +0200
committerArne Schwabe <arne@rfc2549.org>2012-08-12 18:52:38 +0200
commitbbf93681fe1383c06edc47c89b50d444df57e56b (patch)
treedef0ecbcf1a22ccacbfcf604d6bd034e650031f6 /src/de/blinkt/openvpn/LaunchVPN.java
parent531aadf63b30cdde3604e583a3df03dcbd4521d8 (diff)
Implement starting a VPN on boot. (closes issue #62)
Diffstat (limited to 'src/de/blinkt/openvpn/LaunchVPN.java')
-rw-r--r--src/de/blinkt/openvpn/LaunchVPN.java19
1 files changed, 7 insertions, 12 deletions
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 {