android: Try to load existing user cert when importing VPN profile

This commit is contained in:
Tobias Brunner 2017-06-13 15:15:53 +02:00
parent 36e8f43617
commit bef8bc3aac
1 changed files with 9 additions and 1 deletions

View File

@ -387,7 +387,15 @@ public class VpnProfileImportActivity extends AppCompatActivity
mRemoteCertificate.setVisibility(mProfile.Certificate != null ? View.VISIBLE : View.GONE);
mImportUserCert.setVisibility(mProfile.PKCS12 != null ? View.VISIBLE : View.GONE);
updateUserCertView();
if (mProfile.getVpnType().has(VpnTypeFeature.CERTIFICATE))
{ /* try to load an existing certificate with the default name */
if (mUserCertLoading == null)
{
mUserCertLoading = getString(R.string.profile_cert_alias, mProfile.getName());
getLoaderManager().initLoader(USER_CERT_LOADER, null, mUserCertificateLoaderCallbacks);
}
updateUserCertView();
}
if (mProfile.Certificate != null)
{