From b2fb674c1b037a1434c43a38e0757b39e7098836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Go=CC=88llner?= Date: Tue, 10 Jan 2023 11:43:32 +0100 Subject: [PATCH] SystemBarAttributesListener: log appearance as String instead of integer The appearance flag int is composed by bits. To make it easier to read logs, convert the flag to a String representation. Test: adb shell dumpsys and read the output Bug: 260554575 Change-Id: If0082fe112b64403aff31925e63a06ac7e78d1f7 Merged-In: If0082fe112b64403aff31925e63a06ac7e78d1f7 --- .../phone/SystemBarAttributesListener.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemBarAttributesListener.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemBarAttributesListener.kt index 6cd8c78dd52fd..9e6bb20f429de 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemBarAttributesListener.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemBarAttributesListener.kt @@ -16,7 +16,9 @@ package com.android.systemui.statusbar.phone +import android.view.InsetsFlags import android.view.InsetsVisibilities +import android.view.ViewDebug import android.view.WindowInsetsController.Appearance import android.view.WindowInsetsController.Behavior import com.android.internal.statusbar.LetterboxDetails @@ -148,4 +150,20 @@ private data class SystemBarAttributesParams( ) { val letterboxesArray = letterboxes.toTypedArray() val appearanceRegionsArray = appearanceRegions.toTypedArray() + override fun toString(): String { + val appearanceToString = + ViewDebug.flagsToString(InsetsFlags::class.java, "appearance", appearance) + return """SystemBarAttributesParams( + displayId=$displayId, + appearance=$appearanceToString, + appearanceRegions=$appearanceRegions, + navbarColorManagedByIme=$navbarColorManagedByIme, + behavior=$behavior, + requestedVisibilities=$requestedVisibilities, + packageName='$packageName', + letterboxes=$letterboxes, + letterboxesArray=${letterboxesArray.contentToString()}, + appearanceRegionsArray=${appearanceRegionsArray.contentToString()} + )""".trimMargin() + } }