Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt: specification for package name when get_render_resolution in an Android device #1070

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

hgjazhgj
Copy link
Contributor

@hgjazhgj hgjazhgj commented Jul 25, 2022

在Android.get_render_resolution中增加应用包名参数
这使得get_render_resolution能够获取到除top activity以外的应用的渲染区域
理由有二:

首先:有些应用会创建悬浮窗,导致top activity并不是用户所关注的应用,例如在我的手机上

PS D:\> adb -s 10.0.0.9:5555 shell dumpsys activity top | findstr "ACTIVITY"
  ... only shows the last 2 lines ...
  ACTIVITY com.tencent.mobileqq/.activity.SplashActivity 4a97d1 pid=10070
  ACTIVITY com.android.systemui/.bubbles.BubbleOverflowActivity 2c11f28 pid=2608

我想调试QQ,但是当前的top activity是一个气泡,即使我一直在QQ中收发消息,并且现在屏幕上根本见不着这个气泡,
这使得我不得不通过某些手段杀掉这个气泡才能获取到qq的渲染区域,这是非常不方便的

其次:由于先前的get_render_resolution需要获取top acvity,在我的手机上这最终会从dumpsys activity top命令中获取,而该命令执行缓慢,通常需要2-3秒才能执行完毕,这使得如果我把get_render_resolution注册到rotation_watcher--屏幕旋转后原本在左边的黑边就跑到右边去了所以要重新获取渲染区域--就会带来一些表现问题,我希望能够加速这一过程

最后:render resolution本就是每个应用都有,能够指定应用包名而非限制顶层应用更加符合get_render_resolution的语义

@hgjazhgj hgjazhgj changed the title Opt: specification for package name when get_render_device in an Android device Opt: specification for package name when get_render_resolution in an Android device Jul 25, 2022
@hgjazhgj hgjazhgj changed the base branch from master to dev August 27, 2022 02:48
@hgjazhgj hgjazhgj changed the base branch from dev to master August 27, 2022 02:48
@yimelia yimelia mentioned this pull request Sep 7, 2022
@yimelia yimelia merged commit 9e80ebc into AirtestProject:master Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants