-
Notifications
You must be signed in to change notification settings - Fork 6k
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 acquireLatestImage exceeds maxImage and cause IllegalStateException. #20475
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 Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
I filed an issue flutter/flutter#63897 about this and provided the reproduced steps to reproduce it by 100%. Hope this can help to offer more information to solve this problem. |
Thanks for the PR. I'd prefer to fix the root cause of this issue. #20842 attempts to do that. Would you be able to verify the fix? |
Description
When using
PlatformViewLink
widget to wrap a nativeWebView
in Android, in certain scenarios, the app will be crashed with following callstack.Scenario
Here's the official document for
acquireLatestImage()
https://developer.android.com/reference/android/media/ImageReader#acquireLatestImage()It says that
So, I tried to catch
IllegalStateException
to prevent the native crash.As for in what circumstances it will cause this scenario, since I am not so familiar with flutter/engine. It may need other's help to figure it out.
Related Issues
Maybe related to the issue mentioned in
https://github.com/flutter/engine/pull/19325/files#
https://github.com/flutter/engine/pull/19487/files
Tests
I added the following tests:
Replace this with a list of the tests that you added as part of this PR. A
change in behaviour with no test covering it will likely get reverted
accidentally sooner or later. PRs must include tests for all
changed/updated/fixed behaviors. See testing the engine for instructions on
writing and running engine tests.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.