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