This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Fix resize crash in Android virtual display#37329
Merged
auto-submit[bot] merged 2 commits intoflutter:mainfrom Nov 16, 2022
Merged
Fix resize crash in Android virtual display#37329auto-submit[bot] merged 2 commits intoflutter:mainfrom
auto-submit[bot] merged 2 commits intoflutter:mainfrom
Conversation
In the Virtual Display codepath for Android platform views, resize completes asynchronously. Currently it is attempting to access the Context in the completion handler, but there is no guarantee that it is still present at that point, leading to possible null pointer crashes. This adds a check for the current state of the Context, and uses a fallback if it's not available. Fixes flutter/flutter#114095
GaryQian
reviewed
Nov 10, 2022
| physicalHeight, | ||
| () -> { | ||
| unlockInputConnection(vdController); | ||
| // Converting back to logic pixels requires a context, which may no longer be |
Contributor
There was a problem hiding this comment.
Sounds like the only way this fails is if the user changes the scale/UI density in the settings app while the Flutter app is running, right?
Contributor
There was a problem hiding this comment.
That seems like a reasonable tradeoff vs crashing
Contributor
Author
There was a problem hiding this comment.
I think so, and they'd have to do it during this race, which seems pretty unlikely.
And I'm still not sure what the repro for this is; it may well be that it only happens during teardown and the return value will be ignored anyway.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 16, 2022
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Nov 16, 2022
* 7a5bc91 Roll Skia from 4b3d36f36bf3 to 74a57221dfb3 (7 revisions) (flutter/engine#37675) * f4ca3e7 [fuchsia] Fix shader warmup. (flutter/engine#37662) * 97974eb Fix resize crash in Android virtual display (flutter/engine#37329)
shogohida
pushed a commit
to shogohida/flutter
that referenced
this pull request
Dec 7, 2022
…5478) * 7a5bc91 Roll Skia from 4b3d36f36bf3 to 74a57221dfb3 (7 revisions) (flutter/engine#37675) * f4ca3e7 [fuchsia] Fix shader warmup. (flutter/engine#37662) * 97974eb Fix resize crash in Android virtual display (flutter/engine#37329)
gspencergoog
pushed a commit
to gspencergoog/flutter
that referenced
this pull request
Jan 19, 2023
…5478) * 7a5bc91 Roll Skia from 4b3d36f36bf3 to 74a57221dfb3 (7 revisions) (flutter/engine#37675) * f4ca3e7 [fuchsia] Fix shader warmup. (flutter/engine#37662) * 97974eb Fix resize crash in Android virtual display (flutter/engine#37329)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the Virtual Display codepath for Android platform views, resize completes asynchronously. Currently it is attempting to access the Context in the completion handler, but there is no guarantee that it is still present at that point, leading to possible null pointer crashes.
This adds a check for the current state of the Context, and uses a fallback if it's not available.
Fixes flutter/flutter#114095
Pre-launch Checklist
///).