Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix ViewRootImpl crash when using AndroidView on some brand devices#17611

Closed
dotcink wants to merge 1 commit into
flutter-team-archive:masterfrom
dotcink:fix-platformview-crash
Closed

Fix ViewRootImpl crash when using AndroidView on some brand devices#17611
dotcink wants to merge 1 commit into
flutter-team-archive:masterfrom
dotcink:fix-platformview-crash

Conversation

@dotcink

@dotcink dotcink commented Apr 9, 2020

Copy link
Copy Markdown

Fix flutter/flutter/issues/47154, flutter/flutter/issues/26345

Tested on

  • Redmi Note 7 Pro, reproduced by showing soft keyboard while playing video in WebView(webview_flutter plugin).

When soft keyboard shows/hides, VirtualDisplayController.resize() is called, and SingleViewPresentation would be recreated,
then the deprecated presentation SHOULD be canceled, which would call ViewRootImpl.unscheduleTraversals(), before at most 1 ViewRootImpl.performTraversals() calls, which are triggered by scheduleTraversals().
Actually, after resize, the first performTraversals() would make mDisplay field null, and the second would crash with NullPointerException .

@auto-assign auto-assign Bot requested a review from jason-simmons April 9, 2020 19:36
@jason-simmons jason-simmons requested a review from amirh April 9, 2020 20:49
@dotcink dotcink force-pushed the fix-platformview-crash branch from 01f192d to 9fedd66 Compare April 13, 2020 03:18
@GaryQian

GaryQian commented Apr 23, 2020

Copy link
Copy Markdown
Contributor

Thanks for your PR! After testing it, it caused the old contents to stop playing when this was called, though it does prevent the crash. I worked with it some more and came up with #17897 which is able to fix the crash without the new stop-playing bug.

@dotcink

dotcink commented Apr 23, 2020

Copy link
Copy Markdown
Author

Thanks for your PR! After testing it, it caused the old contents to stop playing when this was called, though it does prevent the crash. I worked with it some more and came up with #17897 which is able to fix the crash without the new stop-playing bug.

This is more reasonable, though I've not encountered this bug.

@dotcink dotcink closed this Apr 23, 2020
@GaryQian

Copy link
Copy Markdown
Contributor

FYI. #17897 has landed in the engine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3 participants