Loading services/core/java/com/android/server/ConnectivityService.java +23 −16 Original line number Diff line number Diff line Loading @@ -1303,14 +1303,17 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override public LinkProperties getLinkProperties(Network network) { enforceAccessPermission(); NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network); if (nai != null) { return getLinkProperties(getNetworkAgentInfoForNetwork(network)); } private LinkProperties getLinkProperties(NetworkAgentInfo nai) { if (nai == null) { return null; } synchronized (nai) { return new LinkProperties(nai.linkProperties); } } return null; } private NetworkCapabilities getNetworkCapabilitiesInternal(NetworkAgentInfo nai) { if (nai != null) { Loading Loading @@ -3133,7 +3136,8 @@ public class ConnectivityService extends IConnectivityManager.Stub enforceAccessPermission(); enforceInternetPermission(); NetworkAgentInfo nai; // TODO: execute this logic on ConnectivityService handler. final NetworkAgentInfo nai; if (network == null) { nai = getDefaultNetwork(); } else { Loading @@ -3144,21 +3148,24 @@ public class ConnectivityService extends IConnectivityManager.Stub return; } // Revalidate if the app report does not match our current validated state. if (hasConnectivity == nai.lastValidated) return; if (hasConnectivity == nai.lastValidated) { return; } final int uid = Binder.getCallingUid(); if (DBG) { log("reportNetworkConnectivity(" + nai.network.netId + ", " + hasConnectivity + ") by " + uid); } synchronized (nai) { // Validating a network that has not yet connected could result in a call to // rematchNetworkAndRequests() which is not meant to work on such networks. if (!nai.everConnected) return; if (isNetworkWithLinkPropertiesBlocked(nai.linkProperties, uid, false)) return; nai.networkMonitor.sendMessage(NetworkMonitor.CMD_FORCE_REEVALUATION, uid); if (!nai.everConnected) { return; } LinkProperties lp = getLinkProperties(nai); if (isNetworkWithLinkPropertiesBlocked(lp, uid, false)) { return; } nai.networkMonitor.sendMessage(NetworkMonitor.CMD_FORCE_REEVALUATION, uid); } private ProxyInfo getDefaultProxy() { Loading Loading
services/core/java/com/android/server/ConnectivityService.java +23 −16 Original line number Diff line number Diff line Loading @@ -1303,14 +1303,17 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override public LinkProperties getLinkProperties(Network network) { enforceAccessPermission(); NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network); if (nai != null) { return getLinkProperties(getNetworkAgentInfoForNetwork(network)); } private LinkProperties getLinkProperties(NetworkAgentInfo nai) { if (nai == null) { return null; } synchronized (nai) { return new LinkProperties(nai.linkProperties); } } return null; } private NetworkCapabilities getNetworkCapabilitiesInternal(NetworkAgentInfo nai) { if (nai != null) { Loading Loading @@ -3133,7 +3136,8 @@ public class ConnectivityService extends IConnectivityManager.Stub enforceAccessPermission(); enforceInternetPermission(); NetworkAgentInfo nai; // TODO: execute this logic on ConnectivityService handler. final NetworkAgentInfo nai; if (network == null) { nai = getDefaultNetwork(); } else { Loading @@ -3144,21 +3148,24 @@ public class ConnectivityService extends IConnectivityManager.Stub return; } // Revalidate if the app report does not match our current validated state. if (hasConnectivity == nai.lastValidated) return; if (hasConnectivity == nai.lastValidated) { return; } final int uid = Binder.getCallingUid(); if (DBG) { log("reportNetworkConnectivity(" + nai.network.netId + ", " + hasConnectivity + ") by " + uid); } synchronized (nai) { // Validating a network that has not yet connected could result in a call to // rematchNetworkAndRequests() which is not meant to work on such networks. if (!nai.everConnected) return; if (isNetworkWithLinkPropertiesBlocked(nai.linkProperties, uid, false)) return; nai.networkMonitor.sendMessage(NetworkMonitor.CMD_FORCE_REEVALUATION, uid); if (!nai.everConnected) { return; } LinkProperties lp = getLinkProperties(nai); if (isNetworkWithLinkPropertiesBlocked(lp, uid, false)) { return; } nai.networkMonitor.sendMessage(NetworkMonitor.CMD_FORCE_REEVALUATION, uid); } private ProxyInfo getDefaultProxy() { Loading