1 /* 2 * Copyright (C) 2020 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 com.android.car.internal; 18 19 import android.car.ICarResultReceiver; 20 import android.os.UserHandle; 21 22 /** 23 * API to communicate from CarServiceHelperService to car service. 24 * @hide 25 */ 26 oneway interface ICarSystemServerClient { 27 /** 28 * Notify of user lifecycle events. 29 * 30 * @param eventType - type as defined by CarUserManager.UserLifecycleEventType 31 * @param fromUserId - user id of previous user when type is SWITCHING (or UserHandle.USER_NULL) 32 * @param toUserId - user id of new user. 33 */ onUserLifecycleEvent(int eventType, int fromUserId, int toUserId)34 void onUserLifecycleEvent(int eventType, int fromUserId, int toUserId) = 0; 35 36 /** 37 * Nofity when a user is removed. 38 * 39 * NOTE: this is different from onUserLifecycleEvent(), whic is used on user switching events. 40 * 41 * @param user info about the user that was removed. 42 */ 43 void onUserRemoved(in UserHandle user) = 1; 44 45 /** 46 * Notify to init boot user. 47 */ initBootUser()48 void initBootUser() = 2; 49 50 /** 51 * Notify that the device must be factory reset, so CarService can ask user to confirm. 52 * 53 * @param callback used to trigger the factory reset. 54 */ 55 void onFactoryReset(ICarResultReceiver callback) = 3; 56 57 /** 58 * Initial user is decided by HAL and information is saved in CarUserService. It is possible 59 * that car service may crash and this information will be lost. To avoid this situation, 60 * initial user information is saved in System Service using 61 * {@link ICarServiceHelper.sendInitialUser}. If car service reconnects after crash, then this 62 * call will set the initial user information in CarUserService. 63 */ 64 void setInitialUser(in UserHandle user) = 4; 65 } 66