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.content.ComponentName; 21 import java.util.List; 22 23 24 /** @hide */ 25 interface ICarActivityService { 26 /** 27 * Designates the given {@code activity} to be launched in {@code TaskDisplayArea} of 28 * {@code featureId} in the display of {@code displayId}. 29 */ setPersistentActivity(in ComponentName activity, int displayId, int featureId)30 int setPersistentActivity(in ComponentName activity, int displayId, int featureId) = 0; 31 32 /** 33 * Registers the caller as TaskMonitor, which can provide Task lifecycle events to CarService. 34 * The caller should provide a binder token, which is used to check if the given TaskMonitor is 35 * live and the reported events are from the legitimate TaskMonitor. 36 */ 37 void registerTaskMonitor(in IBinder token) = 1; 38 39 /** 40 * Reports that a Task is created. 41 */ onTaskAppeared(in IBinder token, in RunningTaskInfo taskInfo)42 void onTaskAppeared(in IBinder token, in RunningTaskInfo taskInfo) = 2; 43 44 /** 45 * Reports that a Task is vanished. 46 */ onTaskVanished(in IBinder token, in RunningTaskInfo taskInfo)47 void onTaskVanished(in IBinder token, in RunningTaskInfo taskInfo) = 3; 48 49 /** 50 * Reports that some Task's states are changed. 51 */ onTaskInfoChanged(in IBinder token, in RunningTaskInfo taskInfo)52 void onTaskInfoChanged(in IBinder token, in RunningTaskInfo taskInfo) = 4; 53 54 /** 55 * Unregisters the caller from TaskMonitor. 56 */ 57 void unregisterTaskMonitor(in IBinder token) = 5; 58 59 /** 60 * Returns all the visible tasks ordered in top to bottom manner. 61 */ getVisibleTasks()62 List<RunningTaskInfo> getVisibleTasks() = 6; 63 } 64 65