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 17 package com.android.systemui.qs.tiles.impl.sensorprivacy.ui 18 19 import com.android.systemui.res.R 20 21 sealed interface SensorPrivacyTileResources { getIconResnull22 fun getIconRes(isBlocked: Boolean): Int 23 fun getTileLabelRes(): Int 24 25 data object CameraPrivacyTileResources : SensorPrivacyTileResources { 26 override fun getIconRes(isBlocked: Boolean): Int { 27 return if (isBlocked) { 28 R.drawable.qs_camera_access_icon_off 29 } else { 30 R.drawable.qs_camera_access_icon_on 31 } 32 } 33 34 override fun getTileLabelRes(): Int { 35 return R.string.quick_settings_camera_label 36 } 37 } 38 39 data object MicrophonePrivacyTileResources : SensorPrivacyTileResources { getIconResnull40 override fun getIconRes(isBlocked: Boolean): Int { 41 return if (isBlocked) { 42 R.drawable.qs_mic_access_off 43 } else { 44 R.drawable.qs_mic_access_on 45 } 46 } 47 getTileLabelResnull48 override fun getTileLabelRes(): Int { 49 return R.string.quick_settings_mic_label 50 } 51 } 52 } 53