-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
fix freeze and thaw rotation for Android 15 preview #4740
fix freeze and thaw rotation for Android 15 preview #4740
Conversation
Thank you. Could you please post your framework.jar please?
|
🤔 |
I got the same thing. You can ignore the checksum with |
Looks like they published the source for this change in master now:
|
Ah, thanks. Makes sense. I guess we can add "scrcpy" or "scrcpy#setRotation" and "scrcpy#restoreRotationStateLocked" to follow their lead. |
Refs <https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/> PR #4740 <#4740> Signed-off-by: Romain Vimont <[email protected]>
@rom1v tested |
Btw, it seems the change has landed in Android 14 (stable, not preview), on a Pixel 8 without this PR I get the error on rotation with MOD+r.
|
Changed since AOSP/framework_base commit 670fb7f5c0d23cf51ead25538bcb017e03ed73ac, included in tag android-14.0.0_r29. Refs <https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/> PR #4740 <#4740> Signed-off-by: Romain Vimont <[email protected]>
Merged into |
scrcpy/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java Lines 49 to 106 in 7011dd1
Should try the newest method first, then old method. Because the old method still exists while the new method is introduced. Seeing #4841 |
Nope, it was replaced: https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/ |
While If try
So try
BTW, scrcpy/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java Lines 183 to 197 in 7011dd1
|
Oh ok, sorry, I've read the whole thing from my phone, I will check later from my computer. |
Oh, oups. I didn't notice that your refactor @rom1v changed this. Before we were trying the methods which allow to specify the |
Old Android versions may not be able to register a rotation watcher for a secondary display. In that case, report the error instead of registering a rotation watcher for the default display. Refs <#4740 (comment)> Suggested by: Kaiming Hu <[email protected]>
LGTM, see #4841. |
Select the available method to invoke the same way as in other wrappers (using a version field). Refs d894e27 Refs Genymobile#4740 <Genymobile#4740>
Changed since AOSP/framework_base commit 670fb7f5c0d23cf51ead25538bcb017e03ed73ac, included in tag android-14.0.0_r29. Refs <https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/> PR Genymobile#4740 <Genymobile#4740> Signed-off-by: Romain Vimont <[email protected]>
The version of the methods with the display id parameter must be tried first, otherwise they will never be used (since the old versions without the display id are still present). Regression introduced by ee6620d. Refs Genymobile#4740 <Genymobile#4740> PR Genymobile#4841 <Genymobile#4841> Signed-off-by: Romain Vimont <[email protected]>
Old Android versions may not be able to register a rotation watcher for a secondary display. In that case, report the error instead of registering a rotation watcher for the default display. Refs <Genymobile#4740 (comment)> Suggested by: Kaiming Hu <[email protected]>
Select the available method to invoke the same way as in other wrappers (using a version field). Refs d894e27 Refs Genymobile#4740 <Genymobile#4740>
Changed since AOSP/framework_base commit 670fb7f5c0d23cf51ead25538bcb017e03ed73ac, included in tag android-14.0.0_r29. Refs <https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/> PR Genymobile#4740 <Genymobile#4740> Signed-off-by: Romain Vimont <[email protected]>
The version of the methods with the display id parameter must be tried first, otherwise they will never be used (since the old versions without the display id are still present). Regression introduced by ee6620d. Refs Genymobile#4740 <Genymobile#4740> PR Genymobile#4841 <Genymobile#4841> Signed-off-by: Romain Vimont <[email protected]>
Old Android versions may not be able to register a rotation watcher for a secondary display. In that case, report the error instead of registering a rotation watcher for the default display. Refs <Genymobile#4740 (comment)> Suggested by: Kaiming Hu <[email protected]>
On a device with Android 15 developer preview (and I think this also impacts the 14 QPR3 Beta) we get an error when trying to rotate the device:
The source code is not out yet, but using reflection we can see that the freeze and thaw rotation methods all have a new signature with a
String
parameter added:I tried passing an empty String and it works.
This PR adds these new method signatures to try first.