• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.statusbar.notification.collection.coordinator
18 
19 import com.android.systemui.log.LogBuffer
20 import com.android.systemui.log.core.LogLevel
21 import com.android.systemui.log.dagger.UnseenNotificationLog
22 import javax.inject.Inject
23 
24 private const val TAG = "LockScreenMinimalismCoordinator"
25 
26 class LockScreenMinimalismCoordinatorLogger
27 @Inject
28 constructor(
29     @UnseenNotificationLog private val buffer: LogBuffer,
30 ) {
31 
logTrackingUnseennull32     fun logTrackingUnseen(trackingUnseen: Boolean) =
33         buffer.log(
34             TAG,
35             LogLevel.DEBUG,
36             messageInitializer = { bool1 = trackingUnseen },
<lambda>null37             messagePrinter = {
38                 "${if (bool1) "Start" else "Stop"} " +
39                     "tracking unseen notifications because of settings change."
40             },
41         )
42 
logShadeVisiblenull43     fun logShadeVisible(numUnseen: Int) {
44         buffer.log(
45             TAG,
46             LogLevel.DEBUG,
47             messageInitializer = { int1 = numUnseen },
48             messagePrinter = { "Shade expanded. Notifications marked as seen: $int1" }
49         )
50     }
51 
logShadeHiddennull52     fun logShadeHidden() {
53         buffer.log(TAG, LogLevel.DEBUG, "Shade no longer expanded.")
54     }
55 
logUnseenAddednull56     fun logUnseenAdded(key: String) =
57         buffer.log(
58             TAG,
59             LogLevel.DEBUG,
60             messageInitializer = { str1 = key },
<lambda>null61             messagePrinter = { "Unseen notif added: $str1" },
62         )
63 
logUnseenUpdatednull64     fun logUnseenUpdated(key: String) =
65         buffer.log(
66             TAG,
67             LogLevel.DEBUG,
68             messageInitializer = { str1 = key },
<lambda>null69             messagePrinter = { "Unseen notif updated: $str1" },
70         )
71 
logUnseenRemovednull72     fun logUnseenRemoved(key: String) =
73         buffer.log(
74             TAG,
75             LogLevel.DEBUG,
76             messageInitializer = { str1 = key },
<lambda>null77             messagePrinter = { "Unseen notif removed: $str1" },
78         )
79 
logHunHasBeenSeennull80     fun logHunHasBeenSeen(key: String, wasUnseen: Boolean) =
81         buffer.log(
82             TAG,
83             LogLevel.DEBUG,
84             messageInitializer = {
85                 str1 = key
86                 bool1 = wasUnseen
87             },
<lambda>null88             messagePrinter = { "Heads up notif has been seen: $str1 wasUnseen=$bool1" },
89         )
90 
logTopHeadsUpRownull91     fun logTopHeadsUpRow(key: String?, wasUnseenWhenPinned: Boolean) {
92         buffer.log(
93             TAG,
94             LogLevel.DEBUG,
95             messageInitializer = {
96                 str1 = key
97                 bool1 = wasUnseenWhenPinned
98             },
99             messagePrinter = { "New notif is top heads up: $str1 wasUnseen=$bool1" },
100         )
101     }
102 }
103