Change expected userId for mock for emulation

The userId changes when emulation is on where the userId becomes 10
instead of 0.

Bug: 236727647
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest#testIsUninstallBlocked_financeDo_success

Change-Id: I48752308cdcab9523939f979904ffa9b2493aa1c
This commit is contained in:
Salud Lemus
2022-06-22 12:04:35 -07:00
parent a76d24a017
commit b6feae5262

View File

@@ -7846,7 +7846,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
setDeviceOwner();
dpm.setDeviceOwnerType(admin1, DEVICE_OWNER_TYPE_FINANCED);
when(getServices().ipackageManager.getBlockUninstallForUser(
eq(packageName), eq(UserHandle.USER_SYSTEM)))
eq(packageName), eq(UserHandle.getCallingUserId())))
.thenReturn(true);
assertThat(dpm.isUninstallBlocked(admin1, packageName)).isTrue();