summaryrefslogtreecommitdiff
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
commit91a865d665fd055792810cfcad10391625df2f7b (patch)
tree2996bbbe440df3a99ed8deb2ef383e5ae306061b
parent0f4891bf42455d634e9b013e4bf09672ac1586d2 (diff)
Allow being by external app with profile name
-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();