summaryrefslogtreecommitdiffstats
path: root/tests/wifitests/src/com
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2019-11-26 11:26:08 -0800
committerxshu <xshu@google.com>2019-12-02 16:39:49 -0800
commit151e7bb7b5ac4633bdac673bba401e5b80edf03c (patch)
treee69124cfbb8d529d902ab570f3c4a80046a43b8c /tests/wifitests/src/com
parentfe3912fd156bc82e501dac14db9a07aa18a82acc (diff)
downloadandroid_frameworks_opt_net_wifi-151e7bb7b5ac4633bdac673bba401e5b80edf03c.tar.gz
android_frameworks_opt_net_wifi-151e7bb7b5ac4633bdac673bba401e5b80edf03c.tar.bz2
android_frameworks_opt_net_wifi-151e7bb7b5ac4633bdac673bba401e5b80edf03c.zip
Fix boot regression from KeyStore being slow
Getting the secret hashfunction from KeyStore had increased wifi service start time by ~20ms. Moving this to loadFromStore, which happens right after boot complete, should fix the problem. Bug: 144579147 Test: atest FrameworksWifiTests Change-Id: I478f1d558121e56e3d8bdeed4220eb8ba4ef097a Merged-In: I478f1d558121e56e3d8bdeed4220eb8ba4ef097a (cherry picked from: 0c6db026e4463abb4030cdf4f7813152f2dd1996)
Diffstat (limited to 'tests/wifitests/src/com')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index 95a1e84e0..a1b1a298c 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -296,6 +296,16 @@ public class WifiConfigManagerTest {
}
/**
+ * Verifies that the Mac randomization secret hashfunction is obtained after |loadFromStore|.
+ */
+ @Test
+ public void testMacHashIsObtainedAfterLoadFromStore() {
+ verify(mMacAddressUtil, never()).obtainMacRandHashFunction(anyInt());
+ assertTrue(mWifiConfigManager.loadFromStore());
+ verify(mMacAddressUtil).obtainMacRandHashFunction(anyInt());
+ }
+
+ /**
* Verifies the addition of a single network using
* {@link WifiConfigManager#addOrUpdateNetwork(WifiConfiguration, int)}
*/