android: Don't show the password dialog if not required
authorTobias Brunner <tobias@strongswan.org>
Tue, 28 Aug 2012 15:01:37 +0000 (17:01 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 31 Aug 2012 16:24:46 +0000 (18:24 +0200)
src/frontends/android/src/org/strongswan/android/ui/MainActivity.java

index 4a1bb6d..6ebfdca 100644 (file)
@@ -143,7 +143,8 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
                Bundle profileInfo = new Bundle();
                profileInfo.putLong(VpnProfileDataSource.KEY_ID, profile.getId());
                profileInfo.putString(VpnProfileDataSource.KEY_USERNAME, profile.getUsername());
-               if (profile.getPassword() == null)
+               if (profile.getVpnType().getRequiresUsernamePassword() &&
+                       profile.getPassword() == null)
                {
                        LoginDialog login = new LoginDialog();
                        login.setArguments(profileInfo);