From 5cd8e4b40aab5512c7e9c1d606b841df39ae8c81 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 15 Jun 2012 15:56:30 +0200 Subject: Allow being by external app with profile name --- src/de/blinkt/openvpn/LaunchVPN.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/de/blinkt') 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(); -- cgit v1.2.3