1 /* 2 * Copyright (C) 2017 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.content.ComponentName; 20 import android.os.UserHandle; 21 22 import java.util.List; 23 24 /** 25 * Helper API for CarService. 26 * 27 * Only for interaction between system server and car service, so it can be changed (without 28 * breaking Car Mainline) 29 * 30 * 31 * @hide 32 */ 33 interface ICarServiceHelper { 34 /** 35 * Check 36 * {@link com.android.server.wm.CarLaunchParamsModifier#setDisplayAllowlistForUser(int, int[]). 37 */ setDisplayAllowlistForUser(int userId, in int[] displayIds)38 void setDisplayAllowlistForUser(int userId, in int[] displayIds) = 0; 39 40 /** 41 * Check 42 * {@link com.android.server.wm.CarLaunchParamsModifier#setPassengerDisplays(int[])}. 43 */ setPassengerDisplays(in int[] displayIds)44 void setPassengerDisplays(in int[] displayIds) = 1; 45 46 /** 47 * Check 48 * {@link com.android.server.wm.CarLaunchParamsModifier#setSourcePreferredComponents( 49 * boolean, List<ComponentName>)}. 50 */ setSourcePreferredComponents( boolean enableSourcePreferred, in List<ComponentName> sourcePreferredComponents)51 void setSourcePreferredComponents( 52 boolean enableSourcePreferred, in List<ComponentName> sourcePreferredComponents) = 2; 53 54 /** 55 * Sets whether it's safe to run operations (like DevicePolicyManager.lockNow()). 56 */ setSafetyMode(boolean safe)57 void setSafetyMode(boolean safe) = 3; 58 59 /** 60 * Creates the given user, even when it's disallowed by DevicePolicyManager. 61 */ createUserEvenWhenDisallowed(String name, String userType, int flags)62 UserHandle createUserEvenWhenDisallowed(String name, String userType, int flags) = 4; 63 64 /** 65 * Designates the given {@code activity} to be launched in {@code TaskDisplayArea} of 66 * {@code featureId} in the display of {@code displayId}. 67 */ setPersistentActivity(in ComponentName activity, int displayId, int featureId)68 int setPersistentActivity(in ComponentName activity, int displayId, int featureId) = 5; 69 70 /** 71 * Saves initial user information in System Server. If car service crashes, Car service helper 72 * service would send back this information. 73 */ 74 void sendInitialUser(in UserHandle user) = 6; 75 76 /** Check {@link android.os.Process#setProcessGroup(int, int)}. */ setProcessGroup(int pid, int group)77 void setProcessGroup(int pid, int group) = 7; 78 79 /** Check {@link android.os.Process#getProcessGroup(int)}. */ getProcessGroup(int pid)80 int getProcessGroup(int pid) = 8; 81 82 /** Same as {@code UserManagerInternal#getMainDisplayAssignedToUser()} */ getMainDisplayAssignedToUser(int userId)83 int getMainDisplayAssignedToUser(int userId) = 9; 84 85 /** Same as {@code UserManagerInternal#getUsersAssignedToDisplay()} */ getUserAssignedToDisplay(int displayId)86 int getUserAssignedToDisplay(int displayId) = 10; 87 88 /** 89 * Check {@link android.app.AcitivityManager#startUserInBackgroundVisibleOnDisplay(int, int)} 90 */ startUserInBackgroundVisibleOnDisplay(int userId, int displayId)91 boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId) = 11; 92 93 /** Check {@link android.os.Process#setProcessProfile(int, int, String)}. */ setProcessProfile(int pid, int uid, in String profile)94 void setProcessProfile(int pid, int uid, in String profile) = 12; 95 96 /** 97 * Returns the PID for the AIDL VHAL service. 98 * 99 * On error, returns {@link com.android.car.internal.common.CommonConstants#INVALID_PID}. 100 */ fetchAidlVhalPid()101 int fetchAidlVhalPid() = 13; 102 103 /** 104 * Designates the given {@code activities} to be launched in the root task associated with 105 * {@code rootTaskToken}. 106 */ setPersistentActivitiesOnRootTask(in List<ComponentName> activity, in IBinder rootTaskToken)107 void setPersistentActivitiesOnRootTask(in List<ComponentName> activity, 108 in IBinder rootTaskToken) = 14; 109 } 110