当前位置: 首页 > news >正文

aosp15上SurfaceFlinger的dump部分新特性-无Layer相关详细信息输出如何解决?

背景:

在经常做窗口显示相关开发时候,进程需要采用以下几个命令:

dumpsys SurfaceFlinger --主要dump出相关显示图层Layer信息

dumpsys window windows --主要dump出相关的window信息,也就是windowstate信息

但是在aosp15版本使用dumpsys SurfaceFlinger时候发现输出相比以前版本如aosp14,有较大的更新,下面来具体看看相关的dump的差异。

dump相关的差异对比

先来看看aosp15的dump中的一些新特性:

SurfaceFlinger New Frontend Enabled:true
Active Layers - layers with client handles (count = 81)Composition list
LayerStack=0Layer [190] Wallpaper BBQ wrapper#190visible reason= buffer=11141145165824 frame=1 color{< 0, 0, 0, 1 >}bounds={-72,-148,3108,2859.5} toDisplayTransform={ scale x=3.1795 y=3.1797  tx=-72.0000 ty=-148.0000 }Layer [213] com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#213visible reason= buffer=12799002542087 frame=6 color{< 0, 0, 0, 1 >}bounds={0,0,2960,1440}input{(DUPLICATE_TOUCH_TO_WALLPAPER) touchableRegion={0,0,2960,1440}}Layer [209] StatusBar#209visible reason= buffer=11141145165828 frame=26 color{< 0, 0, 0, 1 >}bounds={0,0,84,1440}input{(NOT_FOCUSABLE | TRUSTED_OVERLAY) touchableRegion={0,0,84,1440}}Layer [216] Taskbar#216visible reason= buffer=12799002542090 frame=21 color{< 0, 0, 0, 1 >}bounds={0,2792,2960,1440} toDisplayTransform={ tx=0.0000 ty=2792.0000 }input{(NOT_FOCUSABLE | TRUSTED_OVERLAY | SLIPPERY) touchableRegion={0,2792,2960,1440}}Input list
LayerStack=0Layer [216] Taskbar#216visible reason= buffer=12799002542090 frame=21 color{< 0, 0, 0, 1 >}bounds={0,2792,2960,1440} toDisplayTransform={ tx=0.0000 ty=2792.0000 }input{(NOT_FOCUSABLE | TRUSTED_OVERLAY | SLIPPERY) touchableRegion={0,2792,2960,1440}}Layer [209] StatusBar#209visible reason= buffer=11141145165828 frame=26 color{< 0, 0, 0, 1 >}bounds={0,0,84,1440}input{(NOT_FOCUSABLE | TRUSTED_OVERLAY) touchableRegion={0,0,84,1440}}Layer [213] com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#213visible reason= buffer=12799002542087 frame=6 color{< 0, 0, 0, 1 >}bounds={0,0,2960,1440}input{(DUPLICATE_TOUCH_TO_WALLPAPER) touchableRegion={0,0,2960,1440}}Layer [218] 39a2f ActivityRecordInputSink com.android.launcher3/.uioverrides.QuickstepLauncher#218invisible reason=nothing to drawbounds={0,0,2960,1440}input{(NO_INPUT_CHANNEL | NOT_FOCUSABLE) replaceTouchableRegionWithCrop touchableRegion={0,0,2960,1440}}Layer [189] com.android.systemui.wallpapers.ImageWallpaper#189invisible reason=nothing to drawbounds={-14400,-29600,29600,14400} toDisplayTransform={ scale x=3.1795 y=3.1797  tx=-72.0000 ty=-148.0000 }input{(NOT_FOCUSABLE | NOT_TOUCHABLE | PREVENT_SPLITTING | IS_WALLPAPER) touchableRegion={-71,-147,-147,-71}}Layer HierarchyROOT├─ Display 0 name="Built-in Screen"#169│  ├─ WindowedMagnification:0:31#129│  │  ├─ HideDisplayCutout:0:14#130│  │  │  └─ OneHanded:0:14#131│  │  │     ├─ FullscreenMagnification:0:12#132│  │  │     │  ├─ Leaf:0:1#133│  │  │     │  │  └─ WallpaperWindowToken{c162fc5 token=android.os.Binder@a6f563c}#187│  │  │     │  │     └─ fd0fa1b com.android.systemui.wallpapers.ImageWallpaper#188│  │  │     │  │        └─ com.android.systemui.wallpapers.ImageWallpaper#189│  │  │     │  │           └─ Wallpaper BBQ wrapper#190│  │  │     │  ├─ DefaultTaskDisplayArea#134│  │  │     │  │  ├─ Task=1#173│  │  │     │  │  │  ├─ Task=504#205│  │  │     │  │  │  │  └─ ActivityRecord{9dd283c u0 com.androi[...]3/.uioverrides.QuickstepLauncher#206│  │  │     │  │  │  │     ├─ 39a2f ActivityRecordInputSink com.an[...]3/.uioverrides.QuickstepLauncher#218│  │  │     │  │  │  │     ├─ fef5fb1 com.android.launcher3/com.an[...]r3.uioverrides.QuickstepLauncher#207│  │  │     │  │  │  │     │  ├─ com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#213 requestedFrameRate: {0.00 Hz FrameRateCompatibility::Default FrameRateCategory::NoPreference}│  │  │     │  │  │  │     │  └─ (Relative) ImeContainer#137 parent=206│  │  │     │  │  │  │     │     └─ WindowToken{e8a7c8b type=2011 android.os.Binder@3e1625a}#201│  │  │     │  │  │  │     │        └─ Surface(name=64140f3 InputMethod)/@0[...]mation-leash of insets_animation#219│  │  │     │  │  │  │     │           └─ 64140f3 InputMethod#202│  │  │     │  │  │  └─ home_task_overlay_container#174│  │  │     │  │  └─ Task=3#177│  │  │     │  │     ├─ Task=4#178│  │  │     │  │     │  └─ Dim layer#182│  │  │     │  │     └─ Task=5#179│  │  │     │  │        └─ Dim layer#184│  │  │     │  └─ Leaf:3:12#135│  │  │     │     └─ WindowToken{da512ac type=2038 android.os.BinderProxy@7878020}#180│  │  │     │        └─ 5bae1bd ShellDropTarget#181│  │  │     └─ ImePlaceholder:13:14#136│  │  ├─ OneHanded:15:15#138│  │  │  └─ FullscreenMagnification:15:15#139│  │  │     └─ Leaf:15:15#140│  │  │        └─ WindowToken{ddb9d1e type=2000 android.os.BinderProxy@e743da0}#198│  │  │           └─ Surface(name=39539ff StatusBar)/@0x9[...]mation-leash of insets_animation#215│  │  │              └─ 39539ff StatusBar#199│  │  │                 └─ StatusBar#209 requestedFrameRate: {0.00 Hz FrameRateCompatibility::Default FrameRateCategory::NoPreference}│  │  ├─ HideDisplayCutout:16:16#141│  │  │  └─ OneHanded:16:16#142│  │  │     └─ FullscreenMagnification:16:16#143│  │  │        └─ Leaf:16:16#144│  │  ├─ OneHanded:17:17#145│  │  │  └─ FullscreenMagnification:17:17#146│  │  │     └─ Leaf:17:17#147│  │  │        └─ WindowToken{e913107 type=2040 android.os.BinderProxy@9c13b21}#196│  │  │           └─ 32c3234 NotificationShade#197│  │  ├─ HideDisplayCutout:18:23#148│  │  │  └─ OneHanded:18:23#149│  │  │     └─ FullscreenMagnification:18:23#150│  │  │        └─ Leaf:18:23#151│  │  ├─ Leaf:24:25#152│  │  │  └─ WindowToken{5b4a718 type=2019 android.os.BinderProxy@9928a31}#210│  │  │     └─ Surface(name=5b4348a Taskbar)/@0x7d2[...]mation-leash of insets_animation#214│  │  │        └─ 5b4348a Taskbar#211│  │  │           └─ Taskbar#216 requestedFrameRate: {0.00 Hz FrameRateCompatibility::Default FrameRateCategory::NoPreference}│  │  └─ HideDisplayCutout:26:31#153│  │     └─ OneHanded:26:31#154│  │        ├─ FullscreenMagnification:26:27#155│  │        │  └─ Leaf:26:27#156│  │        ├─ Leaf:28:28#157│  │        └─ FullscreenMagnification:29:31#158│  │           └─ Leaf:29:31#159│  ├─ HideDisplayCutout:32:35#160│  │  ├─ OneHanded:32:32#161│  │  │  └─ Leaf:32:32#162│  │  ├─ FullscreenMagnification:33:33#163│  │  │  └─ Leaf:33:33#164│  │  └─ OneHanded:34:35#165│  │     └─ FullscreenMagnification:34:35#166│  │        └─ Leaf:34:35#167│  ├─ Leaf:36:36#168│  ├─ Accessibility Overlays#172│  ├─ Input Overlays#171│  └─ Display Overlays#170├─ Input Consumer recents_animation_input_consumer#208├─ WindowToken{e882739 type=2024 android.os.BinderProxy@a617300}#191│  └─ b02417e ScreenDecorOverlay#192└─ WindowToken{4e3c7c4 type=2024 android.os.BinderProxy@75a62d7}#193└─ 171f6ad ScreenDecorOverlayBottom#194
Offscreen HierarchyROOT└─ Task=2#175

