Clone the current VPN profile before updating the password

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.
This commit is contained in:
Tobias Brunner
2012-08-13 11:00:26 +02:00
parent 8d4eea5325
commit 6e04147743
@@ -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();
}