-
Notifications
You must be signed in to change notification settings - Fork 6k
Workaround HardwareRenderer breakage in Android 14 #52370
Workaround HardwareRenderer breakage in Android 14 #52370
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:chef_kiss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good but I would expect that we had a test at least calling clear/reset surface and one making sure that the onTrimMemory was forwarded to the PlatformViewsController.
shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java
Show resolved
Hide resolved
Failing test is a trim memory test engine/shell/platform/android/test/io/flutter/embedding/engine/renderer/FlutterRendererTest.java Line 625 in fa48884
|
shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java
Show resolved
Hide resolved
8636f6e
to
f3c466d
Compare
Tested the latest version of this patch with a repro app shared by @johnmccutchan, by backgrounding the app and then repeatedly opening and backgrounding the built in camera app. Looks like it is working to me! Didn't experience any instances of the breakage |
- Destroy ImageReaders on memory trim. - Unset the VirtualDisplay's surface on memory trim. - On resume, recreate ImageReaders. - On resume, do a dumb little dance and then set the VirtualDisplay's surface Fixes: flutter/flutter#146499 Fixes: flutter/flutter#144219 Internal bug: b/335646931 Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418 Unclear when the Android fix will be available in phones.
f3c466d
to
f0a4719
Compare
…147560) flutter/engine@c519e9d...ea63438 2024-04-30 [email protected] Workaround HardwareRenderer breakage in Android 14 (flutter/engine#52370) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Failed to create CP due to merge conflicts. |
- Destroy ImageReaders on memory trim. - Unset the VirtualDisplay's surface on memory trim. - On resume, recreate ImageReaders. - On resume, do a dumb little dance and then set the VirtualDisplay's surface Fixes: flutter/flutter#146499 Fixes: flutter/flutter#144219 Internal bug: b/335646931 Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418 Android 15 will include the fix. Unclear if Android 14 will be patched.
- Destroy ImageReaders on memory trim. - Unset the VirtualDisplay's surface on memory trim. - On resume, recreate ImageReaders. - On resume, do a dumb little dance and then set the VirtualDisplay's surface Fixes: flutter/flutter#146499 Fixes: flutter/flutter#144219 Internal bug: b/335646931 Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418 Android 15 will include the fix. Unclear if Android 14 will be patched.
- Destroy ImageReaders on memory trim. - Unset the VirtualDisplay's surface on memory trim. - On resume, recreate ImageReaders. - On resume, do a dumb little dance and then set the VirtualDisplay's surface Fixes: flutter/flutter#146499 Fixes: flutter/flutter#144219 Internal bug: b/335646931 Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418 Android 15 will include the fix. Unclear if Android 14 will be patched.
Failed to create CP due to merge conflicts. |
- Destroy ImageReaders on memory trim. - Unset the VirtualDisplay's surface on memory trim. - On resume, recreate ImageReaders. - On resume, do a dumb little dance and then set the VirtualDisplay's surface Fixes: flutter/flutter#146499 Fixes: flutter/flutter#144219 Internal bug: b/335646931 Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418 Android 15 will include the fix. Unclear if Android 14 will be patched.
- Destroy ImageReaders on memory trim. - Unset the VirtualDisplay's surface on memory trim. - On resume, recreate ImageReaders. - On resume, do a dumb little dance and then set the VirtualDisplay's surface Fixes: flutter/flutter#146499 Fixes: flutter/flutter#144219 Internal bug: b/335646931 Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418 Android 15 will include the fix. Unclear if Android 14 will be patched.
- **Replace LinkedLists that are used as a queue in android FlutterRenderer with ArrayDeques (#51494)** - **Workaround HardwareRenderer breakage in Android 14 (#52370)** Fixes flutter/flutter#147644 Includes #51494 to avoid merge conflicts and have a cleaner merge.
Fixes: flutter/flutter#146499
Fixes: flutter/flutter#144219
Internal bug: b/335646931
Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418
Android 15 will include the fix. Unclear if Android 14 will be patched.