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 android.car.cluster; 18 19 import static com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport.DEPRECATED_CODE; 20 21 import android.annotation.SystemApi; 22 import android.car.Car; 23 import android.car.CarManagerBase; 24 import android.content.Intent; 25 import android.os.Bundle; 26 import android.os.IBinder; 27 28 import com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport; 29 30 /** 31 * API to work with instrument cluster. 32 * 33 * @deprecated use {@link android.car.CarAppFocusManager} with focus type 34 * {@link android.car.CarAppFocusManager#APP_FOCUS_TYPE_NAVIGATION} instead. 35 * InstrumentClusterService will automatically launch a "android.car.cluster.NAVIGATION" activity 36 * from the package holding navigation focus. 37 * 38 * @hide 39 */ 40 @Deprecated 41 @SystemApi 42 @ExcludeFromCodeCoverageGeneratedReport(reason = DEPRECATED_CODE) 43 public class CarInstrumentClusterManager extends CarManagerBase { 44 /** 45 * @deprecated use {@link android.car.Car#CATEGORY_NAVIGATION} instead 46 * 47 * @hide 48 */ 49 @Deprecated 50 @SystemApi 51 public static final String CATEGORY_NAVIGATION = "android.car.cluster.NAVIGATION"; 52 53 /** 54 * When activity in the cluster is launched it will receive {@link ClusterActivityState} in the 55 * intent's extra thus activity will know information about unobscured area, etc. upon activity 56 * creation. 57 * 58 * @deprecated use {@link android.car.Car#CAR_EXTRA_CLUSTER_ACTIVITY_STATE} instead 59 * 60 * @hide 61 */ 62 @Deprecated 63 @SystemApi 64 public static final String KEY_EXTRA_ACTIVITY_STATE = 65 "android.car.cluster.ClusterActivityState"; 66 67 /** 68 * Starts activity in the instrument cluster. 69 * 70 * @deprecated see {@link CarInstrumentClusterManager} deprecation message 71 * 72 * @hide 73 */ 74 @Deprecated 75 @SystemApi startActivity(Intent intent)76 public void startActivity(Intent intent) { 77 // No-op 78 } 79 80 /** 81 * Caller of this method will receive immediate callback with the most recent state if state 82 * exists for given category. 83 * 84 * @param category category of the activity in the cluster, 85 * see {@link #CATEGORY_NAVIGATION} 86 * @param callback instance of {@link Callback} class to receive events. 87 * 88 * @deprecated see {@link CarInstrumentClusterManager} deprecation message 89 * 90 * @hide 91 */ 92 @Deprecated 93 @SystemApi registerCallback(String category, Callback callback)94 public void registerCallback(String category, Callback callback) { 95 // No-op 96 } 97 98 /** 99 * Unregisters given callback for all activity categories. 100 * 101 * @param callback previously registered callback 102 * 103 * @deprecated see {@link CarInstrumentClusterManager} deprecation message 104 * 105 * @hide 106 */ 107 @Deprecated 108 @SystemApi unregisterCallback(Callback callback)109 public void unregisterCallback(Callback callback) { 110 // No-op 111 } 112 113 /** @hide */ CarInstrumentClusterManager(Car car, IBinder service)114 public CarInstrumentClusterManager(Car car, IBinder service) { 115 super(car); 116 // No-op 117 } 118 119 /** 120 * @deprecated activity state is not longer being reported. See 121 * {@link CarInstrumentClusterManager} deprecation message for more details. 122 * 123 * @hide 124 */ 125 @Deprecated 126 @SystemApi 127 public interface Callback { 128 /** 129 * Notify client that activity state was changed. 130 * 131 * @param category cluster activity category, see {@link #CATEGORY_NAVIGATION} 132 * @param clusterActivityState see {@link ClusterActivityState} how to read this bundle. 133 */ onClusterActivityStateChanged(String category, Bundle clusterActivityState)134 void onClusterActivityStateChanged(String category, Bundle clusterActivityState); 135 } 136 137 /** @hide */ 138 @Override onCarDisconnected()139 public void onCarDisconnected() { 140 } 141 } 142