1 /* 2 * Copyright (C) 2023 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.dreams 18 19 import com.android.systemui.log.core.Logger 20 import com.android.systemui.log.core.MessageBuffer 21 22 /** Logs dream-related stuff to a {@link LogBuffer}. */ 23 class DreamLogger(buffer: MessageBuffer, tag: String) : Logger(buffer, tag) { logDreamOverlayEnablednull24 fun logDreamOverlayEnabled(enabled: Boolean) = 25 d({ "Dream overlay enabled: $bool1" }) { bool1 = enabled } 26 logIgnoreAddComplicationnull27 fun logIgnoreAddComplication(reason: String, complication: String) = 28 d({ "Ignore adding complication, reason: $str1, complication: $str2" }) { 29 str1 = reason 30 str2 = complication 31 } 32 logIgnoreRemoveComplicationnull33 fun logIgnoreRemoveComplication(reason: String, complication: String) = 34 d({ "Ignore removing complication, reason: $str1, complication: $str2" }) { 35 str1 = reason 36 str2 = complication 37 } 38 logAddComplicationnull39 fun logAddComplication(complication: String) = 40 d({ "Add dream complication: $str1" }) { str1 = complication } 41 logRemoveComplicationnull42 fun logRemoveComplication(complication: String) = 43 d({ "Remove dream complication: $str1" }) { str1 = complication } 44 <lambda>null45 fun logOverlayActive(active: Boolean) = d({ "Dream overlay active: $bool1" }) { bool1 = active } 46 logLowLightActivenull47 fun logLowLightActive(active: Boolean) = 48 d({ "Low light mode active: $bool1" }) { bool1 = active } 49 logHasAssistantAttentionnull50 fun logHasAssistantAttention(hasAttention: Boolean) = 51 d({ "Dream overlay has Assistant attention: $bool1" }) { bool1 = hasAttention } 52 logStatusBarVisiblenull53 fun logStatusBarVisible(visible: Boolean) = 54 d({ "Dream overlay status bar visible: $bool1" }) { bool1 = visible } 55 logAvailableComplicationTypesnull56 fun logAvailableComplicationTypes(types: Int) = 57 d({ "Available complication types: $int1" }) { int1 = types } 58 logShouldShowComplicationsnull59 fun logShouldShowComplications(showComplications: Boolean) = 60 d({ "Dream overlay should show complications: $bool1" }) { bool1 = showComplications } 61 logShowOrHideStatusBarItemnull62 fun logShowOrHideStatusBarItem(show: Boolean, type: String) = 63 d({ "${if (bool1) "Showing" else "Hiding"} dream status bar item: $int1" }) { 64 bool1 = show 65 str1 = type 66 } 67 } 68