blob: fbf033bd2291235d6e2835a9be41dd2b3d73ba43 [file] [log] [blame]
Ned Burns7b813532020-04-10 19:08:06 -04001/*
2 * Copyright (C) 2020 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
17package com.android.systemui.statusbar.notification
18
19import com.android.systemui.log.LogBuffer
20import com.android.systemui.log.LogLevel
21import com.android.systemui.log.dagger.NotifInteractionLog
22import com.android.systemui.statusbar.notification.collection.NotificationEntry
23import javax.inject.Inject
24
25class NotificationClickerLogger @Inject constructor(
26 @NotifInteractionLog private val buffer: LogBuffer
27) {
28 fun logOnClick(entry: NotificationEntry) {
29 buffer.log(TAG, LogLevel.DEBUG, {
30 str1 = entry.key
31 str2 = entry.ranking.channel.id
32 }, {
33 "CLICK $str1 (channel=$str2)"
34 })
35 }
36
37 fun logMenuVisible(entry: NotificationEntry) {
38 buffer.log(TAG, LogLevel.DEBUG, {
39 str1 = entry.key
40 }, {
41 "Ignoring click on $str1; menu is visible"
42 })
43 }
44
45 fun logParentMenuVisible(entry: NotificationEntry) {
46 buffer.log(TAG, LogLevel.DEBUG, {
47 str1 = entry.key
48 }, {
49 "Ignoring click on $str1; parent menu is visible"
50 })
51 }
52
53 fun logChildrenExpanded(entry: NotificationEntry) {
54 buffer.log(TAG, LogLevel.DEBUG, {
55 str1 = entry.key
56 }, {
57 "Ignoring click on $str1; children are expanded"
58 })
59 }
60
61 fun logGutsExposed(entry: NotificationEntry) {
62 buffer.log(TAG, LogLevel.DEBUG, {
63 str1 = entry.key
64 }, {
65 "Ignoring click on $str1; guts are exposed"
66 })
67 }
68}
69
70private const val TAG = "NotificationClicker"