aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYing Zheng <yizheng@google.com>2018-06-22 16:54:51 -0700
committerYing Zheng <yizheng@google.com>2018-06-25 10:28:21 -0700
commitcf20f44f515ca802baad7d73f86cbd829e1a2183 (patch)
tree41550771b70052f3539b496665800a8e956741b1 /tests
parentc3cb52abdbd7dd9b0fb70947242f452440db736c (diff)
downloadCar-cf20f44f515ca802baad7d73f86cbd829e1a2183.tar.gz
Update last active user.
Test: Unit test Bug: 110156344 Change-Id: If8967f3acc434759e4f5b8bc25d6d913c1fa4ee6
Diffstat (limited to 'tests')
-rw-r--r--tests/carservice_unit_test/src/com/android/car/user/CarUserServiceTest.java6
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);