On preview version of Android 11 I got an error when trying to install CA certificate:
Intent intent = new Intent("android.credentials.INSTALL");
intent.putExtra("name", getCertName());
intent.putExtra("CERT", getCert());
startActivity(intent);
The error message is:
Can't install CA certificates
CA certificates can put your privacy at risk and must be installed in Settings.
I haven't found nothing on Android documentation about this change. Any ideas? Any workarounds (except to install it manually from settings)?
UPDATE (28/4):
Found a bug in issuetracker: https://issuetracker.google.com/issues/151858120
I have also face same issue.
Please follow below steps in android 11 or 11+.
In Android 11, to install a CA certificate, users need to manually: