Merge "Fix test failure on S image + S module" am: d6446263ce

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2098019

Change-Id: I9122cd6e6099e2a51b9549e1838d0d3fa6f5d008
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Paul Hu 2022-05-23 14:03:25 +00:00 • committed by Automerger Merge Worker
commit b9b4c0678e

View file

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