-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Start the virtualdisplay‘s desktop #5838
base: dev
Are you sure you want to change the base?
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. |
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.