Commit 35eeb926 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Set up trust store listener unconditionally.

After https://codereview.chromium.org/1476173006, it should work in
pure-Java setups too.

Bug: none
Change-Id: If6daf5346029a83ccfc73f7893587434533c5d40
Reviewed-on: https://chromium-review.googlesource.com/c/1299610Reviewed-by: default avatarRyan Sleevi <rsleevi@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603141}
parent a823ccb2
...@@ -199,9 +199,8 @@ public class X509Util { ...@@ -199,9 +199,8 @@ public class X509Util {
private static final Object sLock = new Object(); private static final Object sLock = new Object();
/** /**
* Allow disabling registering the observer and recording histograms for the certificate * Allow disabling recording histograms for the certificate changes. Java unit tests do not load
* changes. Net unit tests do not load native libraries which prevent this to succeed. Moreover, * native libraries which prevent this from succeeding.
* the system does not allow to interact with the certificate store without user interaction.
*/ */
private static boolean sDisableNativeCodeForTest; private static boolean sDisableNativeCodeForTest;
...@@ -268,7 +267,7 @@ public class X509Util { ...@@ -268,7 +267,7 @@ public class X509Util {
if (sTestTrustManager == null) { if (sTestTrustManager == null) {
sTestTrustManager = X509Util.createTrustManager(sTestKeyStore); sTestTrustManager = X509Util.createTrustManager(sTestKeyStore);
} }
if (!sDisableNativeCodeForTest && sTrustStorageListener == null) { if (sTrustStorageListener == null) {
sTrustStorageListener = new TrustStorageListener(); sTrustStorageListener = new TrustStorageListener();
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment