Loading packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java +3 −3 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> { return mSubscriberId; } /** Get the Wifi Network Key of this instance. See {@link WifiInfo#getCurrentNetworkKey()}. */ /** Get the Wifi Network Key of this instance. See {@link WifiInfo#getNetworkKey()}. */ @Nullable public String getWifiNetworkKey() { return mWifiNetworkKey; Loading Loading @@ -375,7 +375,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> { if (transportInfo instanceof WifiInfo) { final WifiInfo info = (WifiInfo) transportInfo; if (info != null) { setWifiNetworkKey(info.getCurrentNetworkKey()); setWifiNetworkKey(info.getNetworkKey()); } } } Loading Loading @@ -436,7 +436,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> { * Set the Wifi Network Key. * * @param wifiNetworkKey Wifi Network Key of the network, * see {@link WifiInfo#getCurrentNetworkKey()}. * see {@link WifiInfo#getNetworkKey()}. * Or null if not applicable. * @return this builder. */ Loading packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java +6 −6 Original line number Diff line number Diff line Loading @@ -263,7 +263,7 @@ public final class NetworkTemplate implements Parcelable { * Template to match {@link ConnectivityManager#TYPE_WIFI} networks with the * given key of the wifi network. * * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getCurrentNetworkKey()} * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getNetworkKey()} * to know details about the key. * @hide */ Loading @@ -283,7 +283,7 @@ public final class NetworkTemplate implements Parcelable { * Call with {@link #WIFI_NETWORK_KEY_ALL} for {@code wifiNetworkKey} to get result regardless * of key of the wifi network. * * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getCurrentNetworkKey()} * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getNetworkKey()} * to know details about the key. * @param subscriberId the IMSI associated to this wifi network. * Loading Loading @@ -593,7 +593,7 @@ public final class NetworkTemplate implements Parcelable { /** * Get the set of Wifi Network Keys of the template. * See {@link WifiInfo#getCurrentNetworkKey()}. * See {@link WifiInfo#getNetworkKey()}. */ @NonNull public Set<String> getWifiNetworkKeys() { Loading Loading @@ -729,7 +729,7 @@ public final class NetworkTemplate implements Parcelable { * Returns true when the key matches, or when {@code mMatchWifiNetworkKeys} is * empty. * * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getCurrentNetworkKey()} * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getNetworkKey()} * to know details about the key. */ private boolean matchesWifiNetworkKey(@NonNull String wifiNetworkKey) { Loading Loading @@ -1059,9 +1059,9 @@ public final class NetworkTemplate implements Parcelable { * the intention of matching any Wifi Network Key. * * @param wifiNetworkKeys the list of Wifi Network Key, * see {@link WifiInfo#getCurrentNetworkKey()}. * see {@link WifiInfo#getNetworkKey()}. * Or an empty list to match all networks. * Note that {@code getCurrentNetworkKey()} might get null key * Note that {@code getNetworkKey()} might get null key * when wifi disconnects. However, the caller should never invoke * this function with a null Wifi Network Key since such statistics * never exists. Loading services/core/java/com/android/server/net/NetworkPolicyManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -2687,7 +2687,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { final List<WifiConfiguration> configs = wm.getConfiguredNetworks(); for (int i = 0; i < configs.size(); ++i) { final WifiConfiguration config = configs.get(i); for (String key : config.getAllPersistableNetworkKeys()) { for (String key : config.getAllNetworkKeys()) { final Boolean metered = wifiNetworkKeys.get(key); if (metered != null) { Slog.d(TAG, "Found network " + key + "; upgrading metered hint"); Loading services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -2046,7 +2046,7 @@ public class NetworkPolicyManagerServiceTest { private static NetworkStateSnapshot buildWifi() { WifiInfo mockWifiInfo = mock(WifiInfo.class); when(mockWifiInfo.makeCopy(anyLong())).thenReturn(mockWifiInfo); when(mockWifiInfo.getCurrentNetworkKey()).thenReturn(TEST_WIFI_NETWORK_KEY); when(mockWifiInfo.getNetworkKey()).thenReturn(TEST_WIFI_NETWORK_KEY); final LinkProperties prop = new LinkProperties(); prop.setInterfaceName(TEST_IFACE); final NetworkCapabilities networkCapabilities = new NetworkCapabilities.Builder() Loading Loading
packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java +3 −3 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> { return mSubscriberId; } /** Get the Wifi Network Key of this instance. See {@link WifiInfo#getCurrentNetworkKey()}. */ /** Get the Wifi Network Key of this instance. See {@link WifiInfo#getNetworkKey()}. */ @Nullable public String getWifiNetworkKey() { return mWifiNetworkKey; Loading Loading @@ -375,7 +375,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> { if (transportInfo instanceof WifiInfo) { final WifiInfo info = (WifiInfo) transportInfo; if (info != null) { setWifiNetworkKey(info.getCurrentNetworkKey()); setWifiNetworkKey(info.getNetworkKey()); } } } Loading Loading @@ -436,7 +436,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> { * Set the Wifi Network Key. * * @param wifiNetworkKey Wifi Network Key of the network, * see {@link WifiInfo#getCurrentNetworkKey()}. * see {@link WifiInfo#getNetworkKey()}. * Or null if not applicable. * @return this builder. */ Loading
packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java +6 −6 Original line number Diff line number Diff line Loading @@ -263,7 +263,7 @@ public final class NetworkTemplate implements Parcelable { * Template to match {@link ConnectivityManager#TYPE_WIFI} networks with the * given key of the wifi network. * * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getCurrentNetworkKey()} * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getNetworkKey()} * to know details about the key. * @hide */ Loading @@ -283,7 +283,7 @@ public final class NetworkTemplate implements Parcelable { * Call with {@link #WIFI_NETWORK_KEY_ALL} for {@code wifiNetworkKey} to get result regardless * of key of the wifi network. * * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getCurrentNetworkKey()} * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getNetworkKey()} * to know details about the key. * @param subscriberId the IMSI associated to this wifi network. * Loading Loading @@ -593,7 +593,7 @@ public final class NetworkTemplate implements Parcelable { /** * Get the set of Wifi Network Keys of the template. * See {@link WifiInfo#getCurrentNetworkKey()}. * See {@link WifiInfo#getNetworkKey()}. */ @NonNull public Set<String> getWifiNetworkKeys() { Loading Loading @@ -729,7 +729,7 @@ public final class NetworkTemplate implements Parcelable { * Returns true when the key matches, or when {@code mMatchWifiNetworkKeys} is * empty. * * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getCurrentNetworkKey()} * @param wifiNetworkKey key of the wifi network. see {@link WifiInfo#getNetworkKey()} * to know details about the key. */ private boolean matchesWifiNetworkKey(@NonNull String wifiNetworkKey) { Loading Loading @@ -1059,9 +1059,9 @@ public final class NetworkTemplate implements Parcelable { * the intention of matching any Wifi Network Key. * * @param wifiNetworkKeys the list of Wifi Network Key, * see {@link WifiInfo#getCurrentNetworkKey()}. * see {@link WifiInfo#getNetworkKey()}. * Or an empty list to match all networks. * Note that {@code getCurrentNetworkKey()} might get null key * Note that {@code getNetworkKey()} might get null key * when wifi disconnects. However, the caller should never invoke * this function with a null Wifi Network Key since such statistics * never exists. Loading
services/core/java/com/android/server/net/NetworkPolicyManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -2687,7 +2687,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { final List<WifiConfiguration> configs = wm.getConfiguredNetworks(); for (int i = 0; i < configs.size(); ++i) { final WifiConfiguration config = configs.get(i); for (String key : config.getAllPersistableNetworkKeys()) { for (String key : config.getAllNetworkKeys()) { final Boolean metered = wifiNetworkKeys.get(key); if (metered != null) { Slog.d(TAG, "Found network " + key + "; upgrading metered hint"); Loading
services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -2046,7 +2046,7 @@ public class NetworkPolicyManagerServiceTest { private static NetworkStateSnapshot buildWifi() { WifiInfo mockWifiInfo = mock(WifiInfo.class); when(mockWifiInfo.makeCopy(anyLong())).thenReturn(mockWifiInfo); when(mockWifiInfo.getCurrentNetworkKey()).thenReturn(TEST_WIFI_NETWORK_KEY); when(mockWifiInfo.getNetworkKey()).thenReturn(TEST_WIFI_NETWORK_KEY); final LinkProperties prop = new LinkProperties(); prop.setInterfaceName(TEST_IFACE); final NetworkCapabilities networkCapabilities = new NetworkCapabilities.Builder() Loading