Clone the current VPN profile before updating the password
authorTobias Brunner <tobias@strongswan.org>
Tue, 7 Aug 2012 16:45:03 +0000 (18:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Aug 2012 09:00:26 +0000 (11:00 +0200)
Storing the password on the original object would be problematic in case
the user mistypes the password (no prompt would be shown the second time).

An alternative would be to just return the ID of the selected profile
and then fetch it from the database.

src/frontends/android/src/org/strongswan/android/ui/MainActivity.java

index 7387dab..50b2bfb 100644 (file)
@@ -179,6 +179,8 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
                                @Override
                                public void onClick(DialogInterface dialog, int whichButton)
                                {
+                                       /* let's work on a clone of the profile when updating the password */
+                                       activeProfile = activeProfile.clone();
                                        activeProfile.setPassword(password.getText().toString().trim());
                                        prepareVpnService();
                                }