reduce log level when no interface is present for rate limiting

TestNetworkAgentWrapper does not set the interface name in its
LinkProperties causing logwtf to fail tests on -eng build.

Test: atest FrameworksNetTests:ConnectivityServiceTest on -eng build
Change-Id: Ieba0453ce897aa1052cb98f1de4c7bb099383c8d
This commit is contained in:
Patrick Rohr 2022-02-15 11:58:41 +01:00
commit a517f20ef0

View file

@ -10691,8 +10691,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
final String iface = networkAgent.linkProperties.getInterfaceName();
if (iface == null) {
// This can never happen.
logwtf("canNetworkBeRateLimited: LinkProperties#getInterfaceName returns null");
// This may happen in tests, but if there is no interface then there is nothing that
// can be rate limited.
loge("canNetworkBeRateLimited: LinkProperties#getInterfaceName returns null");
return false;
}
return true;