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
This commit is contained in:
Christian Göllner
2023-01-10 11:43:32 +01:00
committed by Christian Göllner
parent 7b665d817c
commit f2f813cb29

View File

@@ -16,6 +16,8 @@
package com.android.systemui.statusbar.phone
import android.view.InsetsFlags
import android.view.ViewDebug
import android.view.WindowInsets.Type.InsetsType
import android.view.WindowInsetsController.Appearance
import android.view.WindowInsetsController.Behavior
@@ -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,
requestedVisibleTypes=$requestedVisibleTypes,
packageName='$packageName',
letterboxes=$letterboxes,
letterboxesArray=${letterboxesArray.contentToString()},
appearanceRegionsArray=${appearanceRegionsArray.contentToString()}
)""".trimMargin()
}
}