1 /* 2 * Copyright (c) 2022 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.logging 18 19 import com.android.systemui.log.dagger.NotificationRenderLog 20 import com.android.systemui.plugins.log.LogBuffer 21 import com.android.systemui.plugins.log.LogLevel.INFO 22 import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow 23 import com.android.systemui.statusbar.notification.row.ExpandableView 24 import com.android.systemui.statusbar.notification.stack.NotificationSection 25 import javax.inject.Inject 26 27 /** Handles logging for the {NotificationRoundnessManager}. */ 28 class NotificationRoundnessLogger 29 @Inject 30 constructor(@NotificationRenderLog val buffer: LogBuffer) { 31 32 /** Called when the {NotificationRoundnessManager} updates the corners if the Notifications. */ onCornersUpdatednull33 fun onCornersUpdated( 34 view: ExpandableView?, 35 isFirstInSection: Boolean, 36 isLastInSection: Boolean, 37 topChanged: Boolean, 38 bottomChanged: Boolean 39 ) { 40 buffer.log( 41 TAG_ROUNDNESS, 42 INFO, 43 { 44 str1 = (view as? ExpandableNotificationRow)?.entry?.key 45 bool1 = isFirstInSection 46 bool2 = isLastInSection 47 bool3 = topChanged 48 bool4 = bottomChanged 49 }, 50 { 51 "onCornersUpdated: " + 52 "entry=$str1 isFirstInSection=$bool1 isLastInSection=$bool2 " + 53 "topChanged=$bool3 bottomChanged=$bool4" 54 } 55 ) 56 } 57 58 /** Called when we update the {NotificationRoundnessManager} with new sections. */ onSectionCornersUpdatednull59 fun onSectionCornersUpdated(sections: Array<NotificationSection?>, anyChanged: Boolean) { 60 buffer.log( 61 TAG_ROUNDNESS, 62 INFO, 63 { 64 int1 = sections.size 65 bool1 = anyChanged 66 }, 67 { "onSectionCornersUpdated: sections size=$int1 anyChanged=$bool1" } 68 ) 69 } 70 } 71 72 private const val TAG_ROUNDNESS = "NotifRoundnessLogger" 73