aosp 15版本有以下几个比较明显新特性:

特性1
输出Composition list信息,这个输出就是代表最后参与合成的Layer信息:

LayerStack=0Layer [190] Wallpaper BBQ wrapper#190visible reason= buffer=11141145165824 frame=1 color{< 0, 0, 0, 1 >}bounds={-72,-148,3108,2859.5} toDisplayTransform={ scale x=3.1795 y=3.1797  tx=-72.0000 ty=-148.0000 }Layer [213] com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#213visible reason= buffer=12799002542087 frame=6 color{< 0, 0, 0, 1 >}bounds={0,0,2960,1440}input{(DUPLICATE_TOUCH_TO_WALLPAPER) touchableRegion={0,0,2960,1440}}Layer [209] StatusBar#209visible reason= buffer=11141145165828 frame=26 color{< 0, 0, 0, 1 >}bounds={0,0,84,1440}input{(NOT_FOCUSABLE | TRUSTED_OVERLAY) touchableRegion={0,0,84,1440}}Layer [216] Taskbar#216visible reason= buffer=12799002542090 frame=21 color{< 0, 0, 0, 1 >}bounds={0,2792,2960,1440} toDisplayTransform={ tx=0.0000 ty=2792.0000 }input{(NOT_FOCUSABLE | TRUSTED_OVERLAY | SLIPPERY) touchableRegion={0,2792,2960,1440}}

