diff options
author | Roshan Pius <rpius@google.com> | 2020-03-17 00:26:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-17 00:26:28 +0000 |
commit | bb934a070ccace84041191a25cc405fa5ffaec31 (patch) | |
tree | d8e5510be00aa086abfe28c4e8173b87c545d887 | |
parent | 5189259cfb40237570b3db131712c22fe7860b75 (diff) | |
parent | 92abc19028801ae105e2f4f4046229ebbcc1d98e (diff) |
Merge "WifiConfigStore: Remove all usage of WifiMigration.loadFromStore" into rvc-dev
29 files changed, 66 insertions, 271 deletions
diff --git a/service/java/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreData.java b/service/java/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreData.java index 065ccf1db..acfba80c5 100644 --- a/service/java/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreData.java +++ b/service/java/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreData.java @@ -88,8 +88,7 @@ public class ImsiPrivacyProtectionExemptionStoreData implements WifiConfigStore. @Override public void deserializeData(XmlPullParser in, int outerTagDepth, int version, - WifiConfigStoreEncryptionUtil encryptionUtil, - WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/service/java/com/android/server/wifi/NetworkListStoreData.java b/service/java/com/android/server/wifi/NetworkListStoreData.java index 4c2bf7782..33c511ba4 100644 --- a/service/java/com/android/server/wifi/NetworkListStoreData.java +++ b/service/java/com/android/server/wifi/NetworkListStoreData.java @@ -18,7 +18,6 @@ package com.android.server.wifi; import static com.android.server.wifi.WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION; -import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.net.IpConfiguration; @@ -82,18 +81,8 @@ public abstract class NetworkListStoreData implements WifiConfigStore.StoreData @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { - // Check if we have data to migrate from OEM, if yes skip loading the section from the file. - List<WifiConfiguration> oemMigratedConfigurations = - storeMigrationDataHolder.getUserSavedNetworks(); - if (oemMigratedConfigurations != null) { - Log.i(TAG, "Loading data from OEM migration hook"); - mConfigurations = oemMigratedConfigurations; - return; - } - // Ignore empty reads. if (in == null) { return; diff --git a/service/java/com/android/server/wifi/NetworkRequestStoreData.java b/service/java/com/android/server/wifi/NetworkRequestStoreData.java index 7d06a70e1..763f267b9 100644 --- a/service/java/com/android/server/wifi/NetworkRequestStoreData.java +++ b/service/java/com/android/server/wifi/NetworkRequestStoreData.java @@ -16,7 +16,6 @@ package com.android.server.wifi; -import android.annotation.NonNull; import android.annotation.Nullable; import android.net.MacAddress; import android.util.Log; @@ -99,8 +98,7 @@ public class NetworkRequestStoreData implements WifiConfigStore.StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java b/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java index 169e87db9..8de575888 100644 --- a/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java +++ b/service/java/com/android/server/wifi/NetworkSuggestionStoreData.java @@ -18,7 +18,6 @@ package com.android.server.wifi; import static com.android.server.wifi.WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION; -import android.annotation.NonNull; import android.annotation.Nullable; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiEnterpriseConfig; @@ -121,8 +120,7 @@ public class NetworkSuggestionStoreData implements WifiConfigStore.StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/service/java/com/android/server/wifi/RandomizedMacStoreData.java b/service/java/com/android/server/wifi/RandomizedMacStoreData.java index 8c7c9bd83..a03be6056 100644 --- a/service/java/com/android/server/wifi/RandomizedMacStoreData.java +++ b/service/java/com/android/server/wifi/RandomizedMacStoreData.java @@ -16,7 +16,6 @@ package com.android.server.wifi; -import android.annotation.NonNull; import android.annotation.Nullable; import android.util.Log; @@ -57,8 +56,7 @@ public class RandomizedMacStoreData implements WifiConfigStore.StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/service/java/com/android/server/wifi/SoftApStoreData.java b/service/java/com/android/server/wifi/SoftApStoreData.java index 299f51507..ac32ae66a 100644 --- a/service/java/com/android/server/wifi/SoftApStoreData.java +++ b/service/java/com/android/server/wifi/SoftApStoreData.java @@ -16,7 +16,6 @@ package com.android.server.wifi; -import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.net.MacAddress; @@ -143,18 +142,8 @@ public class SoftApStoreData implements WifiConfigStore.StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { - // Check if we have data to migrate from OEM, if yes skip loading the section from the file. - SoftApConfiguration oemMigratedConfiguration = - storeMigrationDataHolder.getUserSoftApConfiguration(); - if (oemMigratedConfiguration != null) { - Log.i(TAG, "Loading data from OEM migration hook"); - mDataSource.fromDeserialized(oemMigratedConfiguration); - return; - } - // Ignore empty reads. if (in == null) { return; diff --git a/service/java/com/android/server/wifi/SsidSetStoreData.java b/service/java/com/android/server/wifi/SsidSetStoreData.java index e5636f603..e3374ddbe 100644 --- a/service/java/com/android/server/wifi/SsidSetStoreData.java +++ b/service/java/com/android/server/wifi/SsidSetStoreData.java @@ -16,7 +16,6 @@ package com.android.server.wifi; -import android.annotation.NonNull; import android.annotation.Nullable; import android.text.TextUtils; import android.util.Log; @@ -91,8 +90,7 @@ public class SsidSetStoreData implements WifiConfigStore.StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/service/java/com/android/server/wifi/WakeupConfigStoreData.java b/service/java/com/android/server/wifi/WakeupConfigStoreData.java index f828930b6..074393b81 100644 --- a/service/java/com/android/server/wifi/WakeupConfigStoreData.java +++ b/service/java/com/android/server/wifi/WakeupConfigStoreData.java @@ -16,7 +16,6 @@ package com.android.server.wifi; -import android.annotation.NonNull; import android.annotation.Nullable; import android.util.ArraySet; import android.util.Log; @@ -147,8 +146,7 @@ public class WakeupConfigStoreData implements StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { if (!mHasBeenRead) { Log.d(TAG, "WifiWake user data has been read"); diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index f2f48be1f..b5c3534cc 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -190,7 +190,6 @@ public class WifiConfigStore { */ private final Clock mClock; private final WifiMetrics mWifiMetrics; - private final WifiConfigStoreMigrationDataHolder mStoreMigrationDataHolder; /** * Shared config store file instance. There are 2 shared store files: * {@link #STORE_FILE_NAME_SHARED_GENERAL} & {@link #STORE_FILE_NAME_SHARED_SOFTAP}. @@ -236,20 +235,17 @@ public class WifiConfigStore { * @param handler handler instance to post alarm timeouts to. * @param clock clock instance to retrieve timestamps for alarms. * @param wifiMetrics Metrics instance. - * @param storeMigrationDataHolder Needed for migration data out of OEM stores. * @param sharedStores List of {@link StoreFile} instances pointing to the shared store files. * This should be retrieved using {@link #createSharedFiles(boolean)} * method. */ public WifiConfigStore(Context context, Handler handler, Clock clock, WifiMetrics wifiMetrics, - WifiConfigStoreMigrationDataHolder storeMigrationDataHolder, List<StoreFile> sharedStores) { mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); mEventHandler = handler; mClock = clock; mWifiMetrics = wifiMetrics; - mStoreMigrationDataHolder = storeMigrationDataHolder; mStoreDataList = new ArrayList<>(); // Initialize the store files. @@ -572,8 +568,6 @@ public class WifiConfigStore { } catch (ArithmeticException e) { // Silently ignore on any overflow errors. } - // Read is complete, go ahead and remove any OEM config stores. - mStoreMigrationDataHolder.removeStoreIfPresent(); Log.d(TAG, "Reading from all stores completed in " + readTime + " ms."); } @@ -622,7 +616,7 @@ public class WifiConfigStore { @Version int version, @NonNull WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { for (StoreData storeData : storeDataSet) { - storeData.deserializeData(null, 0, version, encryptionUtil, mStoreMigrationDataHolder); + storeData.deserializeData(null, 0, version, encryptionUtil); } } @@ -677,7 +671,7 @@ public class WifiConfigStore { continue; } storeData.deserializeData(in, rootTagDepth + 1, version, - storeFile.getEncryptionUtil(), mStoreMigrationDataHolder); + storeFile.getEncryptionUtil()); storeDatasInvoked.add(storeData); } // Inform all the other registered store data clients that there is nothing in the store @@ -877,14 +871,12 @@ public class WifiConfigStore { * @param outerTagDepth The depth of the outer tag in the XML document * @param version Version of config store file. * @param encryptionUtil Utility to help decrypt any credential data. - * @param storeMigrationDataHolder Needed for migration data out of OEM stores. * * Note: This will be invoked every time a store file is read, even if there is nothing * in the store for them. */ void deserializeData(@Nullable XmlPullParser in, int outerTagDepth, @Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException; /** diff --git a/service/java/com/android/server/wifi/WifiConfigStoreMigrationDataHolder.java b/service/java/com/android/server/wifi/WifiConfigStoreMigrationDataHolder.java deleted file mode 100644 index 7ecae0f1f..000000000 --- a/service/java/com/android/server/wifi/WifiConfigStoreMigrationDataHolder.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.server.wifi; - -import android.annotation.Nullable; -import android.net.wifi.SoftApConfiguration; -import android.net.wifi.WifiConfiguration; -import android.net.wifi.WifiMigration; -import android.net.wifi.WifiMigration.ConfigStoreMigrationData; - -import java.util.List; - -/** - * Caches the data migrated out of OEM config store. This class helps to avoid invoking the - * {@link WifiMigration#loadFromConfigStore()} multiple times from different instances of - * {@link WifiConfigStore.StoreData}. - * - */ -public class WifiConfigStoreMigrationDataHolder { - private ConfigStoreMigrationData mData; - private boolean mLoaded = false; - - private void loadMigrationData() { - if (!mLoaded) { - mData = WifiMigration.loadFromConfigStore(); - mLoaded = true; - } - } - - /** - * Helper method to load saved network configuration from OEM migration code. - */ - @Nullable - public List<WifiConfiguration> getUserSavedNetworks() { - loadMigrationData(); - if (mData == null) return null; - return mData.getUserSavedNetworkConfigurations(); - } - - /** - * Helper method to load saved softap configuration from OEM migration code. - */ - @Nullable - public SoftApConfiguration getUserSoftApConfiguration() { - loadMigrationData(); - if (mData == null) return null; - return mData.getUserSoftApConfiguration(); - } - - /** - * Check if there was any data to be migrated. If yes, then go ahead and invoke the API - * to remove the stores now. - */ - public void removeStoreIfPresent() { - if (mLoaded && mData != null) { - WifiMigration.removeConfigStore(); - } - } -} diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java index 865c1a0cb..87e161612 100644 --- a/service/java/com/android/server/wifi/WifiInjector.java +++ b/service/java/com/android/server/wifi/WifiInjector.java @@ -157,7 +157,6 @@ public class WifiInjector { private final ThroughputPredictor mThroughputPredictor; private NetdWrapper mNetdWrapper; private final WifiHealthMonitor mWifiHealthMonitor; - private final WifiConfigStoreMigrationDataHolder mOemConfigStoreMigrationDataHolder; private final WifiSettingsConfigStore mSettingsConfigStore; private final WifiScanAlwaysAvailableSettingsCompatibility mWifiScanAlwaysAvailableSettingsCompatibility; @@ -248,9 +247,7 @@ public class WifiInjector { mKeyStore = keyStore; mWifiKeyStore = new WifiKeyStore(mKeyStore); // New config store - mOemConfigStoreMigrationDataHolder = new WifiConfigStoreMigrationDataHolder(); mWifiConfigStore = new WifiConfigStore(mContext, wifiHandler, mClock, mWifiMetrics, - mOemConfigStoreMigrationDataHolder, WifiConfigStore.createSharedFiles(mFrameworkFacade.isNiapModeOn(mContext))); SubscriptionManager subscriptionManager = mContext.getSystemService(SubscriptionManager.class); diff --git a/service/java/com/android/server/wifi/WifiSettingsConfigStore.java b/service/java/com/android/server/wifi/WifiSettingsConfigStore.java index 7a1931cf2..872d0d437 100644 --- a/service/java/com/android/server/wifi/WifiSettingsConfigStore.java +++ b/service/java/com/android/server/wifi/WifiSettingsConfigStore.java @@ -327,8 +327,7 @@ public class WifiSettingsConfigStore { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { if (in == null) { // Empty read triggers the migration since it indicates that there is no settings diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreData.java b/service/java/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreData.java index fe69bcc27..b956983c4 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreData.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreData.java @@ -16,12 +16,10 @@ package com.android.server.wifi.hotspot2; -import android.annotation.NonNull; import android.annotation.Nullable; import android.util.Log; import com.android.server.wifi.WifiConfigStore; -import com.android.server.wifi.WifiConfigStoreMigrationDataHolder; import com.android.server.wifi.util.WifiConfigStoreEncryptionUtil; import com.android.server.wifi.util.XmlUtil; @@ -88,8 +86,7 @@ public class PasspointConfigSharedStoreData implements WifiConfigStore.StoreData @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointConfigUserStoreData.java b/service/java/com/android/server/wifi/hotspot2/PasspointConfigUserStoreData.java index 84c8be706..e7de22f55 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointConfigUserStoreData.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointConfigUserStoreData.java @@ -16,14 +16,12 @@ package com.android.server.wifi.hotspot2; -import android.annotation.NonNull; import android.annotation.Nullable; import android.net.wifi.hotspot2.PasspointConfiguration; import android.text.TextUtils; import android.util.Log; import com.android.server.wifi.WifiConfigStore; -import com.android.server.wifi.WifiConfigStoreMigrationDataHolder; import com.android.server.wifi.WifiKeyStore; import com.android.server.wifi.util.TelephonyUtil; import com.android.server.wifi.util.WifiConfigStoreEncryptionUtil; @@ -118,8 +116,7 @@ public class PasspointConfigUserStoreData implements WifiConfigStore.StoreData { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, @WifiConfigStore.Version int version, - @Nullable WifiConfigStoreEncryptionUtil encryptionUtil, - @NonNull WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + @Nullable WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { // Ignore empty reads. if (in == null) { diff --git a/tests/wifitests/Android.bp b/tests/wifitests/Android.bp index 920bec2e0..4d808b70c 100644 --- a/tests/wifitests/Android.bp +++ b/tests/wifitests/Android.bp @@ -411,9 +411,6 @@ android_test { "com.android.server.wifi.WifiConfigStore", "com.android.server.wifi.WifiConfigStore$*", "com.android.server.wifi.WifiConfigStore.**", - "com.android.server.wifi.WifiConfigStoreMigrationDataHolder", - "com.android.server.wifi.WifiConfigStoreMigrationDataHolder$*", - "com.android.server.wifi.WifiConfigStoreMigrationDataHolder.**", "com.android.server.wifi.WifiConfigurationUtil", "com.android.server.wifi.WifiConfigurationUtil$*", "com.android.server.wifi.WifiConfigurationUtil.**", diff --git a/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java index e75fd2736..f9e05cb32 100644 --- a/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java @@ -17,7 +17,6 @@ package com.android.server.wifi; import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -72,8 +71,7 @@ public class ImsiPrivacyProtectionExemptionStoreDataTest { final ByteArrayInputStream inputStream = new ByteArrayInputStream(data); in.setInput(inputStream, StandardCharsets.UTF_8.name()); mImsiPrivacyProtectionExemptionStoreData.deserializeData(in, in.getDepth(), - WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null, - mock(WifiConfigStoreMigrationDataHolder.class)); + WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null); } /** diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java index d9b711df3..88bcc92a6 100644 --- a/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/NetworkListStoreDataTest.java @@ -255,14 +255,12 @@ public class NetworkListStoreDataTest extends WifiBaseTest { private NetworkListSharedStoreData mNetworkListSharedStoreData; @Mock private Context mContext; @Mock private PackageManager mPackageManager; - @Mock WifiConfigStoreMigrationDataHolder mWifiConfigStoreMigrationDataHolder; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); when(mContext.getPackageManager()).thenReturn(mPackageManager); when(mPackageManager.getNameForUid(anyInt())).thenReturn(TEST_CREATOR_NAME); - when(mWifiConfigStoreMigrationDataHolder.getUserSavedNetworks()).thenReturn(null); mNetworkListSharedStoreData = new NetworkListSharedStoreData(mContext); } @@ -294,8 +292,7 @@ public class NetworkListStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mNetworkListSharedStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mWifiConfigStoreMigrationDataHolder); + mock(WifiConfigStoreEncryptionUtil.class)); return mNetworkListSharedStoreData.getConfigurations(); } @@ -694,21 +691,6 @@ public class NetworkListStoreDataTest extends WifiBaseTest { } /** - * Verify that the shared configurations deserialized correctly from OEM migration hook. - */ - @Test - public void deserializeSharedConfigurationsFromOemConfigStoreMigration() throws Exception { - List<WifiConfiguration> oemUserSavedNetworks = getTestNetworksConfig(true /* shared */); - when(mWifiConfigStoreMigrationDataHolder.getUserSavedNetworks()) - .thenReturn(oemUserSavedNetworks); - - // File contents are ignored. - List<WifiConfiguration> parsedNetworks = deserializeData("".getBytes()); - WifiConfigurationTestUtil.assertConfigurationsEqualForConfigStore( - oemUserSavedNetworks, parsedNetworks); - } - - /** * The WifiConfiguration store should follow the sort of the SSIDs. */ @Test diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java index 1b5373e01..7f7c770f2 100644 --- a/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java @@ -95,8 +95,7 @@ public class NetworkRequestStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mNetworkRequestStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } /** diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java index 1a5044754..74c5d3c55 100644 --- a/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/NetworkSuggestionStoreDataTest.java @@ -266,8 +266,7 @@ public class NetworkSuggestionStoreDataTest extends WifiBaseTest { final ByteArrayInputStream inputStream = new ByteArrayInputStream(data); in.setInput(inputStream, StandardCharsets.UTF_8.name()); mNetworkSuggestionStoreData.deserializeData(in, in.getDepth(), - WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null, - mock(WifiConfigStoreMigrationDataHolder.class)); + WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null); } /** diff --git a/tests/wifitests/src/com/android/server/wifi/RandomizedMacStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/RandomizedMacStoreDataTest.java index 948d2ae92..ad27814a0 100644 --- a/tests/wifitests/src/com/android/server/wifi/RandomizedMacStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/RandomizedMacStoreDataTest.java @@ -81,8 +81,7 @@ public class RandomizedMacStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mRandomizedMacStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); return mRandomizedMacStoreData.getMacMapping(); } diff --git a/tests/wifitests/src/com/android/server/wifi/SoftApStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/SoftApStoreDataTest.java index 037379f96..04955f806 100644 --- a/tests/wifitests/src/com/android/server/wifi/SoftApStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SoftApStoreDataTest.java @@ -186,7 +186,6 @@ public class SoftApStoreDataTest extends WifiBaseTest { @Mock private Context mContext; @Mock SoftApStoreData.DataSource mDataSource; - @Mock WifiConfigStoreMigrationDataHolder mWifiConfigStoreMigrationDataHolder; @Mock private WifiMigration.SettingsMigrationData mOemMigrationData; MockitoSession mSession; SoftApStoreData mSoftApStoreData; @@ -232,23 +231,6 @@ public class SoftApStoreDataTest extends WifiBaseTest { return outputStream.toByteArray(); } - private SoftApConfiguration createDefaultTestSoftApConfiguration() { - SoftApConfiguration.Builder softApConfigBuilder = new SoftApConfiguration.Builder(); - softApConfigBuilder.setSsid(TEST_SSID); - softApConfigBuilder.setBssid(MacAddress.fromString(TEST_BSSID)); - softApConfigBuilder.setPassphrase(TEST_PASSPHRASE, - SoftApConfiguration.SECURITY_TYPE_WPA2_PSK); - softApConfigBuilder.setBand(TEST_BAND); - softApConfigBuilder.setClientControlByUserEnabled(TEST_CLIENT_CONTROL_BY_USER); - softApConfigBuilder.setMaxNumberOfClients(TEST_MAX_NUMBER_OF_CLIENTS); - softApConfigBuilder.setAutoShutdownEnabled(true); - softApConfigBuilder.setShutdownTimeoutMillis(TEST_SHUTDOWN_TIMEOUT_MILLIS); - softApConfigBuilder.setBlockedClientList(TEST_BLOCKEDLIST); - softApConfigBuilder.setAllowedClientList(TEST_ALLOWEDLIST); - return softApConfigBuilder.build(); - } - - /** * Helper function for parsing configuration data from a XML block. * @@ -261,8 +243,7 @@ public class SoftApStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mSoftApStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mWifiConfigStoreMigrationDataHolder); + mock(WifiConfigStoreEncryptionUtil.class)); } /** @@ -296,8 +277,20 @@ public class SoftApStoreDataTest extends WifiBaseTest { */ @Test public void serializeSoftAp() throws Exception { - SoftApConfiguration softApConfig = createDefaultTestSoftApConfiguration(); - when(mDataSource.toSerialize()).thenReturn(softApConfig); + SoftApConfiguration.Builder softApConfigBuilder = new SoftApConfiguration.Builder(); + softApConfigBuilder.setSsid(TEST_SSID); + softApConfigBuilder.setBssid(MacAddress.fromString(TEST_BSSID)); + softApConfigBuilder.setPassphrase(TEST_PASSPHRASE, + SoftApConfiguration.SECURITY_TYPE_WPA2_PSK); + softApConfigBuilder.setBand(TEST_BAND); + softApConfigBuilder.setClientControlByUserEnabled(TEST_CLIENT_CONTROL_BY_USER); + softApConfigBuilder.setMaxNumberOfClients(TEST_MAX_NUMBER_OF_CLIENTS); + softApConfigBuilder.setAutoShutdownEnabled(true); + softApConfigBuilder.setShutdownTimeoutMillis(TEST_SHUTDOWN_TIMEOUT_MILLIS); + softApConfigBuilder.setAllowedClientList(TEST_ALLOWEDLIST); + softApConfigBuilder.setBlockedClientList(TEST_BLOCKEDLIST); + + when(mDataSource.toSerialize()).thenReturn(softApConfigBuilder.build()); byte[] actualData = serializeData(); assertEquals(TEST_SOFTAP_CONFIG_XML_STRING_WITH_ALL_CONFIG, new String(actualData)); } @@ -513,37 +506,6 @@ public class SoftApStoreDataTest extends WifiBaseTest { } /** - * Verify that the store data is deserialized correctly from OEM migration hook. - * - * @throws Exception - */ - @Test - public void deserializeSoftApFromOemConfigStoreMigration() throws Exception { - SoftApConfiguration oemSoftApConfig = createDefaultTestSoftApConfiguration(); - when(mWifiConfigStoreMigrationDataHolder.getUserSoftApConfiguration()) - .thenReturn(oemSoftApConfig); - - // File contents are ignored. - deserializeData("".getBytes()); - - ArgumentCaptor<SoftApConfiguration> softapConfigCaptor = - ArgumentCaptor.forClass(SoftApConfiguration.class); - verify(mDataSource).fromDeserialized(softapConfigCaptor.capture()); - SoftApConfiguration softApConfig = softapConfigCaptor.getValue(); - assertNotNull(softApConfig); - assertEquals(softApConfig.getSsid(), TEST_SSID); - assertEquals(softApConfig.getPassphrase(), TEST_PASSPHRASE); - assertEquals(softApConfig.getSecurityType(), SoftApConfiguration.SECURITY_TYPE_WPA2_PSK); - assertEquals(softApConfig.isHiddenSsid(), TEST_HIDDEN); - assertEquals(softApConfig.getBand(), TEST_BAND); - assertEquals(softApConfig.isClientControlByUserEnabled(), TEST_CLIENT_CONTROL_BY_USER); - assertEquals(softApConfig.getMaxNumberOfClients(), TEST_MAX_NUMBER_OF_CLIENTS); - assertEquals(softApConfig.getShutdownTimeoutMillis(), TEST_SHUTDOWN_TIMEOUT_MILLIS); - assertEquals(softApConfig.getBlockedClientList(), TEST_BLOCKEDLIST); - assertEquals(softApConfig.getAllowedClientList(), TEST_ALLOWEDLIST); - } - - /** * Verify that the store data is deserialized correctly using the predefined test XML data * when the auto shutdown tag is retrieved from * {@link WifiMigration.loadFromSettings(Context)}. @@ -602,5 +564,4 @@ public class SoftApStoreDataTest extends WifiBaseTest { assertEquals(softApConfig.getBlockedClientList(), TEST_BLOCKEDLIST); assertEquals(softApConfig.getAllowedClientList(), TEST_ALLOWEDLIST); } - } diff --git a/tests/wifitests/src/com/android/server/wifi/SsidSetStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/SsidSetStoreDataTest.java index 66afa8271..b3b8439f4 100644 --- a/tests/wifitests/src/com/android/server/wifi/SsidSetStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SsidSetStoreDataTest.java @@ -99,8 +99,7 @@ public class SsidSetStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mSsidSetStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } /** diff --git a/tests/wifitests/src/com/android/server/wifi/WakeupConfigStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/WakeupConfigStoreDataTest.java index baf43f5a7..cc7587a36 100644 --- a/tests/wifitests/src/com/android/server/wifi/WakeupConfigStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WakeupConfigStoreDataTest.java @@ -92,8 +92,7 @@ public class WakeupConfigStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mWakeupConfigData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } /** @@ -184,8 +183,7 @@ public class WakeupConfigStoreDataTest extends WifiBaseTest { public void hasBeenReadIsTrueWhenUserStoreIsLoaded() throws Exception { mWakeupConfigData.deserializeData(null /* in */, 0 /* outerTagDepth */, WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); assertTrue(mWakeupConfigData.hasBeenRead()); } diff --git a/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java b/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java index 0d3fdf6b6..4b97f69f7 100644 --- a/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java @@ -154,8 +154,7 @@ public class WakeupControllerTest extends WifiBaseTest { try { mWakeupConfigStoreData.deserializeData(null, 0, WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } catch (XmlPullParserException | IOException e) { // unreachable } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java index 9f749f579..066640679 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java @@ -157,7 +157,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { @Mock private Clock mClock; @Mock private WifiMetrics mWifiMetrics; @Mock private WifiConfigStoreEncryptionUtil mEncryptionUtil; - @Mock WifiConfigStoreMigrationDataHolder mWifiConfigStoreMigrationDataHolder; private MockStoreFile mSharedStore; private MockStoreFile mUserStore; private MockStoreFile mUserNetworkSuggestionsStore; @@ -185,7 +184,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { .thenReturn(new EncryptedData(new byte[0], new byte[0])); when(mEncryptionUtil.decrypt(any(EncryptedData.class))) .thenReturn(new byte[0]); - when(mWifiConfigStoreMigrationDataHolder.getUserSavedNetworks()).thenReturn(null); mSharedStore = new MockStoreFile(WifiConfigStore.STORE_FILE_SHARED_GENERAL); mUserStore = new MockStoreFile(WifiConfigStore.STORE_FILE_USER_GENERAL); mUserNetworkSuggestionsStore = @@ -205,7 +203,7 @@ public class WifiConfigStoreTest extends WifiBaseTest { setupMocks(); mWifiConfigStore = new WifiConfigStore(mContext, new Handler(mLooper.getLooper()), mClock, - mWifiMetrics, mWifiConfigStoreMigrationDataHolder, Arrays.asList(mSharedStore)); + mWifiMetrics, Arrays.asList(mSharedStore)); // Enable verbose logging before tests. mWifiConfigStore.enableVerboseLogging(true); } @@ -323,7 +321,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { mWifiConfigStore.read(); assertEquals(TEST_USER_DATA, mUserStoreData.getData()); assertEquals(TEST_SHARE_DATA, mSharedStoreData.getData()); - verify(mWifiConfigStoreMigrationDataHolder).removeStoreIfPresent(); } /** @@ -361,7 +358,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { mWifiConfigStore.read(); assertEquals("abcds", mSharedStoreData.getData()); assertEquals("asdfa", mUserStoreData.getData()); - verify(mWifiConfigStoreMigrationDataHolder).removeStoreIfPresent(); } @@ -391,7 +387,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { mWifiConfigStore.read(); assertEquals(TEST_USER_DATA, mUserStoreData.getData()); assertEquals(TEST_SHARE_DATA, mSharedStoreData.getData()); - verify(mWifiConfigStoreMigrationDataHolder).removeStoreIfPresent(); verify(mWifiMetrics, times(2)).noteWifiConfigStoreReadDuration(anyInt()); verify(mWifiMetrics).noteWifiConfigStoreWriteDuration(anyInt()); @@ -420,9 +415,9 @@ public class WifiConfigStoreTest extends WifiBaseTest { // Ensure that we got the call to deserialize empty shared data, but no user data. verify(sharedStoreData).resetData(); - verify(sharedStoreData).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(sharedStoreData).deserializeData(eq(null), anyInt(), anyInt(), any()); verify(userStoreData, never()).resetData(); - verify(userStoreData, never()).deserializeData(any(), anyInt(), anyInt(), any(), any()); + verify(userStoreData, never()).deserializeData(any(), anyInt(), anyInt(), any()); } /** @@ -449,9 +444,9 @@ public class WifiConfigStoreTest extends WifiBaseTest { // Ensure that we got the call to deserialize empty shared & user data. verify(userStoreData).resetData(); - verify(userStoreData).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(userStoreData).deserializeData(eq(null), anyInt(), anyInt(), any()); verify(sharedStoreData).resetData(); - verify(sharedStoreData).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(sharedStoreData).deserializeData(eq(null), anyInt(), anyInt(), any()); } /** @@ -608,9 +603,9 @@ public class WifiConfigStoreTest extends WifiBaseTest { mUserStore.storeRawDataToWrite(null); mWifiConfigStore.read(); - verify(storeData1).deserializeData(notNull(), anyInt(), anyInt(), any(), any()); - verify(storeData1, never()).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); - verify(storeData2).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(storeData1).deserializeData(notNull(), anyInt(), anyInt(), any()); + verify(storeData1, never()).deserializeData(eq(null), anyInt(), anyInt(), any()); + verify(storeData2).deserializeData(eq(null), anyInt(), anyInt(), any()); reset(storeData1, storeData2); // Scenario 2: StoreData2 in user store file. @@ -624,9 +619,9 @@ public class WifiConfigStoreTest extends WifiBaseTest { mUserStore.storeRawDataToWrite(fileContentsXmlStringWithOnlyStoreData2.getBytes()); mWifiConfigStore.read(); - verify(storeData1).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); - verify(storeData2).deserializeData(notNull(), anyInt(), anyInt(), any(), any()); - verify(storeData2, never()).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(storeData1).deserializeData(eq(null), anyInt(), anyInt(), any()); + verify(storeData2).deserializeData(notNull(), anyInt(), anyInt(), any()); + verify(storeData2, never()).deserializeData(eq(null), anyInt(), anyInt(), any()); reset(storeData1, storeData2); // Scenario 3: StoreData1 in shared store file & StoreData2 in user store file. @@ -640,10 +635,10 @@ public class WifiConfigStoreTest extends WifiBaseTest { mUserStore.storeRawDataToWrite(fileContentsXmlStringWithOnlyStoreData2.getBytes()); mWifiConfigStore.read(); - verify(storeData1).deserializeData(notNull(), anyInt(), anyInt(), any(), any()); - verify(storeData1, never()).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); - verify(storeData2).deserializeData(notNull(), anyInt(), anyInt(), any(), any()); - verify(storeData2, never()).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(storeData1).deserializeData(notNull(), anyInt(), anyInt(), any()); + verify(storeData1, never()).deserializeData(eq(null), anyInt(), anyInt(), any()); + verify(storeData2).deserializeData(notNull(), anyInt(), anyInt(), any()); + verify(storeData2, never()).deserializeData(eq(null), anyInt(), anyInt(), any()); reset(storeData1, storeData2); // Scenario 4: StoreData1 & StoreData2 in shared store file. @@ -658,10 +653,10 @@ public class WifiConfigStoreTest extends WifiBaseTest { mUserStore.storeRawDataToWrite(null); mWifiConfigStore.read(); - verify(storeData1).deserializeData(notNull(), anyInt(), anyInt(), any(), any()); - verify(storeData1, never()).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); - verify(storeData2).deserializeData(notNull(), anyInt(), anyInt(), any(), any()); - verify(storeData2, never()).deserializeData(eq(null), anyInt(), anyInt(), any(), any()); + verify(storeData1).deserializeData(notNull(), anyInt(), anyInt(), any()); + verify(storeData1, never()).deserializeData(eq(null), anyInt(), anyInt(), any()); + verify(storeData2).deserializeData(notNull(), anyInt(), anyInt(), any()); + verify(storeData2, never()).deserializeData(eq(null), anyInt(), anyInt(), any()); reset(storeData1, storeData2); } @@ -780,10 +775,10 @@ public class WifiConfigStoreTest extends WifiBaseTest { mWifiConfigStore.read(); verify(sharedStoreData, times(1)).deserializeData( any(XmlPullParser.class), anyInt(), - eq(WifiConfigStore.INITIAL_CONFIG_STORE_DATA_VERSION), any(), any()); + eq(WifiConfigStore.INITIAL_CONFIG_STORE_DATA_VERSION), any()); verify(userStoreData, times(1)).deserializeData( any(XmlPullParser.class), anyInt(), - eq(WifiConfigStore.INITIAL_CONFIG_STORE_DATA_VERSION), any(), any()); + eq(WifiConfigStore.INITIAL_CONFIG_STORE_DATA_VERSION), any()); } /** @@ -831,10 +826,10 @@ public class WifiConfigStoreTest extends WifiBaseTest { mWifiConfigStore.read(); verify(sharedStoreData, times(1)) .deserializeData(any(XmlPullParser.class), anyInt(), - eq(WifiConfigStore.INTEGRITY_CONFIG_STORE_DATA_VERSION), any(), any()); + eq(WifiConfigStore.INTEGRITY_CONFIG_STORE_DATA_VERSION), any()); verify(userStoreData, times(1)) .deserializeData(any(XmlPullParser.class), anyInt(), - eq(WifiConfigStore.INTEGRITY_CONFIG_STORE_DATA_VERSION), any(), any()); + eq(WifiConfigStore.INTEGRITY_CONFIG_STORE_DATA_VERSION), any()); } /** @@ -899,8 +894,7 @@ public class WifiConfigStoreTest extends WifiBaseTest { @Override public void deserializeData(XmlPullParser in, int outerTagDepth, int version, - WifiConfigStoreEncryptionUtil encryptionUtil, - WifiConfigStoreMigrationDataHolder storeMigrationDataHolder) + WifiConfigStoreEncryptionUtil encryptionUtil) throws XmlPullParserException, IOException { if (in == null) { return; diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java index c25648d53..7c7f369c9 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java @@ -2971,7 +2971,6 @@ public class WifiNetworkFactoryTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mNetworkRequestStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiSettingsConfigStoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiSettingsConfigStoreTest.java index e783b3766..2471e090e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiSettingsConfigStoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiSettingsConfigStoreTest.java @@ -121,8 +121,7 @@ public class WifiSettingsConfigStoreTest extends WifiBaseTest { XmlPullParser in = createSettingsTestXmlForParsing(WIFI_VERBOSE_LOGGING_ENABLED, true); storeDataCaptor.getValue().resetData(); - storeDataCaptor.getValue().deserializeData(in, in.getDepth(), -1, null, - mock(WifiConfigStoreMigrationDataHolder.class)); + storeDataCaptor.getValue().deserializeData(in, in.getDepth(), -1, null); assertTrue(mWifiSettingsConfigStore.get(WIFI_VERBOSE_LOGGING_ENABLED)); } diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java index 64b2460a2..3ee3c15f6 100644 --- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java @@ -26,7 +26,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.util.FastXmlSerializer; import com.android.server.wifi.WifiBaseTest; import com.android.server.wifi.WifiConfigStore; -import com.android.server.wifi.WifiConfigStoreMigrationDataHolder; import com.android.server.wifi.util.WifiConfigStoreEncryptionUtil; import org.junit.Before; @@ -82,8 +81,7 @@ public class PasspointConfigSharedStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mConfigStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } /** diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java index 0c00875b0..cfa6044f6 100644 --- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java @@ -37,7 +37,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.util.FastXmlSerializer; import com.android.server.wifi.WifiBaseTest; import com.android.server.wifi.WifiConfigStore; -import com.android.server.wifi.WifiConfigStoreMigrationDataHolder; import com.android.server.wifi.WifiKeyStore; import com.android.server.wifi.util.TelephonyUtil; import com.android.server.wifi.util.WifiConfigStoreEncryptionUtil; @@ -238,8 +237,7 @@ public class PasspointConfigUserStoreDataTest extends WifiBaseTest { in.setInput(inputStream, StandardCharsets.UTF_8.name()); mConfigStoreData.deserializeData(in, in.getDepth(), WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, - mock(WifiConfigStoreEncryptionUtil.class), - mock(WifiConfigStoreMigrationDataHolder.class)); + mock(WifiConfigStoreEncryptionUtil.class)); } /** |