• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.systemui.car.systembar;
18 
19 import static android.hardware.SensorPrivacyManager.Sensors.CAMERA;
20 
21 import android.content.Context;
22 import android.hardware.SensorPrivacyManager;
23 
24 import androidx.annotation.IdRes;
25 
26 import com.android.systemui.R;
27 import com.android.systemui.dagger.SysUISingleton;
28 import com.android.systemui.privacy.PrivacyItemController;
29 import com.android.systemui.privacy.PrivacyType;
30 
31 import javax.inject.Inject;
32 
33 /** Controls a Camera Privacy Chip view in system icons. */
34 @SysUISingleton
35 public class CameraPrivacyChipViewController extends PrivacyChipViewController {
36 
37     @Inject
CameraPrivacyChipViewController(Context context, PrivacyItemController privacyItemController, SensorPrivacyManager sensorPrivacyManager)38     public CameraPrivacyChipViewController(Context context,
39             PrivacyItemController privacyItemController,
40             SensorPrivacyManager sensorPrivacyManager) {
41         super(context, privacyItemController, sensorPrivacyManager);
42     }
43 
44     @Override
getChipSensor()45     protected @SensorPrivacyManager.Sensors.Sensor int getChipSensor() {
46         return CAMERA;
47     }
48 
49     @Override
getChipPrivacyType()50     protected PrivacyType getChipPrivacyType() {
51         return PrivacyType.TYPE_CAMERA;
52     }
53 
54     @Override
getChipResourceId()55     protected @IdRes int getChipResourceId() {
56         return R.id.camera_privacy_chip;
57     }
58 }
59