1 /* 2 * Copyright (C) 2023 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.keyguard.shared.quickaffordance 18 19 import com.android.systemui.dagger.SysUISingleton 20 import com.android.systemui.shared.system.SysUiStatsLog 21 22 interface KeyguardQuickAffordancesMetricsLogger { 23 24 /** 25 * Logs shortcut Triggered 26 * @param slotId The id of the lockscreen slot that the affordance is in 27 * @param affordanceId The id of the lockscreen affordance 28 */ logOnShortcutTriggerednull29 fun logOnShortcutTriggered(slotId: String, affordanceId: String) 30 31 /** 32 * Logs shortcut Selected 33 * @param slotId The id of the lockscreen slot that the affordance is in 34 * @param affordanceId The id of the lockscreen affordance 35 */ 36 fun logOnShortcutSelected(slotId: String, affordanceId: String) 37 38 } 39 40 @SysUISingleton 41 class KeyguardQuickAffordancesMetricsLoggerImpl : KeyguardQuickAffordancesMetricsLogger { 42 43 override fun logOnShortcutTriggered(slotId: String, affordanceId: String) { 44 SysUiStatsLog.write( 45 SysUiStatsLog.LOCKSCREEN_SHORTCUT_TRIGGERED, 46 slotId, 47 affordanceId, 48 ) 49 } 50 51 override fun logOnShortcutSelected(slotId: String, affordanceId: String) { 52 SysUiStatsLog.write( 53 SysUiStatsLog.LOCKSCREEN_SHORTCUT_SELECTED, 54 slotId, 55 affordanceId, 56 ) 57 } 58 }