diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/carservice_unit_test/src/com/android/car/user/CarUserServiceTest.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/carservice_unit_test/src/com/android/car/user/CarUserServiceTest.java b/tests/carservice_unit_test/src/com/android/car/user/CarUserServiceTest.java index 132a7ba9f5..03a692f43b 100644 --- a/tests/carservice_unit_test/src/com/android/car/user/CarUserServiceTest.java +++ b/tests/carservice_unit_test/src/com/android/car/user/CarUserServiceTest.java @@ -181,10 +181,10 @@ public class CarUserServiceTest { int lastActiveUserId = 11; doReturn(false).when(mCarUserManagerHelper).isForegroundUserEphemeral(); - doReturn(lastActiveUserId).when(mCarUserManagerHelper).getCurrentForegroundUserId(); - mCarUserService.onReceive(mMockContext, - new Intent(Intent.ACTION_USER_SWITCHED)); + Intent intent = new Intent(Intent.ACTION_USER_SWITCHED); + intent.putExtra(Intent.EXTRA_USER_HANDLE, lastActiveUserId); + mCarUserService.onReceive(mMockContext, intent); verify(mCarUserManagerHelper).setLastActiveUser( lastActiveUserId, /* skipGlobalSetting= */ false); |