summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/LaunchVPN.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-06-15 15:56:30 +0200
committerArne Schwabe <arne@rfc2549.org>2012-06-15 15:56:30 +0200
commit5cd8e4b40aab5512c7e9c1d606b841df39ae8c81 (patch)
tree03d0cd0d8a7d4ece4ff87e11622b7356fb8ea7cf /src/de/blinkt/openvpn/LaunchVPN.java
parent6709f66650ec4cc4a22d7bb4d0e809eab119cbe9 (diff)
Allow being by external app with profile name
Diffstat (limited to 'src/de/blinkt/openvpn/LaunchVPN.java')
-rw-r--r--src/de/blinkt/openvpn/LaunchVPN.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java
index 7b0f6e04..b4151c24 100644
--- a/src/de/blinkt/openvpn/LaunchVPN.java
+++ b/src/de/blinkt/openvpn/LaunchVPN.java
@@ -74,6 +74,8 @@ import android.widget.Toast;
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";
+
private static final int START_VPN_PROFILE= 70;
private ProfileManager mPM;
@@ -103,8 +105,12 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
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_KEY);
VpnProfile profileToConnect = ProfileManager.get(shortcutUUID);
+ if(shortcutName != null && profileToConnect ==null)
+ profileToConnect = ProfileManager.getInstance(this).getProfileByName(shortcutName);
+
if(profileToConnect ==null) {
Toast notfound = Toast.makeText(this, R.string.shortcut_profile_notfound, Toast.LENGTH_SHORT);
notfound.show();