Merge "Update the method based on API feedback" am: 0a5d964242

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

Change-Id: I9d85af6567422f0b5a05173ba58593137cb1181d
This commit is contained in:
Chiachang Wang
2021-04-13 08:51:12 +00:00
committed by Automerger Merge Worker

View File

@@ -722,7 +722,8 @@ public class VpnTest extends InstrumentationTestCase {
final TestableNetworkCallback otherUidCallback = new TestableNetworkCallback();
final TestableNetworkCallback myUidCallback = new TestableNetworkCallback();
if (SdkLevel.isAtLeastS()) {
final int otherUid = UserHandle.getUid(UserHandle.of(5), Process.FIRST_APPLICATION_UID);
final int otherUid =
UserHandle.of(5 /* userId */).getUid(Process.FIRST_APPLICATION_UID);
final Handler h = new Handler(Looper.getMainLooper());
runWithShellPermissionIdentity(() -> {
mCM.registerSystemDefaultNetworkCallback(systemDefaultCallback, h);