Add systemProperty checking for updatable certs and modify tests.
Allows us to test bothe certificateStores within tests. Test: atest NetworkSecurityConfigTests Change-Id: Ie004d2158286b3035d08a381f06abb74c7f2a9f4
This commit is contained in:
@@ -39,9 +39,13 @@ public final class SystemCertificateSource extends DirectoryCertificateSource {
|
||||
}
|
||||
|
||||
private static File getDirectory() {
|
||||
// TODO(miguelaranda): figure out correct code path.
|
||||
if ((System.getProperty("system.certs.enabled") != null)
|
||||
&& (System.getProperty("system.certs.enabled")).equals("true")) {
|
||||
return new File(System.getenv("ANDROID_ROOT") + "/etc/security/cacerts");
|
||||
}
|
||||
File updatable_dir = new File("/apex/com.android.conscrypt/cacerts");
|
||||
if (updatable_dir.exists() && !(updatable_dir.list().length == 0)) {
|
||||
if (updatable_dir.exists()
|
||||
&& !(updatable_dir.list().length == 0)) {
|
||||
return updatable_dir;
|
||||
}
|
||||
return new File(System.getenv("ANDROID_ROOT") + "/etc/security/cacerts");
|
||||
|
||||
Reference in New Issue
Block a user