可以看出这里输出当前屏幕画面显示的Layer情况,这里其实有点类似的HWC列表输出的更加详细一些的信息汇总。
看看正常HWC的信息如下:
在这里插入图片描述
特性2

Input list这个代表是Layer信息有输入交互相关的Layer,也就是展示在这里的Layer信息,其实都是会被传递到InputDispatcher中。

Input list
LayerStack=0Layer [216] Taskbar#216visible reason= buffer=12799002542090 frame=21 color{< 0, 0, 0, 1 >}bounds={0,2792,2960,1440} toDisplayTransform={ tx=0.0000 ty=2792.0000 }input{(NOT_FOCUSABLE | TRUSTED_OVERLAY | SLIPPERY) touchableRegion={0,2792,2960,1440}}Layer [209] StatusBar#209visible reason= buffer=11141145165828 frame=26 color{< 0, 0, 0, 1 >}bounds={0,0,84,1440}input{(NOT_FOCUSABLE | TRUSTED_OVERLAY) touchableRegion={0,0,84,1440}}Layer [213] com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#213visible reason= buffer=12799002542087 frame=6 color{< 0, 0, 0, 1 >}bounds={0,0,2960,1440}input{(DUPLICATE_TOUCH_TO_WALLPAPER) touchableRegion={0,0,2960,1440}}Layer [218] 39a2f ActivityRecordInputSink com.android.launcher3/.uioverrides.QuickstepLauncher#218invisible reason=nothing to drawbounds={0,0,2960,1440}input{(NO_INPUT_CHANNEL | NOT_FOCUSABLE) replaceTouchableRegionWithCrop touchableRegion={0,0,2960,1440}}Layer [189] com.android.systemui.wallpapers.ImageWallpaper#189invisible reason=nothing to drawbounds={-14400,-29600,29600,14400} toDisplayTransform={ scale x=3.1795 y=3.1797  tx=-72.0000 ty=-148.0000 }input{(NOT_FOCUSABLE | NOT_TOUCHABLE | PREVENT_SPLITTING | IS_WALLPAPER) touchableRegion={-71,-147,-147,-71}}

