aosp 14的WMShell相关的proto日志如何查看打印-framework分屏相关

背景:

有学员朋友在群里询问WMShell相关的Proto日志该如何打印相关疑问,这里其实在aosp13时候是有分享过的
https://blog.csdn.net/learnframework/article/details/129474650

aosp13时候:

test@test:~/aosp/frameworks$ adb shell wm logging enable-text  WM_SHELL_STARTING_WINDOW
Loaded 705 log definitions from /system/etc/protolog.conf.json.gz
No IProtoLogGroup named WM_SHELL_STARTING_WINDOW
Not handled, calling status bar with args: [enable-text, WM_SHELL_STARTING_WINDOW]
Starting logging on groups: [WM_SHELL_STARTING_WINDOW]

那时候直接调用wm即wms的下面的proto开启方式,虽然提示Not handled, calling status bar with args,但是依旧wms会跨进程调用到了systemui进程帮我们把proto打开。
在这里插入图片描述
但是在aosp14版本上一样方式执行显示如下:

test@test:~/disk2/aosp14/frameworks/base$ adb shell wm logging enable-text  WM_SHELL_STARTING_WINDOW
Loaded 753 log definitions from /system/etc/protolog.conf.json.gz
No IProtoLogGroup named WM_SHELL_STARTING_WINDOW
Not handled, please use `adb shell dumpsys activity service SystemUIService WMShell` if you are looking for ProtoLog in WMShell

这里明显看到没有帮我们开启相关的proto,让用adb shell dumpsys activity service SystemUIService WMShell命令去开启。
aosp14代码:
frameworks/base/services/core/java/com/android/server/wm/WindowManagerShellCommand.java
在这里插入图片描述可以看出来,这里wms没有帮我们跨进程让systemui干了,只是用了一下相关的提示命令。

具体实战验证剖析

这里可以先使用一下WMShell的help命令

test@test:~/disk2/aosp14/frameworks/base$ adb shell dumpsys activity service SystemUIService WMShell help
SERVICE com.android.systemui/.SystemUIService b7c03e4 pid=2600 user=0
  Client:
    Dump starting: 07-02 11:06:20.225

    com.android.systemui.wmshell.WMShell:
    ----------------------------------------------------------------------------
    Window Manager Shell commands:
      compatui
        restartDialogEnabled [0|false|1|true]
          Enable/Disable the restart education dialog for Size Compat Mode
        reachabilityEducationEnabled [0|false|1|true]
          Enable/Disable the restart education dialog for letterbox reachability
          Disable the restart education dialog for letterbox reachability
      protolog
        status
          Get current ProtoLog status.
        start
          Start proto logging.
        stop
          Stop proto logging and flush to file.
        enable [group...]
          Enable proto logging for given groups.
        disable [group...]
          Disable proto logging for given groups.
        enable-text [group...]
          Enable logcat logging for given groups.
        disable-text [group...]
          Disable logcat logging for given groups.
        save-for-bugreport
          Flush proto logging to file, only if it's enabled.
      splitscreen
        moveToSideStage <taskId> <SideStagePosition>
          Move a task with given id in split-screen mode.
        removeFromSideStage <taskId>
          Remove a task with given id in split-screen mode.
        setSideStagePosition <SideStagePosition>
          Sets the position of the side-stage.
      transitions
        tracing
          start
            Start tracing the transitions.
          stop
            Stop tracing the transitions.
          save-for-bugreport
            Flush in memory transition trace to file.
      help
          Print this help text.
      <no arguments provided>
        Dump all Window Manager Shell internal state

    NORMAL dump took 0ms -- com.android.systemui.wmshell.WMShell

    Dump took 1ms

这里重点关注protolog相关的输出,发现也是和wm的proto没有区别。

看看分屏相关的Proto日志:
在这里插入图片描述

体验一下开启:
adb shell dumpsys activity service SystemUIService WMShell protolog enable-text WM_SHELL_SPLIT_SCREEN

然后操作进入投屏再看看日志:

test@test:~/disk2/aosp14/frameworks/base$ adb logcat -c;adb logcat -s ShellSplitScreen
07-02 11:35:00.137  2600  2636 D ShellSplitScreen: Request to show divider bar from com.android.wm.shell.splitscreen.SplitScreenController.onKeyguardVisibilityChanged:15.
07-02 11:35:01.440  2600  2636 D ShellSplitScreen: Set divider bar non-interactive from onSplitResizeStart
07-02 11:35:01.735  2600  2636 D ShellSplitScreen: Set divider bar interactive from onSplitResizeFinish

可以看到有相关ShellSplitScreen的打印,注意这里的ShellSplitScreen是源码中看出来的,每个可能不一样
代码路径:

frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/protolog/ShellProtoLogGroup.java
在这里插入图片描述
可以去这个代码里面查验自己的TAG,这里是Consts.TAG_WM_SPLIT_SCREEN
在这里插入图片描述
所以tag就是ShellSplitScreen。

总结

针对WMShell包下面的Proto日志,在高版本aosp14统一只能使用

adb shell dumpsys activity service SystemUIService WMShell protolog enable-text XXXX
方式来开启,而且相关logcat过滤的TAG需要去看看
frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/protolog/ShellProtoLogGroup.java
具体对应TAG是啥。

本文章更多详细代码和资料需要购买课程获取
hal+perfetto+surfaceflinger
https://mp.weixin.qq.com/s/LbVLnu1udqExHVKxd74ILg
在这里插入图片描述

其他课程七件套专题:在这里插入图片描述
点击这里
https://mp.weixin.qq.com/s/Qv8zjgQ0CkalKmvi8tMGaw

视频试看:
https://www.bilibili.com/video/BV1wc41117L4/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千里马学框架

帮助你了,就请我喝杯咖啡

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值