1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.car;
18 
19 import android.content.pm.UserInfo;
20 import android.car.user.UserCreationResult;
21 import android.car.user.UserRemovalResult;
22 import android.car.user.UserIdentificationAssociationResponse;
23 import android.car.user.UserSwitchResult;
24 
25 import com.android.internal.infra.AndroidFuture;
26 import com.android.internal.os.IResultReceiver;
27 
28 /** @hide */
29 interface ICarUserService {
createDriver(@ullable String name, boolean admin)30     AndroidFuture<UserCreationResult> createDriver(@nullable String name, boolean admin);
createPassenger(@ullable String name, int driverId)31     UserInfo createPassenger(@nullable String name, int driverId);
switchDriver(int driverId, in AndroidFuture<UserSwitchResult> receiver)32     void switchDriver(int driverId, in AndroidFuture<UserSwitchResult> receiver);
switchUser(int tagerUserId, int timeoutMs, in AndroidFuture<UserSwitchResult> receiver)33     void switchUser(int tagerUserId, int timeoutMs, in AndroidFuture<UserSwitchResult> receiver);
setUserSwitchUiCallback(in IResultReceiver callback)34     void setUserSwitchUiCallback(in IResultReceiver callback);
createUser(@ullable String name, String userType, int flags, int timeoutMs, in AndroidFuture<UserCreationResult> receiver)35     void createUser(@nullable String name, String userType, int flags, int timeoutMs,
36       in AndroidFuture<UserCreationResult> receiver);
updatePreCreatedUsers()37     void updatePreCreatedUsers();
removeUser(int userId, in AndroidFuture<UserRemovalResult> receiver)38     void removeUser(int userId, in AndroidFuture<UserRemovalResult> receiver);
getAllDrivers()39     List<UserInfo> getAllDrivers();
getPassengers(int driverId)40     List<UserInfo> getPassengers(int driverId);
startPassenger(int passengerId, int zoneId)41     boolean startPassenger(int passengerId, int zoneId);
stopPassenger(int passengerId)42     boolean stopPassenger(int passengerId);
setLifecycleListenerForApp(String pkgName, in IResultReceiver listener)43     void setLifecycleListenerForApp(String pkgName, in IResultReceiver listener);
resetLifecycleListenerForApp(in IResultReceiver listener)44     void resetLifecycleListenerForApp(in IResultReceiver listener);
getUserIdentificationAssociation(in int[] types)45     UserIdentificationAssociationResponse getUserIdentificationAssociation(in int[] types);
setUserIdentificationAssociation(int timeoutMs, in int[] types, in int[] values, in AndroidFuture<UserIdentificationAssociationResponse> result)46     void setUserIdentificationAssociation(int timeoutMs, in int[] types, in int[] values,
47       in AndroidFuture<UserIdentificationAssociationResponse> result);
isUserHalUserAssociationSupported()48     boolean isUserHalUserAssociationSupported();
49 }
50