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 com.android.systemui.util.visibilityString 9 import javax.inject.Inject 10 11 class StackStateLogger 12 @Inject 13 constructor( 14 @NotificationHeadsUpLog private val buffer: LogBuffer, 15 @NotificationRenderLog private val notificationRenderBuffer: LogBuffer 16 ) { 17 logHUNViewAppearingnull18 fun logHUNViewAppearing(key: String) { 19 buffer.log( 20 TAG, 21 LogLevel.INFO, 22 { str1 = logKey(key) }, 23 { "Heads up notification view appearing $str1 " } 24 ) 25 } 26 logHUNViewAppearingWithAddEventnull27 fun logHUNViewAppearingWithAddEvent(key: String) { 28 buffer.log( 29 TAG, 30 LogLevel.ERROR, 31 { str1 = logKey(key) }, 32 { "Heads up view appearing $str1 for ANIMATION_TYPE_ADD" } 33 ) 34 } 35 appearAnimationEndednull36 fun appearAnimationEnded(key: String) { 37 buffer.log( 38 TAG, 39 LogLevel.INFO, 40 { str1 = logKey(key) }, 41 { "Heads up notification appear animation ended $str1 " } 42 ) 43 } 44 processAnimationEventsRemovalnull45 fun processAnimationEventsRemoval(key: String, visibility: Int, isHeadsUp: Boolean) { 46 notificationRenderBuffer.log( 47 TAG, 48 LogLevel.INFO, 49 { 50 str1 = logKey(key) 51 int1 = visibility 52 bool1 = isHeadsUp 53 }, 54 { 55 "ProcessAnimationEvents ANIMATION_TYPE_REMOVE for: $str1, " + 56 "changingViewVisibility: ${visibilityString(int1)}, isHeadsUp: $bool1" 57 } 58 ) 59 } 60 processAnimationEventsRemoveSwipeOutnull61 fun processAnimationEventsRemoveSwipeOut( 62 key: String, 63 isFullySwipedOut: Boolean, 64 isHeadsUp: Boolean 65 ) { 66 notificationRenderBuffer.log( 67 TAG, 68 LogLevel.INFO, 69 { 70 str1 = logKey(key) 71 bool1 = isFullySwipedOut 72 bool2 = isHeadsUp 73 }, 74 { 75 "ProcessAnimationEvents ANIMATION_TYPE_REMOVE_SWIPED_OUT for: $str1, " + 76 "isFullySwipedOut: $bool1, isHeadsUp: $bool2" 77 } 78 ) 79 } 80 animationStartnull81 fun animationStart(key: String?, animationType: String, isHeadsUp: Boolean) { 82 notificationRenderBuffer.log( 83 TAG, 84 LogLevel.INFO, 85 { 86 str1 = logKey(key) 87 str2 = animationType 88 bool1 = isHeadsUp 89 }, 90 { "Animation Start, type: $str2, notif key: $str1, isHeadsUp: $bool1" } 91 ) 92 } 93 animationEndnull94 fun animationEnd(key: String, animationType: String, isHeadsUp: Boolean) { 95 notificationRenderBuffer.log( 96 TAG, 97 LogLevel.INFO, 98 { 99 str1 = logKey(key) 100 str2 = animationType 101 bool1 = isHeadsUp 102 }, 103 { "Animation End, type: $str2, notif key: $str1, isHeadsUp: $bool1" } 104 ) 105 } 106 } 107 108 private const val TAG = "StackScroll" 109