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

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

Change-Id: Iff5cc8ed2a2709804bf2f0151c7929c10f8639f4
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:22:46 +00:00 • committed by Automerger Merge Worker
commit 3ff466a921

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();