Merge "Fix a flake with mocking." am: 527f040944
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762391 Change-Id: Ie8f389c1df00c68514dad1ac620b32ed34c2e22a
This commit is contained in:
@@ -1529,7 +1529,7 @@ public class ConnectivityServiceTest {
|
||||
}
|
||||
|
||||
private <T> T doAsUid(final int uid, @NonNull final Supplier<T> what) {
|
||||
when(mDeps.getCallingUid()).thenReturn(uid);
|
||||
doReturn(uid).when(mDeps).getCallingUid();
|
||||
try {
|
||||
return what.get();
|
||||
} finally {
|
||||
@@ -9860,9 +9860,9 @@ public class ConnectivityServiceTest {
|
||||
assertVpnUidRangesUpdated(true, vpnRange, vpnOwnerUid);
|
||||
|
||||
final UnderlyingNetworkInfo underlyingNetworkInfo =
|
||||
new UnderlyingNetworkInfo(vpnOwnerUid, VPN_IFNAME, new ArrayList<String>());
|
||||
new UnderlyingNetworkInfo(vpnOwnerUid, VPN_IFNAME, new ArrayList<>());
|
||||
mMockVpn.setUnderlyingNetworkInfo(underlyingNetworkInfo);
|
||||
when(mDeps.getConnectionOwnerUid(anyInt(), any(), any())).thenReturn(42);
|
||||
doReturn(42).when(mDeps).getConnectionOwnerUid(anyInt(), any(), any());
|
||||
}
|
||||
|
||||
private void setupConnectionOwnerUidAsVpnApp(int vpnOwnerUid, @VpnManager.VpnType int vpnType)
|
||||
|
||||
Reference in New Issue
Block a user