mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-19 19:15:08 +00:00
Work around broken display listener on Android 15
A recent Android 15 upgrade broke the display listener (again). Use the alternative method for Android >= 14. Fixes #5908 <https://github.com/Genymobile/scrcpy/issues/5908>
This commit is contained in:
parent
d892a9aac5
commit
c63d9e1803
1 changed files with 3 additions and 1 deletions
|
@ -23,7 +23,9 @@ public class DisplaySizeMonitor {
|
|||
|
||||
// On Android 14, DisplayListener may be broken (it never sends events). This is fixed in recent Android 14 upgrades, but we can't really
|
||||
// detect it directly, so register a DisplayWindowListener (introduced in Android 11) to listen to configuration changes instead.
|
||||
private static final boolean USE_DEFAULT_METHOD = Build.VERSION.SDK_INT != AndroidVersions.API_34_ANDROID_14;
|
||||
// It has been broken again after an Android 15 upgrade: <https://github.com/Genymobile/scrcpy/issues/5908>
|
||||
// So use the default method only before Android 14.
|
||||
private static final boolean USE_DEFAULT_METHOD = Build.VERSION.SDK_INT < AndroidVersions.API_34_ANDROID_14;
|
||||
|
||||
private DisplayManager.DisplayListenerHandle displayListenerHandle;
|
||||
private HandlerThread handlerThread;
|
||||
|
|
Loading…
Add table
Reference in a new issue