1 /*
2  * Copyright (C) 2024 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.app;
17 
18 import android.annotation.FlaggedApi;
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.annotation.RequiresPermission;
22 import android.annotation.SystemApi;
23 import android.car.Car;
24 import android.car.CarManagerBase;
25 import android.car.feature.Flags;
26 import android.os.IBinder;
27 
28 /**
29  * A {@link CarManagerBase} meant to initialize {@link CarDisplayCompatContainer}
30  *
31  * @hide
32  */
33 @FlaggedApi(Flags.FLAG_DISPLAY_COMPATIBILITY)
34 @SystemApi
35 public final class CarDisplayCompatManager extends CarManagerBase {
36     private CarActivityManager mCarActivityManager;
37 
38     /**
39      * @hide
40      */
41     @SystemApi
42     @RequiresPermission(Car.PERMISSION_MANAGE_DISPLAY_COMPATIBILITY)
43     @Nullable
initializeDisplayCompatContainer( @onNull CarDisplayCompatContainer.Builder builder)44     public CarDisplayCompatContainer initializeDisplayCompatContainer(
45             @NonNull CarDisplayCompatContainer.Builder builder) {
46         builder.setCarActivityManager(mCarActivityManager);
47         return builder.build();
48     }
49 
50     /** @hide */
CarDisplayCompatManager(Car car, @NonNull IBinder service)51     public CarDisplayCompatManager(Car car, @NonNull IBinder service) {
52         super(car);
53         mCarActivityManager = (CarActivityManager) car.getCarManager(Car.CAR_ACTIVITY_SERVICE);
54     }
55 
56     /** @hide */
57     @Override
onCarDisconnected()58     public void onCarDisconnected() {
59     }
60 }
61