From 35eeb926e9b2f875f6c6d78896634c9b336fd7df Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 26 Oct 2018 17:51:39 +0000 Subject: [PATCH] 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/1299610 Reviewed-by: Ryan Sleevi Commit-Queue: David Benjamin Cr-Commit-Position: refs/heads/master@{#603141} --- net/android/java/src/org/chromium/net/X509Util.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java index b7111f131a04f..bcd475e7280e4 100644 --- a/net/android/java/src/org/chromium/net/X509Util.java +++ b/net/android/java/src/org/chromium/net/X509Util.java @@ -199,9 +199,8 @@ public List 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; @@ -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) {