Loading packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +6 −3 Original line number Diff line number Diff line Loading @@ -234,10 +234,13 @@ public class AccessPoint implements Comparable<AccessPoint> { } public boolean matches(WifiConfiguration config) { if (config.isPasspoint() && mConfig != null && mConfig.isPasspoint()) if (config.isPasspoint() && mConfig != null && mConfig.isPasspoint()) { return config.FQDN.equals(mConfig.providerFriendlyName); else return ssid.equals(removeDoubleQuotes(config.SSID)) && security == getSecurity(config); } else { return ssid.equals(removeDoubleQuotes(config.SSID)) && security == getSecurity(config) && (mConfig == null || mConfig.shared == config.shared); } } public WifiConfiguration getConfig() { Loading wifi/java/android/net/wifi/WifiConfiguration.java +23 −21 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.net.ProxyInfo; import android.net.StaticIpConfiguration; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; import android.text.TextUtils; import java.util.Arrays; Loading Loading @@ -325,6 +326,13 @@ public class WifiConfiguration implements Parcelable { */ public long[] roamingConsortiumIds; /** * @hide * This network configuration is visible to and usable by other users on the * same device. */ public boolean shared; /** * @hide */ Loading Loading @@ -1103,6 +1111,7 @@ public class WifiConfiguration implements Parcelable { mIpConfiguration = new IpConfiguration(); lastUpdateUid = -1; creatorUid = -1; shared = true; } /** Loading Loading @@ -1488,6 +1497,9 @@ public class WifiConfiguration implements Parcelable { key = mCachedConfigKey; } else if (providerFriendlyName != null) { key = FQDN + KeyMgmt.strings[KeyMgmt.WPA_EAP]; if (!shared) { key += "-" + Integer.toString(UserHandle.getUserId(creatorUid)); } } else { if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) { key = SSID + KeyMgmt.strings[KeyMgmt.WPA_PSK]; Loading @@ -1499,6 +1511,9 @@ public class WifiConfiguration implements Parcelable { } else { key = SSID + KeyMgmt.strings[KeyMgmt.NONE]; } if (!shared) { key += "-" + Integer.toString(UserHandle.getUserId(creatorUid)); } mCachedConfigKey = key; } return key; Loading @@ -1511,27 +1526,6 @@ public class WifiConfiguration implements Parcelable { return configKey(false); } /** @hide * return the config key string based on a scan result */ static public String configKey(ScanResult result) { String key = "\"" + result.SSID + "\""; if (result.capabilities.contains("WEP")) { key = key + "-WEP"; } if (result.capabilities.contains("PSK")) { key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK]; } if (result.capabilities.contains("EAP")) { key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } return key; } /** @hide */ public IpConfiguration getIpConfiguration() { return mIpConfiguration; Loading Loading @@ -1593,6 +1587,11 @@ public class WifiConfiguration implements Parcelable { return 0; } /** @hide */ public boolean isVisibleToUser(int userId) { return shared || (UserHandle.getUserId(creatorUid) == userId); } /** copy constructor {@hide} */ public WifiConfiguration(WifiConfiguration source) { if (source != null) { Loading Loading @@ -1676,6 +1675,7 @@ public class WifiConfiguration implements Parcelable { noInternetAccessExpected = source.noInternetAccessExpected; creationTime = source.creationTime; updateTime = source.updateTime; shared = source.shared; } } Loading Loading @@ -1747,6 +1747,7 @@ public class WifiConfiguration implements Parcelable { dest.writeInt(userApproved); dest.writeInt(numNoInternetAccessReports); dest.writeInt(noInternetAccessExpected ? 1 : 0); dest.writeInt(shared ? 1 : 0); } /** Implement the Parcelable interface {@hide} */ Loading Loading @@ -1814,6 +1815,7 @@ public class WifiConfiguration implements Parcelable { config.userApproved = in.readInt(); config.numNoInternetAccessReports = in.readInt(); config.noInternetAccessExpected = in.readInt() != 0; config.shared = in.readInt() != 0; return config; } Loading Loading
packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +6 −3 Original line number Diff line number Diff line Loading @@ -234,10 +234,13 @@ public class AccessPoint implements Comparable<AccessPoint> { } public boolean matches(WifiConfiguration config) { if (config.isPasspoint() && mConfig != null && mConfig.isPasspoint()) if (config.isPasspoint() && mConfig != null && mConfig.isPasspoint()) { return config.FQDN.equals(mConfig.providerFriendlyName); else return ssid.equals(removeDoubleQuotes(config.SSID)) && security == getSecurity(config); } else { return ssid.equals(removeDoubleQuotes(config.SSID)) && security == getSecurity(config) && (mConfig == null || mConfig.shared == config.shared); } } public WifiConfiguration getConfig() { Loading
wifi/java/android/net/wifi/WifiConfiguration.java +23 −21 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.net.ProxyInfo; import android.net.StaticIpConfiguration; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; import android.text.TextUtils; import java.util.Arrays; Loading Loading @@ -325,6 +326,13 @@ public class WifiConfiguration implements Parcelable { */ public long[] roamingConsortiumIds; /** * @hide * This network configuration is visible to and usable by other users on the * same device. */ public boolean shared; /** * @hide */ Loading Loading @@ -1103,6 +1111,7 @@ public class WifiConfiguration implements Parcelable { mIpConfiguration = new IpConfiguration(); lastUpdateUid = -1; creatorUid = -1; shared = true; } /** Loading Loading @@ -1488,6 +1497,9 @@ public class WifiConfiguration implements Parcelable { key = mCachedConfigKey; } else if (providerFriendlyName != null) { key = FQDN + KeyMgmt.strings[KeyMgmt.WPA_EAP]; if (!shared) { key += "-" + Integer.toString(UserHandle.getUserId(creatorUid)); } } else { if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) { key = SSID + KeyMgmt.strings[KeyMgmt.WPA_PSK]; Loading @@ -1499,6 +1511,9 @@ public class WifiConfiguration implements Parcelable { } else { key = SSID + KeyMgmt.strings[KeyMgmt.NONE]; } if (!shared) { key += "-" + Integer.toString(UserHandle.getUserId(creatorUid)); } mCachedConfigKey = key; } return key; Loading @@ -1511,27 +1526,6 @@ public class WifiConfiguration implements Parcelable { return configKey(false); } /** @hide * return the config key string based on a scan result */ static public String configKey(ScanResult result) { String key = "\"" + result.SSID + "\""; if (result.capabilities.contains("WEP")) { key = key + "-WEP"; } if (result.capabilities.contains("PSK")) { key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK]; } if (result.capabilities.contains("EAP")) { key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } return key; } /** @hide */ public IpConfiguration getIpConfiguration() { return mIpConfiguration; Loading Loading @@ -1593,6 +1587,11 @@ public class WifiConfiguration implements Parcelable { return 0; } /** @hide */ public boolean isVisibleToUser(int userId) { return shared || (UserHandle.getUserId(creatorUid) == userId); } /** copy constructor {@hide} */ public WifiConfiguration(WifiConfiguration source) { if (source != null) { Loading Loading @@ -1676,6 +1675,7 @@ public class WifiConfiguration implements Parcelable { noInternetAccessExpected = source.noInternetAccessExpected; creationTime = source.creationTime; updateTime = source.updateTime; shared = source.shared; } } Loading Loading @@ -1747,6 +1747,7 @@ public class WifiConfiguration implements Parcelable { dest.writeInt(userApproved); dest.writeInt(numNoInternetAccessReports); dest.writeInt(noInternetAccessExpected ? 1 : 0); dest.writeInt(shared ? 1 : 0); } /** Implement the Parcelable interface {@hide} */ Loading Loading @@ -1814,6 +1815,7 @@ public class WifiConfiguration implements Parcelable { config.userApproved = in.readInt(); config.numNoInternetAccessReports = in.readInt(); config.noInternetAccessExpected = in.readInt() != 0; config.shared = in.readInt() != 0; return config; } Loading