1 /* 2 * Copyright (C) 2025 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.model 18 19 import com.android.systemui.res.R 20 21 sealed interface SensorPrivacyTileResources { getIconResnull22 fun getIconRes(isBlocked: Boolean): Int 23 24 fun getTileLabelRes(): Int 25 26 data object CameraPrivacyTileResources : SensorPrivacyTileResources { 27 override fun getIconRes(isBlocked: Boolean): Int { 28 return if (isBlocked) { 29 R.drawable.qs_camera_access_icon_off 30 } else { 31 R.drawable.qs_camera_access_icon_on 32 } 33 } 34 35 override fun getTileLabelRes(): Int { 36 return R.string.quick_settings_camera_label 37 } 38 } 39 40 data object MicrophonePrivacyTileResources : SensorPrivacyTileResources { getIconResnull41 override fun getIconRes(isBlocked: Boolean): Int { 42 return if (isBlocked) { 43 R.drawable.qs_mic_access_off 44 } else { 45 R.drawable.qs_mic_access_on 46 } 47 } 48 getTileLabelResnull49 override fun getTileLabelRes(): Int { 50 return R.string.quick_settings_mic_label 51 } 52 } 53 } 54