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.accessibility
18 
19 import com.android.internal.logging.UiEvent
20 import com.android.internal.logging.UiEventLogger
21 import javax.inject.Inject
22 
23 /**
24  * Handles logging UiEvent stats for simple UI interactions.
25  *
26  * See go/uievent
27  */
28 class AccessibilityLogger @Inject constructor(private val uiEventLogger: UiEventLogger) {
29     /** Logs the given event */
30     fun log(event: UiEventLogger.UiEventEnum) {
31         uiEventLogger.log(event)
32     }
33 
34     /** Events regarding interaction with the magnifier settings panel */
35     enum class MagnificationSettingsEvent constructor(private val id: Int) :
36         UiEventLogger.UiEventEnum {
37         @UiEvent(doc = "Magnification settings panel opened.")
38         MAGNIFICATION_SETTINGS_PANEL_OPENED(1381),
39 
40         @UiEvent(doc = "Magnification settings panel closed")
41         MAGNIFICATION_SETTINGS_PANEL_CLOSED(1382),
42 
43         @UiEvent(doc = "Magnification settings panel edit size button clicked")
44         MAGNIFICATION_SETTINGS_SIZE_EDITING_ACTIVATED(1383),
45 
46         @UiEvent(doc = "Magnification settings panel edit size save button clicked")
47         MAGNIFICATION_SETTINGS_SIZE_EDITING_DEACTIVATED(1384),
48 
49         @UiEvent(doc = "Magnification settings panel window size selected")
50         MAGNIFICATION_SETTINGS_WINDOW_SIZE_SELECTED(1386);
51 
52         override fun getId(): Int = this.id
53     }
54 }
55