1 /* 2 * Copyright (C) 2023 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.annotation.NonNull; 20 import android.annotation.SystemApi; 21 import android.app.ActivityManager; 22 23 /** 24 * A callback interface for {@link ControlledRemoteCarTaskView}. 25 * 26 * @hide 27 */ 28 @SystemApi 29 public interface ControlledRemoteCarTaskViewCallback 30 extends RemoteCarTaskViewCallback<ControlledRemoteCarTaskView> { 31 /** 32 * Called when the underlying {@link RemoteCarTaskView} instance is created. 33 * 34 * @param taskView the new newly created {@link RemoteCarTaskView} instance. 35 */ 36 @Override onTaskViewCreated(@onNull ControlledRemoteCarTaskView taskView)37 default void onTaskViewCreated(@NonNull ControlledRemoteCarTaskView taskView) {} 38 39 /** 40 * Called when the underlying {@link RemoteCarTaskView} is ready. A {@link RemoteCarTaskView} 41 * can be considered ready when it has completed all the set up that is required. 42 * This callback is only triggered once. 43 */ 44 @Override onTaskViewInitialized()45 default void onTaskViewInitialized() {} 46 47 /** 48 * Called when the underlying {@link RemoteCarTaskView} is released. 49 * This callback is only triggered once. 50 */ 51 @Override onTaskViewReleased()52 default void onTaskViewReleased() {} 53 54 /** 55 * Called when the task has appeared in the taskview. 56 * 57 * @param taskInfo the taskInfo of the task that has appeared. 58 */ 59 @Override onTaskAppeared(@onNull ActivityManager.RunningTaskInfo taskInfo)60 default void onTaskAppeared(@NonNull ActivityManager.RunningTaskInfo taskInfo) {} 61 62 /** 63 * Called when the task's info has changed. 64 * 65 * @param taskInfo the taskInfo of the task that has a change in info. 66 */ 67 @Override onTaskInfoChanged(@onNull ActivityManager.RunningTaskInfo taskInfo)68 default void onTaskInfoChanged(@NonNull ActivityManager.RunningTaskInfo taskInfo) {} 69 70 /** 71 * Called when the task has vanished. 72 * 73 * @param taskInfo the taskInfo of the task that has vanished. 74 */ 75 @Override onTaskVanished(@onNull ActivityManager.RunningTaskInfo taskInfo)76 default void onTaskVanished(@NonNull ActivityManager.RunningTaskInfo taskInfo) {} 77 } 78