From b4d39a8321a9c8f318ec157d7e3fd5b3725bd11c Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Thu, 3 Sep 2020 13:11:00 -0700 Subject: DeserializeData for new device without userDataStore Even new device without userDataStore, still do the deserialize to make the mUserDataLoaded flag to TRUE. Bug: 167647087 Test: atest com.android.server.wifi Merged-In: I16be0a27e2b3d7128dce64ce09c9143bd605f991 Change-Id: I16be0a27e2b3d7128dce64ce09c9143bd605f991 (cherry picked from commit 7a098b760707a5c55675e597d4bb4349e8511df5) --- .../wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java index ec2142dbf..77d5c1933 100644 --- a/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java @@ -17,6 +17,7 @@ package com.android.server.wifi; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -102,6 +103,17 @@ public class ImsiPrivacyProtectionExemptionStoreDataTest { assertSerializeDeserialize(imsiPrivacyProtectionExemptionMap); } + @Test + public void testDeserializeOnNewDeviceOrNewUser() throws Exception { + ArgumentCaptor deserializedNetworkSuggestionsMap = + ArgumentCaptor.forClass(Map.class); + mImsiPrivacyProtectionExemptionStoreData.deserializeData(null, 0, + WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null); + verify(mDataSource).fromDeserialized(deserializedNetworkSuggestionsMap.capture()); + assertTrue(deserializedNetworkSuggestionsMap.getValue().isEmpty()); + } + + private Map assertSerializeDeserialize( Map mImsiPrivacyProtectionExemptionMap) throws Exception { // Setup the data to serialize. -- cgit v1.2.3