android / android/testing-samples
The launcher name on Android 11 is returned as com.android.settings instead of the actual launcher package name
- Lingua principale
- Java
- Stelle
- 9.3k
- Fork
- 3.6k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
`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`.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia tracciando getLauncherPackagename() e la chiamata mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT), quindi riproduci il controllo della configurazione usando device.getCurrentPackageName() su Android 11. Il lavoro è completato quando il pacchetto del launcher viene identificato come il launcher effettivo anziché com.android.settings e l’attesa punta a quel pacchetto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, java
- Ambito
- mobile, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100