Merge "Fix test failure on S image + S module"

This commit is contained in:
Paul Hu 2022-05-23 13:45:58 +00:00 • committed by Gerrit Code Review
commit d6446263ce

View file

@ -3235,14 +3235,16 @@ public class ConnectivityManagerTest {
// TODD: Have a significant signal to know the uids has been sent to netd. // TODD: Have a significant signal to know the uids has been sent to netd.
assertBindSocketToNetworkSuccess(network); assertBindSocketToNetworkSuccess(network);
// Uid is in allowed list. Try file network request again. if (TestUtils.shouldTestTApis()) {
requestNetwork(restrictedRequest, restrictedNetworkCb); // Uid is in allowed list. Try file network request again.
// Verify that the network is restricted. requestNetwork(restrictedRequest, restrictedNetworkCb);
restrictedNetworkCb.eventuallyExpect(CallbackEntry.NETWORK_CAPS_UPDATED, // Verify that the network is restricted.
NETWORK_CALLBACK_TIMEOUT_MS, restrictedNetworkCb.eventuallyExpect(CallbackEntry.NETWORK_CAPS_UPDATED,
entry -> network.equals(entry.getNetwork()) NETWORK_CALLBACK_TIMEOUT_MS,
&& (!((CallbackEntry.CapabilitiesChanged) entry).getCaps() entry -> network.equals(entry.getNetwork())
.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED))); && (!((CallbackEntry.CapabilitiesChanged) entry).getCaps()
.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)));
}
} finally { } finally {
agent.unregister(); agent.unregister();