Skip to content

[CP-stable]Ensure resize listener is not added if content sizing is not turned on#182320

Merged
auto-submit[bot] merged 1 commit into
flutter:flutter-3.41-candidate.0from
flutteractionsbot:cp-stable-b9febd89914528cebe706547877de265f1a0a7eb
Feb 17, 2026
Merged

[CP-stable]Ensure resize listener is not added if content sizing is not turned on#182320
auto-submit[bot] merged 1 commit into
flutter:flutter-3.41-candidate.0from
flutteractionsbot:cp-stable-b9febd89914528cebe706547877de265f1a0a7eb

Conversation

@flutteractionsbot

@flutteractionsbot flutteractionsbot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

This pull request is created by automatic cherry pick workflow

Issue Link:

What is the link to the issue this cherry-pick is addressing?

#179673

Impact Description:

What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?

  • Content Sizing is affecting platform views even when content sizing is not enabled via the feature flag.
    Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
    or the shipping of production apps (the app crashes on launch).
  • Shipping of production apps
    This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.

There is a race condition in the content sizing code that sometimes causes a platform view to not appropriately rotate (as can be seen from the flakey test goldens).

Changelog Description:

Explain this cherry pick:

  • In one line that is accessible to most Flutter developers.
  • Ensures no side effects from content sizing when content sizing is not enabled by the user.
  • That describes the state prior to the fix.
  • Sometimes platform views will not render as desired.
  • That includes which platforms are impacted.
    Android

< Replace with changelog description here >
[flutter/179673] When content sizing is not enabled on Android, a race condition can sometimes make platform views not render correctly.

Workaround:

Is there a workaround for this issue?

No workaround.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

Run the flakey test several times to make sure it passes all the time (as can be seen from the flake being fixed here: https://flutter-dashboard.appspot.com/#/build?taskFilter=Linux_android_emu+android_engine_opengles_tests)

flutter#182168)

Make sure the resize listener is not added if content sizing is not
enabled. This should ensure that the resize listener is not causing the
flake. While this won't fix the flake if content sizing is enabled -
this test was passing before content sizing was checked in therefore
this should remove any side effect content sizing is having on the test.

Fixes: flutter#179673

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
@flutteractionsbot flutteractionsbot requested a review from a team as a code owner February 12, 2026 21:51
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Feb 12, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor Author

@mboetger please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard

Copy link
Copy Markdown

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions Bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. team-android Owned by Android platform team labels Feb 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request addresses an issue where the resize listener was being added and removed unconditionally, even when content sizing was not enabled. The changes correctly gate the addition and removal of the flutterUiResizeListener behind the isContentSizingEnabled flag, ensuring that the listener is only active when necessary. This is a good improvement for correctness and efficiency.

@reidbaker reidbaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL approval Up to ewall to approve for the patch release.

@reidbaker reidbaker requested a review from walley892 February 17, 2026 15:43
@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 17, 2026
@auto-submit auto-submit Bot merged commit 87054f6 into flutter:flutter-3.41-candidate.0 Feb 17, 2026
162 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue engine flutter/engine related. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants