• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
17 package com.android.systemui.statusbar.notification.collection.coordinator
18 
19 import com.android.systemui.log.dagger.NotificationLog
20 import com.android.systemui.log.LogBuffer
21 import com.android.systemui.log.core.LogLevel
22 import com.android.systemui.statusbar.notification.collection.GroupEntry
23 import com.android.systemui.statusbar.notification.collection.NotificationEntry
24 import com.android.systemui.statusbar.notification.logKey
25 import javax.inject.Inject
26 
27 class PreparationCoordinatorLogger @Inject constructor(
28     @NotificationLog private val buffer: LogBuffer
29 ) {
logNotifInflatednull30     fun logNotifInflated(entry: NotificationEntry) {
31         buffer.log(TAG, LogLevel.DEBUG, {
32             str1 = entry.logKey
33         }, {
34             "Inflation completed for notif $str1"
35         })
36     }
37 
logInflationAbortednull38     fun logInflationAborted(entry: NotificationEntry, reason: String) {
39         buffer.log(TAG, LogLevel.DEBUG, {
40             str1 = entry.logKey
41             str2 = reason
42         }, {
43             "Infation aborted for notif $str1 reason=$str2"
44         })
45     }
46 
logFreeNotifViewsnull47     fun logFreeNotifViews(entry: NotificationEntry, reason: String) {
48         buffer.log(TAG, LogLevel.DEBUG, {
49             str1 = entry.logKey
50             str2 = reason
51         }, {
52             "Freeing content views for notif $str1 reason=$str2"
53         })
54     }
55 
logDoneWaitingForGroupInflationnull56     fun logDoneWaitingForGroupInflation(group: GroupEntry) {
57         buffer.log(TAG, LogLevel.DEBUG, {
58             str1 = group.logKey
59         }, {
60             "Finished inflating all members of group $str1, releasing group"
61         })
62     }
63 
logGroupInflationTookTooLongnull64     fun logGroupInflationTookTooLong(group: GroupEntry) {
65         buffer.log(TAG, LogLevel.WARNING, {
66             str1 = group.logKey
67         }, {
68             "Group inflation took too long for $str1, releasing children early"
69         })
70     }
71 
logDelayingGroupReleasenull72     fun logDelayingGroupRelease(group: GroupEntry, child: NotificationEntry) {
73         buffer.log(TAG, LogLevel.DEBUG, {
74             str1 = group.logKey
75             str2 = child.logKey
76         }, {
77             "Delaying release of group $str1 because child $str2 is still inflating"
78         })
79     }
80 }
81 
82 private const val TAG = "PreparationCoordinator"
83