Merge "Fix findConnectionTypeForIface." into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
209058ec6e
@@ -2850,11 +2850,13 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
enforceConnectivityInternalPermission();
|
enforceConnectivityInternalPermission();
|
||||||
|
|
||||||
if (TextUtils.isEmpty(iface)) return ConnectivityManager.TYPE_NONE;
|
if (TextUtils.isEmpty(iface)) return ConnectivityManager.TYPE_NONE;
|
||||||
for (NetworkStateTracker tracker : mNetTrackers) {
|
|
||||||
if (tracker != null) {
|
synchronized(mNetworkForNetId) {
|
||||||
LinkProperties lp = tracker.getLinkProperties();
|
for (int i = 0; i < mNetworkForNetId.size(); i++) {
|
||||||
if (lp != null && iface.equals(lp.getInterfaceName())) {
|
NetworkAgentInfo nai = mNetworkForNetId.valueAt(i);
|
||||||
return tracker.getNetworkInfo().getType();
|
LinkProperties lp = nai.linkProperties;
|
||||||
|
if (lp != null && iface.equals(lp.getInterfaceName()) && nai.networkInfo != null) {
|
||||||
|
return nai.networkInfo.getType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user