diff options
author | Peter Qiu <zqiu@google.com> | 2017-03-16 23:40:08 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-16 23:40:08 +0000 |
commit | 8106f6ce9276d778becb1919b0cde389055b74e1 (patch) | |
tree | 699df7d49fb561b7e57c1a4d819f09e5a77e8961 | |
parent | e948a056688a360b3ab43f1bd79bb2ef8441248b (diff) | |
parent | 1395be1e703ec394127466dd3ce0eff30236d62c (diff) |
WifiConfigMangaer: use updated legacy Passpoint config indicator am: 018e39e2f6
am: 1395be1e70
Change-Id: I6cfc5d8a753a854310210ecb76d11c4173299e6b
4 files changed, 7 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 7c8cddae8..48dfc2fd1 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -34,7 +34,6 @@ import android.net.wifi.WifiEnterpriseConfig; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiScanner; -import android.os.Process; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; @@ -2666,17 +2665,14 @@ public class WifiConfigManager { // List of network IDs for legacy Passpoint configuration to be removed. List<Integer> legacyPasspointNetId = new ArrayList<>(); for (WifiConfiguration config : mConfiguredNetworks.valuesForAllUsers()) { - // Ignore ephemeral and temporary Passpoint networks. Temporary Passpoint networks - // are created by {@link PasspointNetworkEvaluator} using WIFI_UID. - if (config.ephemeral || (config.isPasspoint() - && config.creatorUid == Process.WIFI_UID)) { + // Ignore ephemeral networks and non-legacy Passpoint configurations. + if (config.ephemeral || (config.isPasspoint() && !config.isLegacyPasspointConfig)) { continue; } - // Legacy Passpoint configuration represented by WifiConfiguration is created by an - // actual user, so migrate the configurations owned by the current user to + // Migrate the legacy Passpoint configurations owned by the current user to // {@link PasspointManager}. - if (config.isPasspoint() && WifiConfigurationUtil.doesUidBelongToAnyProfile( + if (config.isLegacyPasspointConfig && WifiConfigurationUtil.doesUidBelongToAnyProfile( config.creatorUid, mUserManager.getProfiles(mCurrentUserId))) { legacyPasspointNetId.add(config.networkId); // Migrate the legacy Passpoint configuration and add it to PasspointManager. diff --git a/service/java/com/android/server/wifi/WifiConfigStoreLegacy.java b/service/java/com/android/server/wifi/WifiConfigStoreLegacy.java index e7a7335d7..42a91de67 100644 --- a/service/java/com/android/server/wifi/WifiConfigStoreLegacy.java +++ b/service/java/com/android/server/wifi/WifiConfigStoreLegacy.java @@ -226,6 +226,7 @@ public class WifiConfigStoreLegacy { // Update the missing Passpoint configuration fields to this WifiConfiguration. LegacyPasspointConfig passpointConfig = passpointConfigMap.get(fqdn); + wifiConfig.isLegacyPasspointConfig = true; wifiConfig.FQDN = fqdn; wifiConfig.providerFriendlyName = passpointConfig.mFriendlyName; if (passpointConfig.mRoamingConsortiumOis != null) { diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java index 5c78d0de3..61c74180e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java @@ -2113,6 +2113,7 @@ public class WifiConfigManagerTest { final WifiConfiguration passpointConfig = WifiConfigurationTestUtil.createPasspointNetwork(); passpointConfig.creatorUid = UserHandle.getUid(user1, appId); + passpointConfig.isLegacyPasspointConfig = true; // Set up the shared store data to contain one legacy Passpoint configuration. List<WifiConfiguration> sharedNetworks = new ArrayList<WifiConfiguration>() { diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java index d30ad57de..4b4e875a1 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java @@ -142,6 +142,7 @@ public class WifiConfigStoreLegacyTest { WifiConfigStoreLegacy.WifiConfigStoreDataLegacy storeData = mWifiConfigStore.read(); // Update the expected configuration for Passpoint network. + passpointNetwork.isLegacyPasspointConfig = true; passpointNetwork.FQDN = fqdn; passpointNetwork.providerFriendlyName = providerFriendlyName; passpointNetwork.roamingConsortiumIds = roamingConsortiumIds; |