Start the virtualdisplay‘s desktop#5838
Conversation
887a51e to
2eebaf3
Compare
|
Thank you for the PR. I tested on a OnePlus 7 Pro on Android 11, which shows a black screen for new displays on scrcpy 3.1. Btw, this PR only launches a secondary home for Android < 13, but I observed that on some devices even with Android 14, virtual displays have no home. |
Thank you for your replay. Sorry, I only tested the icon click events on Android 12 and 12_v2. Android 10 and 11 are not tested. The icon click events on Android 12 and 12_v2 are ok. Then the app re-route to the default display. Android 12 and 12_v2 are allowed to launch activities on specified display. I have an Android 10 Huawei device but it doesn't have seconday home. When I use the following code, the secondaryhome is re-routesd from virtualdisplay to the defalut display. or When I use the following code, It is ok. or CATEGORY_SECONDARY_HOME and CATEGORY_DEFAULT must be used together. |
e06777a to
4841fdd
Compare

Android API 33(+) start the secondary screen desktop when creating a virtualdisplay.
Android API 29 ~ 32 does not start the secondary screen desktop when creating a virtualdisplay, and the virtualdisplay is a black screen. so I try to start the secondary screen desktop.
as show (even though it's ugly 🙂):
Some Huawei phones do not have SECONDARY_HOME activity,
com.huawei.android.launcher/com.huawei.android.launcher.unihome.UniHomeLauncher is returned during resolve CATEGORY_HOME,
But com.huawei.android.internal.app/com.huawei.android.internal.app.HwResolverActivity is returned instead of null during resolve CATEGORY_SECONDARY_HOME. So I compared packageName.