1 /*
2  * Copyright (C) 2022 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 com.android.systemui.car.privacy;
17 
18 import android.content.Context;
19 
20 import androidx.annotation.DrawableRes;
21 
22 import com.android.car.qc.provider.BaseLocalQCProvider;
23 import com.android.systemui.R;
24 import com.android.systemui.car.systembar.CameraPrivacyChipViewController;
25 
26 import javax.inject.Inject;
27 
28 /**
29  * A {@link BaseLocalQCProvider} that builds the camera privacy panel.
30  */
31 public class CameraQcPanel extends SensorQcPanel {
32 
33     private static final String SENSOR_NAME = "camera";
34     private static final String SENSOR_SHORT_NAME = "camera";
35     private static final String SENSOR_NAME_WITH_FIRST_LETTER_CAPITALIZED = "Camera";
36 
37     @Inject
CameraQcPanel(Context context, CameraPrivacyChipViewController cameraPrivacyChipViewController, CameraPrivacyElementsProviderImpl cameraPrivacyElementsProvider)38     public CameraQcPanel(Context context,
39             CameraPrivacyChipViewController cameraPrivacyChipViewController,
40             CameraPrivacyElementsProviderImpl cameraPrivacyElementsProvider) {
41         super(context, cameraPrivacyChipViewController,
42                 cameraPrivacyElementsProvider);
43     }
44 
45     @Override
getSensorShortName()46     protected String getSensorShortName() {
47         return SENSOR_SHORT_NAME;
48     }
49 
50     @Override
getSensorName()51     protected String getSensorName() {
52         return SENSOR_NAME;
53     }
54 
55     @Override
getSensorNameWithFirstLetterCapitalized()56     protected String getSensorNameWithFirstLetterCapitalized() {
57         return SENSOR_NAME_WITH_FIRST_LETTER_CAPITALIZED;
58     }
59 
60     @Override
getSensorOnIconResourceId()61     protected @DrawableRes int getSensorOnIconResourceId() {
62         return R.drawable.ic_camera_light;
63     }
64 
65     @Override
getSensorOffIconResourceId()66     protected @DrawableRes int getSensorOffIconResourceId() {
67         return R.drawable.ic_camera_off_light;
68     }
69 }
70