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