上面Input list输出内容可以看出,这里重点展示的触摸相关的区域信息,而且还会有当前input layer没有visibility的原因显示,因为layer虽然可以成为InputDispatcher中的传递对象,但是他不一定显示,最经典的就是ActivityRecordInputSink这种。

特性3

Layer Hierarchy会展示出SurfaceFlinger层面的一个层级结构树,这个层级结构树是SurfaceFlinger对所有的Layer层面的,这个其实在以前wms课程中也有详细讲解,这个和wms层面的层级结构树一般都是一一对应的。

sf层级结构树情况
wms中窗口层级结构树情况
在这里插入图片描述
确实直接有了sf层面的层级结构树后,就再不需要和以前一样要对挨个Layer进行查询parent,然后拼接出相关的结构树。

虽然有了上面几个新特性的亮点功能,但是也发现aosp15版本把一些比较重要的信息进行了删除裁剪,这里最明显是再也没有详细的Layer信息。

详细Layer信息差异部分

aosp14版本有详细的Layer信息输出

+ Layer (ActivityRecord{9ab378d u0 com.android.launcher3/.uioverrides.QuickstepLauncher t287}#96) uid=1000Region TransparentRegion (this=0 count=0)Region VisibleRegion (this=0 count=0)Region SurfaceDamageRegion (this=0 count=0)layerStack=   0, z=        0, pos=(0,0), size=(   0,   0), crop=[  0,   0,  -1,  -1], cornerRadius=0.000000, isProtected=0, isTrustedOverlay=0, isOpaque=0, invalidate=1, dataspace=BT709 sRGB Full range, defaultPixelFormat=Unknown/None, backgroundBlurRadius=0, color=(-1.000,-1.000,-1.000,1.000), flags=0x00000000, tr=[0.00, 0.00][0.00, 0.00]parent=Task=287#95zOrderRelativeOf=noneactiveBuffer=[   0x   0:   0,Unknown/None], tr=[0.00, 0.00][0.00, 0.00] queued-frames=0 metadata={9:4bytes}, cornerRadiusCrop=[0.00, 0.00, 0.00, 0.00],  shadowRadius=0.000, 
+ Layer (faa830c com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#97) uid=1000Region TransparentRegion (this=0 count=0)Region VisibleRegion (this=0 count=0)Region SurfaceDamageRegion (this=0 count=0)layerStack=   0, z=        0, pos=(0,0), size=(   0,   0), crop=[  0,   0,   0,   0], cornerRadius=0.000000, isProtected=0, isTrustedOverlay=0, isOpaque=0, invalidate=1, dataspace=BT709 sRGB Full range, defaultPixelFormat=Unknown/None, backgroundBlurRadius=0, color=(-1.000,-1.000,-1.000,1.000), flags=0x00000000, tr=[0.00, 0.00][0.00, 0.00]parent=ActivityRecord{9ab378d u0 com.android.launcher3/.uioverrides.QuickstepLauncher t287}#96zOrderRelativeOf=noneactiveBuffer=[   0x   0:   0,Unknown/None], tr=[0.00, 0.00][0.00, 0.00] queued-frames=0 metadata={9:4bytes}, cornerRadiusCrop=[0.00, 0.00, 0.00, 0.00],  shadowRadius=0.000, 
+ Layer (com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#99) uid=10109Region TransparentRegion (this=0 count=0)Region VisibleRegion (this=0 count=1)[  0,   0, 1440, 2960]Region SurfaceDamageRegion (this=0 count=0)layerStack=   0, z=        0, pos=(0,0), size=(   0,   0), crop=[  0,   0,  -1,  -1], cornerRadius=0.000000, isProtected=0, isTrustedOverlay=0, isOpaque=0, invalidate=0, dataspace=BT709 sRGB Full range, defaultPixelFormat=RGBA_8888, backgroundBlurRadius=0, color=(-1.000,-1.000,-1.000,1.000), flags=0x00000100, tr=[0.00, 0.00][0.00, 0.00]parent=faa830c com.android.launcher3/com.android.launcher3.uioverrides.QuickstepLauncher#97zOrderRelativeOf=noneactiveBuffer=[1440x2960:2816,RGBA_8888], tr=[0.00, 0.00][0.00, 0.00] queued-frames=0 metadata={9:4bytes, ownerPID:1138, ownerUID:10109, dequeueTime:20729563622, windowType:1}, cornerRadiusCrop=[0.00, 0.00, 0.00, 0.00],  shadowRadius=0.000, 

但是在aosp15版本的dumpsys SurfaceFlinger中再也没有见到这个详细Layer的影子,应该也是为了精简一下dump的输出信息。因为如果带上所有的Layer信息的话,会导致每次的输出信息过多,可能要观察核心的一些信息比较难。

但是只要分析过显示相关问题的同学都知道,其实每个Layer详细信息又是非常重要的一个分析依据,比如Layer的一些显示区域VisibleRegion,flags,cornerRadiusCrop,layerStack,crop等都是非常核心的一些参考数据。
特别是在没有条件抓取Winscope相关信息时候,dumpsys信息就作为唯一信息参考源头,因为很多user版本时候,不让抓取Winscope,或者Winscope抓取要连接电脑等,抓取获取Winscope成本比较高,但是dumpsys SurfaceFlinger这个基本上没啥门槛,很容易获取。

基于以上aosp15版本上dumpsys SurfaceFlinger没有相关的详细Layer信息应该如何解决呢?是否可以考虑把详细的Layer信息进行输出呢?

这块就留给学员朋友们的一个小作业哈,难度较低,希望大家积极踊跃完成哈。

更多framework实战开发干货,请关注下面“千里马学框架”。

http://www.dtcms.com/a/288211.html

相关文章:

  • 【Keil5-map文件】
  • 初入了解渗透
  • 【SVM smote】MAP - Charting Student Math Misunderstandings
  • P1816 忠诚 题解
  • leetcode_53 最大子数组和
  • MySQL(145)如何升级MySQL版本?
  • 研华PCI-1285/1285E 系列------(一概述)
  • VIT速览
  • 用 Numpy 手动实现矩阵卷积运算
  • 汽车ECU控制器通信架构
  • 车载诊断架构 --- 故障码DTC严重等级定义
  • LVS部署模式NAT集群案例
  • WSL在 Windows 上使用 Linux 工具链和开发环境
  • 慕尼黑工业大学具身机器人实时环境探索!FindAnything:基于开放词汇对象中心映射的机器人任意环境认知与导航
  • FLASH:GPU 集群全连接通信的近最优极速调度
  • Keil编译文件格式转换全解析
  • 5 基于STM32单片机的绝缘检测系统设计(STM32代码编写+手机APP设计+PCB设计+Proteus仿真)
  • QT窗口(5)-对话框
  • 基于朴素贝叶斯的姓名性别预测系统
  • 如何构建未来的人-AI-环境智能教育生态系统
  • Java并发8--并发安全容器详解
  • 关于Vuex
  • uhd_find_devices有serial但是GNU Radio显示find no devices
  • Vue rem回顾
  • YOLOv8中添加SENet注意力机制
  • XSS-Labs 各关卡测试过程
  • 统计学习方法
  • 如何解决 ext4 文件系统的元数据损坏问题
  • 【深度强化学习】MIP-DQN 实现案例(完整Python代码)
  • [spring6: IntroductionAdvisor IntroductionInterceptor]-源码分析