-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
The launcher name on Android 11 is returned as com.android.settings instead of the actual launcher package name #348
Comments
I created an issue in IssueTracker about this here but sadly the Google engineer who picked it up marked it as "Won't fix (Intended behaviour)" 😔 In hindsight, now that I know a bit more about the issue, I probably should have created it as an issue in the |
I think this behavior is WAI. At least on Android 11 com.android.settings does define a launcher activity as well. During the boot process once the phone is unlocked, this settings FallbackHome disables itself, allowing the com.google.android.apps.nexuslauncher activity to take over. |
The device continues to report
However, as I'm sure most developers would agree, it's not a great solution to have to add an entry in the app's manifest file which is only for testing. I'll raise an issue in the android-test repo this weekend proposing that the implementation of the UiDevice.getLauncherPackageName() method should be revised to work on Android 11+ devices or that its supporting documentation comment should be revised to call out its limitations. |
I've created an issue in the android-test GitHub repo here. |
Thank you @adil-hussain-84 for creating the issue. Going back to your previous point, you could also create a test specific manifest file and add in the modifications there. |
@pkarmaka I wish it worked that way. Sadly, entries in the |
getLauncherPackagename()
returnscom.android.settings
. SomDevice.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() returnedcom.android.settings
.The text was updated successfully, but these errors were encountered: