Home
last modified time | relevance | path

Searched refs:UserSwitchResult (Results 1 – 16 of 16) sorted by relevance

/packages/services/Car/tests/carservice_unit_test/src/com/android/car/user/
DUserSwitchResultTest.java21 import android.car.user.UserSwitchResult;
30 UserSwitchResult result = in testIUserSwitchResult_checkStatusAndMessage()
31 new UserSwitchResult(UserSwitchResult.STATUS_SUCCESSFUL, msg); in testIUserSwitchResult_checkStatusAndMessage()
32 assertThat(result.getStatus()).isEqualTo(UserSwitchResult.STATUS_SUCCESSFUL); in testIUserSwitchResult_checkStatusAndMessage()
38 UserSwitchResult result = in testIUserSwitchResult_isSuccess_failure()
39 new UserSwitchResult(UserSwitchResult.STATUS_ANDROID_FAILURE, null); in testIUserSwitchResult_isSuccess_failure()
45 UserSwitchResult result = in testIUserSwitchResult_isSuccess_success()
46 new UserSwitchResult(UserSwitchResult.STATUS_SUCCESSFUL, null); in testIUserSwitchResult_isSuccess_success()
52 UserSwitchResult result = in testIUserSwitchResult_isSuccess_requestedState()
53 new UserSwitchResult(UserSwitchResult.STATUS_OK_USER_ALREADY_IN_FOREGROUND, null); in testIUserSwitchResult_isSuccess_requestedState()
DExperimentalCarUserManagerUnitTest.java38 import android.car.user.UserSwitchResult;
105 assertThat(result.getStatus()).isEqualTo(UserSwitchResult.STATUS_HAL_INTERNAL_FAILURE); in testCreateDriver_Error()
125 AndroidFuture<UserSwitchResult> future = mManager.switchDriver(10); in testSwitchDriver_Success()
126 UserSwitchResult result = getResult(future); in testSwitchDriver_Success()
127 assertThat(result.getStatus()).isEqualTo(UserSwitchResult.STATUS_SUCCESSFUL); in testSwitchDriver_Success()
133 AndroidFuture<UserSwitchResult> future = mManager.switchDriver(20); in testSwitchDriver_Error()
135 UserSwitchResult result = getResult(future); in testSwitchDriver_Error()
136 assertThat(result.getStatus()).isEqualTo(UserSwitchResult.STATUS_HAL_INTERNAL_FAILURE); in testSwitchDriver_Error()
212 AndroidFuture<UserSwitchResult> future = (AndroidFuture<UserSwitchResult>) invocation in expectSwitchDriverSucceed()
214 future.complete(new UserSwitchResult(UserSwitchResult.STATUS_SUCCESSFUL, null)); in expectSwitchDriverSucceed()
DCarUserManagerUnitTest.java49 import android.car.user.UserSwitchResult;
214 expectServiceSwitchUserSucceeds(11, UserSwitchResult.STATUS_SUCCESSFUL, "D'OH!"); in testSwitchUser_success()
216 AsyncFuture<UserSwitchResult> future = mMgr.switchUser(11); in testSwitchUser_success()
219 UserSwitchResult result = getResult(future); in testSwitchUser_success()
220 assertThat(result.getStatus()).isEqualTo(UserSwitchResult.STATUS_SUCCESSFUL); in testSwitchUser_success()
229 AsyncFuture<UserSwitchResult> future = mMgr.switchUser(11); in testSwitchUser_remoteException()
232 UserSwitchResult result = getResult(future); in testSwitchUser_remoteException()
233 assertThat(result.getStatus()).isEqualTo(UserSwitchResult.STATUS_HAL_INTERNAL_FAILURE); in testSwitchUser_remoteException()
241 AsyncFuture<UserSwitchResult> future = mMgr.switchUser(11); in testSwitchUser_runtimeException()
244 UserSwitchResult result = getResult(future); in testSwitchUser_runtimeException()
[all …]
DCarUserServiceTest.java77 import android.car.user.UserSwitchResult;
192 private final AndroidFuture<UserSwitchResult> mUserSwitchFuture = new AndroidFuture<>();
193 private final AndroidFuture<UserSwitchResult> mUserSwitchFuture2 = new AndroidFuture<>();
744 .isEqualTo(UserSwitchResult.STATUS_SUCCESSFUL); in testSwitchDriver()
756 .isEqualTo(UserSwitchResult.STATUS_UX_RESTRICTION_FAILURE); in testSwitchDriver_failUxRestrictions()
767 .isEqualTo(UserSwitchResult.STATUS_INVALID_REQUEST); in testSwitchDriver_IfUserSwitchIsNotAllowed()
777 .isEqualTo(UserSwitchResult.STATUS_OK_USER_ALREADY_IN_FOREGROUND); in testSwitchDriver_IfSwitchedToCurrentUser()
1108 .isEqualTo(UserSwitchResult.STATUS_NOT_SWITCHABLE); in testSwitchUser_noUserSwitchability()
1118 .isEqualTo(UserSwitchResult.STATUS_OK_USER_ALREADY_IN_FOREGROUND); in testSwitchUser_targetSameAsCurrentUser()
1132 .isEqualTo(UserSwitchResult.STATUS_SUCCESSFUL); in testSwitchUser_halNotSupported_success()
[all …]
/packages/services/Car/car-lib/src/android/car/user/
DUserSwitchResult.java37 public final class UserSwitchResult implements Parcelable, OperationResult { class
207 public UserSwitchResult( in UserSwitchResult() method in UserSwitchResult
300 /* package-private */ UserSwitchResult(@android.annotation.NonNull android.os.Parcel in) { in UserSwitchResult() method in UserSwitchResult
340 public static final @android.annotation.NonNull Parcelable.Creator<UserSwitchResult> CREATOR
341 = new Parcelable.Creator<UserSwitchResult>() {
343 public UserSwitchResult[] newArray(int size) {
344 return new UserSwitchResult[size];
348 public UserSwitchResult createFromParcel(@android.annotation.NonNull android.os.Parcel in) {
349 return new UserSwitchResult(in);
DExperimentalCarUserManager.java123 public AndroidFuture<UserSwitchResult> switchDriver(@UserIdInt int driverId) { in switchDriver()
125 AndroidFuture<UserSwitchResult> future = new AndroidFuture<>() { in switchDriver()
127 protected void onCompleted(UserSwitchResult result, Throwable err) { in switchDriver()
137 AndroidFuture<UserSwitchResult> future = new AndroidFuture<>(); in switchDriver()
139 new UserSwitchResult(UserSwitchResult.STATUS_HAL_INTERNAL_FAILURE, null)); in switchDriver()
DCarUserManager.java346 public AsyncFuture<UserSwitchResult> switchUser(@UserIdInt int targetUserId) { in switchUser()
349 AndroidFuture<UserSwitchResult> future = new AndroidFuture<UserSwitchResult>() { in switchUser()
351 protected void onCompleted(UserSwitchResult result, Throwable err) { in switchUser()
367 AsyncFuture<UserSwitchResult> future = in switchUser()
368 newSwitchResuiltForFailure(UserSwitchResult.STATUS_HAL_INTERNAL_FAILURE); in switchUser()
373 private AndroidAsyncFuture<UserSwitchResult> newSwitchResuiltForFailure( in newSwitchResuiltForFailure()
374 @UserSwitchResult.Status int status) { in newSwitchResuiltForFailure()
375 AndroidFuture<UserSwitchResult> future = new AndroidFuture<>(); in newSwitchResuiltForFailure()
376 future.complete(new UserSwitchResult(status, null)); in newSwitchResuiltForFailure()
DUserSwitchResult.aidl19 parcelable UserSwitchResult;
/packages/services/Car/service/src/com/android/car/user/
DCarUserService.java51 import android.car.user.UserSwitchResult;
550 public void switchDriver(@UserIdInt int driverId, AndroidFuture<UserSwitchResult> receiver) { in switchDriver()
555 sendUserSwitchResult(receiver, UserSwitchResult.STATUS_INVALID_REQUEST); in switchDriver()
561 sendUserSwitchResult(receiver, UserSwitchResult.STATUS_INVALID_REQUEST); in switchDriver()
985 @NonNull AndroidFuture<UserSwitchResult> receiver) { in switchUser()
992 sendUserSwitchResult(receiver, UserSwitchResult.STATUS_NOT_SWITCHABLE); in switchUser()
999 @NonNull AndroidFuture<UserSwitchResult> receiver) { in handleSwitchUser()
1006 int resultStatus = UserSwitchResult.STATUS_OK_USER_ALREADY_IN_FOREGROUND; in handleSwitchUser()
1012 sendUserSwitchResult(receiver, UserSwitchResult.STATUS_UX_RESTRICTION_FAILURE); in handleSwitchUser()
1020 sendUserSwitchResult(receiver, UserSwitchResult.STATUS_SUCCESSFUL); in handleSwitchUser()
[all …]
/packages/services/Car/car-lib/src/android/car/
DICarUserService.aidl23 import android.car.user.UserSwitchResult;
32 void switchDriver(int driverId, in AndroidFuture<UserSwitchResult> receiver); in switchDriver()
33 void switchUser(int tagerUserId, int timeoutMs, in AndroidFuture<UserSwitchResult> receiver); in switchUser()
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/profiles/
DProfileHelperTest.java34 import android.car.user.UserSwitchResult;
542 AndroidFuture<UserSwitchResult> future = new AndroidFuture<>(); in mockSwitchUserSuccess()
543 future.complete(new UserSwitchResult(UserSwitchResult.STATUS_SUCCESSFUL, null)); in mockSwitchUserSuccess()
548 AndroidFuture<UserSwitchResult> future = new AndroidFuture<>(); in mockSwitchUserFailure()
549 future.complete(new UserSwitchResult(UserSwitchResult.STATUS_ANDROID_FAILURE, null)); in mockSwitchUserFailure()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/users/
DUserFragment.java30 import android.car.user.UserSwitchResult;
214 AsyncFuture<UserSwitchResult> future = mCarUserManager.switchUser(userId); in switchUser()
215 UserSwitchResult result = getResult(future); in switchUser()
225 .append(UserSwitchResult.statusToString(status)).append(')'); in switchUser()
228 .append(UserSwitchResult.statusToString(status)).append(')'); in switchUser()
/packages/services/Car/tests/android_car_api_test/src/android/car/apitest/
DCarMultiUserTestBase.java35 import android.car.user.UserSwitchResult;
283 AsyncFuture<UserSwitchResult> future = mCarUserManager.switchUser(userId); in switchUser()
284 UserSwitchResult result = future.get(SWITCH_USER_TIMEOUT_MS, TimeUnit.MILLISECONDS); in switchUser()
/packages/apps/Car/SystemUI/src/com/android/systemui/car/userswitcher/
DUserGridRecyclerView.java34 import android.car.user.UserSwitchResult;
517 AsyncFuture<UserSwitchResult> userSwitchResultFuture = in switchUser()
519 UserSwitchResult userSwitchResult; in switchUser()
/packages/apps/Car/Settings/src/com/android/car/settings/profiles/
DProfileHelper.java29 import android.car.user.UserSwitchResult;
211 UserSwitchResult result = getResult("switch", mCarUserManager.switchUser(userId)); in switchProfile()
/packages/services/Car/service/src/com/android/car/
DCarShellCommand.java50 import android.car.user.UserSwitchResult;
1403 AsyncFuture<UserSwitchResult> future = carUserManager.switchUser(targetUserId);
1404 UserSwitchResult result = waitForFuture(writer, future, timeout);
1407 UserSwitchResult.statusToString(result.getStatus()));