Merge "Update the method based on API feedback"

This commit is contained in:
Chiachang Wang
2021-04-13 08:15:47 +00:00
committed by Gerrit Code Review

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