1 /* 2 * Copyright (C) 2021 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.app; 18 19 import android.app.ActivityManager.RunningTaskInfo; 20 import android.car.app.ICarSystemUIProxy; 21 import android.car.app.ICarSystemUIProxyCallback; 22 import android.content.ComponentName; 23 import java.util.List; 24 25 26 /** @hide */ 27 interface ICarActivityService { 28 /** 29 * Designates the given {@code activity} to be launched in {@code TaskDisplayArea} of 30 * {@code featureId} in the display of {@code displayId}. 31 */ setPersistentActivity(in ComponentName activity, int displayId, int featureId)32 int setPersistentActivity(in ComponentName activity, int displayId, int featureId) = 0; 33 34 /** 35 * Registers the caller as TaskMonitor, which can provide Task lifecycle events to CarService. 36 * The caller should provide a binder token, which is used to check if the given TaskMonitor is 37 * live and the reported events are from the legitimate TaskMonitor. 38 */ 39 void registerTaskMonitor(in IBinder token) = 1; 40 41 /** 42 * Reports that a Task is created. 43 */ onTaskAppeared(in IBinder token, in RunningTaskInfo taskInfo, in SurfaceControl leash)44 void onTaskAppeared(in IBinder token, in RunningTaskInfo taskInfo, in SurfaceControl leash) = 8; 45 46 /** 47 * Reports that a Task is vanished. 48 */ onTaskVanished(in IBinder token, in RunningTaskInfo taskInfo)49 void onTaskVanished(in IBinder token, in RunningTaskInfo taskInfo) = 3; 50 51 /** 52 * Reports that some Task's states are changed. 53 */ onTaskInfoChanged(in IBinder token, in RunningTaskInfo taskInfo)54 void onTaskInfoChanged(in IBinder token, in RunningTaskInfo taskInfo) = 4; 55 56 /** 57 * Unregisters the caller from TaskMonitor. 58 */ 59 void unregisterTaskMonitor(in IBinder token) = 5; 60 61 /** See {@link CarActivityManager#getVisibleTasks(int)} */ getVisibleTasks(int displayId)62 List<RunningTaskInfo> getVisibleTasks(int displayId) = 6; 63 64 /** See {@link CarActivityManager#startUserPickerOnDisplay(int)} */ startUserPickerOnDisplay(int displayId)65 void startUserPickerOnDisplay(int displayId) = 7; 66 67 /** See {@link CarActivityManager#createTaskMirroringToken(int)} */ createTaskMirroringToken(int taskId)68 IBinder createTaskMirroringToken(int taskId) = 9; 69 70 /** See {@link CarActivityManager#createDisplayMirroringToken(int)} */ createDisplayMirroringToken(int displayId)71 IBinder createDisplayMirroringToken(int displayId) = 10; 72 73 /** See {@link CarActivityManager#getMirroredSurface(IBinder, Rect)} */ getMirroredSurface(in IBinder mirroringToken, out Rect bounds)74 SurfaceControl getMirroredSurface(in IBinder mirroringToken, out Rect bounds) = 11; 75 76 /** 77 * Registers a System UI proxy which is meant to host all the system ui interaction that is 78 * required by other apps. 79 */ 80 void registerCarSystemUIProxy(in ICarSystemUIProxy carSystemUIProxy) = 12; 81 82 /** 83 * Adds a callback to monitor the lifecycle of System UI proxy. Calling this for an already 84 * registered callback will result in a no-op. 85 */ 86 void addCarSystemUIProxyCallback(in ICarSystemUIProxyCallback callback) = 13; 87 88 /** 89 * Removes the callback to monitor the lifecycle of System UI proxy. 90 * Calling this for an already unregistered callback will result in a no-op 91 */ 92 void removeCarSystemUIProxyCallback(in ICarSystemUIProxyCallback callback) = 14; 93 94 /** See {@link CarActivityManager#moveRootTaskToDisplay(int, int)} */ moveRootTaskToDisplay(int taskId, int displayId)95 void moveRootTaskToDisplay(int taskId, int displayId) = 15; 96 97 /** 98 * Returns true if the {@link CarSystemUIProxy} is registered, false otherwise. 99 */ isCarSystemUIProxyRegistered()100 boolean isCarSystemUIProxyRegistered() = 16; 101 setPersistentActivitiesOnRootTask(in List<ComponentName> activities, in IBinder launchCookie)102 void setPersistentActivitiesOnRootTask(in List<ComponentName> activities, 103 in IBinder launchCookie) = 17; 104 } 105 106