Avoid creating IpClient if ethernet cable is unplugged.
This change avoids calling start() on needNetworkFor() if ethernet
cable is unplugged. Fixed by adding isLinkUp validation.
Test: ./cts-tradefed run cts-dev -d -m CtsSecurityTestCases -t \
android.security.cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdpPorts
adb shell netstat -lnup
Change-Id: I2debd7367a20b665249f9c19d2d8a61737435803
This commit is contained in:
@@ -226,7 +226,7 @@ public class EthernetNetworkFactory extends NetworkFactory {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (NetworkInterfaceState n : mTrackingInterfaces.values()) {
|
for (NetworkInterfaceState n : mTrackingInterfaces.values()) {
|
||||||
if (n.statisified(request.networkCapabilities)) {
|
if (n.statisified(request.networkCapabilities) && n.mLinkUp) {
|
||||||
network = n;
|
network = n;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user