diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-05-08 23:08:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-08 23:08:34 +0000 |
commit | 2c347cf23a20e8b408a4342eff4972851bd8bcff (patch) | |
tree | a9fdadbac3e6884a8cf395a6e635446def767b73 | |
parent | d246465c549e6c0e6f329174771b1d3279ae88a2 (diff) | |
parent | b7958677575af742e96aa782ebdd4ee0baba4dac (diff) |
Merge "When no data to load, still notify SuggestionManager data load finished" into rvc-dev
-rw-r--r-- | service/java/com/android/server/wifi/NetworkSuggestionStoreData.java | 3 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java b/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java index 8de575888..11067f62c 100644 --- a/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java +++ b/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java @@ -40,6 +40,7 @@ import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; import java.io.IOException; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -122,8 +123,8 @@ public class NetworkSuggestionStoreData implements WifiConfigStore.StoreData { @WifiConfigStore.Version int version, @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { - // Ignore empty reads. if (in == null) { + mDataSource.fromDeserialized(Collections.EMPTY_MAP); return; } mDataSource.fromDeserialized( diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java index 74c5d3c55..ad31533ba 100644 --- a/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java @@ -466,6 +466,13 @@ public class NetworkSuggestionStoreDataTest extends WifiBaseTest { assertEquals(networkSuggestion, deserializedSuggestion.wns); } + @Test + public void testDeserializeNullData() throws Exception { + mNetworkSuggestionStoreData.deserializeData(null, 0, + WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null); + verify(mDataSource).fromDeserialized(any()); + } + private Map<String, PerAppInfo> assertSerializeDeserialize( Map<String, PerAppInfo> networkSuggestionsMap) throws Exception { // Setup the data to serialize. |