Skip to content

Commit

Permalink
Set up trust store listener unconditionally.
Browse files Browse the repository at this point in the history
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/1299610
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603141}
  • Loading branch information
davidben authored and Commit Bot committed Oct 26, 2018
1 parent a823ccb commit 35eeb92
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/android/java/src/org/chromium/net/X509Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,8 @@ public List<X509Certificate> checkServerTrusted(
private static final Object sLock = new Object();

/**
* Allow disabling registering the observer and recording histograms for the certificate
* changes. Net unit tests do not load native libraries which prevent this to succeed. Moreover,
* the system does not allow to interact with the certificate store without user interaction.
* Allow disabling recording histograms for the certificate changes. Java unit tests do not load
* native libraries which prevent this from succeeding.
*/
private static boolean sDisableNativeCodeForTest;

Expand Down Expand Up @@ -268,7 +267,7 @@ private static void ensureInitializedLocked()
if (sTestTrustManager == null) {
sTestTrustManager = X509Util.createTrustManager(sTestKeyStore);
}
if (!sDisableNativeCodeForTest && sTrustStorageListener == null) {
if (sTrustStorageListener == null) {
sTrustStorageListener = new TrustStorageListener();
IntentFilter filter = new IntentFilter();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Expand Down

0 comments on commit 35eeb92

Please sign in to comment.