1 package com.android.systemui.statusbar.notification.stack
2 
3 import com.android.systemui.log.LogBuffer
4 import com.android.systemui.log.core.LogLevel
5 import com.android.systemui.log.dagger.NotificationHeadsUpLog
6 import com.android.systemui.log.dagger.NotificationRenderLog
7 import com.android.systemui.statusbar.notification.logKey
8 import javax.inject.Inject
9 
10 class StackStateLogger @Inject constructor(
11     @NotificationHeadsUpLog private val buffer: LogBuffer,
12     @NotificationRenderLog private val notificationRenderBuffer: LogBuffer
13 ) {
14     fun logHUNViewDisappearing(key: String) {
15         buffer.log(TAG, LogLevel.INFO, {
16             str1 = logKey(key)
17         }, {
18             "Heads up view disappearing $str1 "
19         })
20     }
21 
22     fun logHUNViewAppearing(key: String) {
23         buffer.log(TAG, LogLevel.INFO, {
24             str1 = logKey(key)
25         }, {
26             "Heads up notification view appearing $str1 "
27         })
28     }
29 
30     fun logHUNViewDisappearingWithRemoveEvent(key: String) {
31         buffer.log(TAG, LogLevel.ERROR, {
32             str1 = logKey(key)
33         }, {
34             "Heads up view disappearing $str1 for ANIMATION_TYPE_REMOVE"
35         })
36     }
37 
38     fun logHUNViewAppearingWithAddEvent(key: String) {
39         buffer.log(TAG, LogLevel.ERROR, {
40             str1 = logKey(key)
41         }, {
42             "Heads up view disappearing $str1 for ANIMATION_TYPE_ADD"
43         })
44     }
45 
46     fun disappearAnimationEnded(key: String) {
47         buffer.log(TAG, LogLevel.INFO, {
48             str1 = logKey(key)
49         }, {
50             "Heads up notification disappear animation ended $str1 "
51         })
52     }
53 
54     fun appearAnimationEnded(key: String) {
55         buffer.log(TAG, LogLevel.INFO, {
56             str1 = logKey(key)
57         }, {
58             "Heads up notification appear animation ended $str1 "
59         })
60     }
61 
62     fun groupChildRemovalEventProcessed(key: String) {
63         notificationRenderBuffer.log(TAG, LogLevel.DEBUG, {
64             str1 = logKey(key)
65         }, {
66             "Group Child Notification removal event processed $str1 for ANIMATION_TYPE_REMOVE"
67         })
68     }
69     fun groupChildRemovalAnimationEnded(key: String) {
70         notificationRenderBuffer.log(TAG, LogLevel.INFO, {
71             str1 = logKey(key)
72         }, {
73             "Group child notification removal animation ended $str1 "
74         })
75     }
76 }
77 
78 private const val TAG = "StackScroll"