1 /*
2  * Copyright (C) 2016 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 package android.car.cluster.renderer;
17 
18 import android.annotation.Nullable;
19 import android.annotation.SystemApi;
20 import android.annotation.UiThread;
21 import android.content.Context;
22 
23 /**
24  * @deprecated This class is unused. Refer to {@link InstrumentClusterRenderingService} for
25  * documentation on how to build a instrument cluster renderer.
26  *
27  * @hide
28  */
29 @Deprecated
30 @SystemApi
31 public abstract class InstrumentClusterRenderer {
32 
33     @Nullable private NavigationRenderer mNavigationRenderer;
34 
35     /**
36      * Calls once when instrument cluster should be created.
37      */
onCreate(Context context)38     abstract public void onCreate(Context context);
39 
onStart()40     abstract public void onStart();
41 
onStop()42     abstract public void onStop();
43 
createNavigationRenderer()44     abstract protected NavigationRenderer createNavigationRenderer();
45 
46     /** The method is thread-safe, callers should cache returned object. */
47     @Nullable
getNavigationRenderer()48     public synchronized NavigationRenderer getNavigationRenderer() {
49         return mNavigationRenderer;
50     }
51 
52     /**
53      * This method is called by car service after onCreateView to initialize private members. The
54      * method should not be overridden by subclasses.
55      */
56     @UiThread
initialize()57     public synchronized final void initialize() {
58         mNavigationRenderer = createNavigationRenderer();
59     }
60 }
61