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

This commit is contained in:
Tobias Brunner
2017-07-03 10:27:50 +02:00
parent 36e8f43617
commit bef8bc3aac
@@ -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)
{