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.VisualStabilityLog 22 import javax.inject.Inject 23 24 private const val TAG = "VisualStability" 25 26 class VisualStabilityCoordinatorLogger 27 @Inject 28 constructor(@VisualStabilityLog private val buffer: LogBuffer) { logAllowancesChangednull29 fun logAllowancesChanged( 30 wasRunAllowed: Boolean, 31 isRunAllowed: Boolean, 32 wasReorderingAllowed: Boolean, 33 isReorderingAllowed: Boolean, 34 field: String, 35 value: Boolean, 36 async: Boolean, 37 ) { 38 buffer.log( 39 TAG, 40 LogLevel.DEBUG, 41 { 42 bool1 = wasRunAllowed 43 bool2 = isRunAllowed 44 bool3 = wasReorderingAllowed 45 bool4 = isReorderingAllowed 46 str1 = field 47 str2 = value.toString() 48 str3 = async.toString() 49 }, 50 { 51 "stability allowances changed:" + 52 " pipelineRunAllowed $bool1->$bool2" + 53 " reorderingAllowed $bool3->$bool4" + 54 " when setting $str1=$str2" 55 " async=$str3" 56 }, 57 ) 58 } 59 } 60