android / android/testing-samples

The launcher name on Android 11 is returned as com.android.settings instead of the actual launcher package name

未关闭
#348 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
9.3k
派生
3.6k
PR 合并指标
30 天内没有已合并 PR

描述

`getLauncherPackagename()` returns `com.android.settings`. So `mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT);` doesn't really wait for the launcher package.
I believe this is due to the package visibility changes on Android 11.

Our test setup consisted of this check before starting with the tests:
`String currentPackageName = device.getCurrentPackageName();
if (currentPackageName != null) {
assertEquals(packageName, currentPackageName);
}`

This failed as currentPackageName returned as `com.google.android.apps.nexuslauncher` and getLauncherPackagename() returned `com.android.settings`.

贡献指南

打开贡献指南

调研方向

首先跟踪 getLauncherPackagename() 和 mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT) 调用,然后在 Android 11 上使用 device.getCurrentPackageName() 重现设置检查。完成的标准是将 launcher package 识别为实际的 launcher,而不是 com.android.settings,并且 wait 以该 package 为目标。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, java
领域
mobile, testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。