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.content.pm.UserInfo;
21 import android.os.UserHandle;
22 
23 import java.util.List;
24 
25 /**
26  * Helper API for car service. Only for interaction between system server and car service.
27  */
28 interface ICarServiceHelper {
forceSuspend(int timeoutMs)29     int forceSuspend(int timeoutMs);
30     /**
31     * Check
32     * {@link com.android.server.wm.CarLaunchParamsModifier#setDisplayAllowlistForUser(int, int[]).
33     */
setDisplayAllowlistForUser(int userId, in int[] displayIds)34     void setDisplayAllowlistForUser(int userId, in int[] displayIds);
35 
36     /**
37      * Check
38      * {@link com.android.server.wm.CarLaunchParamsModifier#setPassengerDisplays(int[])}.
39      */
setPassengerDisplays(in int[] displayIds)40     void setPassengerDisplays(in int[] displayIds);
41 
42     /**
43      * Check
44      * {@link com.android.server.wm.CarLaunchParamsModifier#setSourcePreferredComponents(
45      *         boolean, List<ComponentName>)}.
46      */
setSourcePreferredComponents( boolean enableSourcePreferred, in List<ComponentName> sourcePreferredComponents)47     void setSourcePreferredComponents(
48             boolean enableSourcePreferred, in List<ComponentName> sourcePreferredComponents);
49 
50     /**
51      * Sets whether it's safe to run operations (like DevicePolicyManager.lockNow()).
52      */
setSafetyMode(boolean safe)53     void setSafetyMode(boolean safe);
54 
55     /**
56      * Creates the given user, even when it's disallowed by DevicePolicyManager.
57      */
createUserEvenWhenDisallowed(String name, String userType, int flags)58     UserInfo createUserEvenWhenDisallowed(String name, String userType, int flags);
59 
60     /**
61      * Designates the given {@code activity} to be launched in {@code TaskDisplayArea} of
62      * {@code featureId} in the display of {@code displayId}.
63      */
setPersistentActivity(in ComponentName activity, int displayId, int featureId)64     int setPersistentActivity(in ComponentName activity, int displayId, int featureId);
65 
66     /**
67      * Saves initial user information in System Server. If car service crashes, Car service helepr
68      * service would send back this information.
69      */
sendInitialUser(in UserHandle user)70     void sendInitialUser(in UserHandle user);
71 }
72