Skip to content

Conversation

jesswrd
Copy link
Contributor

@jesswrd jesswrd commented Jun 24, 2025

Added docs to warn users that SystemChrome.setPreferredOrientations will not work when Flutter apps target Android 16 (SDK 36).

Fixes #162724

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jun 24, 2025
@jesswrd jesswrd requested a review from reidbaker June 24, 2025 17:24
@reidbaker reidbaker requested review from gmackall and camsim99 and removed request for reidbaker June 24, 2025 17:45
@jesswrd jesswrd requested a review from reidbaker June 24, 2025 19:01
@@ -420,6 +436,10 @@ abstract final class SystemChrome {
///
/// ### Android
///
/// If your Flutter app is targeting Android 16 (API 36) or later and you are using
/// a device with a display width >= 600 dp, then you cannot set the device
/// orientation. For more details see Android 16 docs [here](https://developer.android.com/about/versions/16/behavior-changes-16#ignore-orientation).
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you note the setPreferredOrientations method here for clarity? Something like "...you cannot set the device orientation via setPreferredOrientations".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jesswrd jesswrd requested a review from camsim99 July 7, 2025 22:26
Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jesswrd jesswrd added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 9, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jul 9, 2025
Merged via the queue into flutter:master with commit 72017e1 Jul 9, 2025
70 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 10, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 10, 2025
flutter/flutter@ac12f66...43657f3

2025-07-10 sokolovskyi.konstantin@gmail.com [web] Add frame number support. (flutter/flutter#171592)
2025-07-10 ybz975218925@gmail.com Fix the hitTest issue of reversed SliverMainAxisGroup. (flutter/flutter#171073)
2025-07-10 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 0-xqmXWc4cXzw3tfe... to lO64ePNEGrGzs-MFC... (flutter/flutter#171937)
2025-07-10 robert.ancell@canonical.com Refactor compositor classes (flutter/flutter#171414)
2025-07-10 matanlurey@users.noreply.github.com Give an actionable error to `flutter_test.*tap` of a `RenderSliver` (flutter/flutter#171930)
2025-07-10 ybz975218925@gmail.com Fix the issue with `SliverMainAxisGroups` growing in the reverse direction during layout. (flutter/flutter#171005)
2025-07-09 30870216+gaaclarke@users.noreply.github.com Adds a MCP server for working with the engine (flutter/flutter#171738)
2025-07-09 matt.boetger@gmail.com Use Async SurfaceHolder Callback to remove need for setting alpha workaround (flutter/flutter#171398)
2025-07-09 43054281+camsim99@users.noreply.github.com Update `CHANGELOG` for 3.32.5, 3.32.6 stable hotfix releases (flutter/flutter#171891)
2025-07-09 matanlurey@users.noreply.github.com Add `flutter config --enable-omit-legacy-version-file` (flutter/flutter#171903)
2025-07-09 40898687+dannyvalentesonos@users.noreply.github.com Allow flutter attach to discover flutter engine running on Custom Device (flutter/flutter#170635)
2025-07-09 matanlurey@users.noreply.github.com Hide the rarely direct used `--sample` argument by default (flutter/flutter#171898)
2025-07-09 matanlurey@users.noreply.github.com Support `NO_COLOR` to opt-out of `flutter` tool ANSI colors (flutter/flutter#171892)
2025-07-09 jessiewong401@gmail.com [Android 16] Added Docs to Warn Users that SystemChrome.setPreferredOrientations will Not Work (flutter/flutter#171089)
2025-07-09 biggs0125@gmail.com Add analytics events for wasm dry runs on web builds (flutter/flutter#171818)
2025-07-09 codefu@google.com feat: new builders for size experiment (flutter/flutter#171886)
2025-07-09 matanlurey@users.noreply.github.com Update `.gitignore`s (flutter/flutter#171907)
2025-07-09 matanlurey@users.noreply.github.com Add total execution time to the flutter upgrade command (flutter/flutter#171475)
2025-07-09 matanlurey@users.noreply.github.com Simplify the template for infrastructure requests (flutter/flutter#171905)
2025-07-09 nt4f04uNd@gmail.com Add detailed error message for BorderRadiusDirectional (flutter/flutter#171805)
2025-07-09 matanlurey@users.noreply.github.com Add public postmortem of the 3.32.3 release. (flutter/flutter#171904)
2025-07-09 matanlurey@users.noreply.github.com Make `labels` field an array (flutter/flutter#171906)
2025-07-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Roll Packages from cba2e90 to 4a231ae (5 revisions) (#171879)" (#171897)" (flutter/flutter#171910)
2025-07-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Packages from cba2e90 to 4a231ae (5 revisions) (#171879)" (flutter/flutter#171897)
2025-07-09 kjlubick@users.noreply.github.com [skia] Fix flag fiddling for Fuchsia, FreeType, & friends (flutter/flutter#171874)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC louisehsu@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 10, 2025
…rientations will Not Work (flutter#171089)

Added docs to warn users that `SystemChrome.setPreferredOrientations`
will not work when Flutter apps target Android 16 (SDK 36).

Fixes flutter#162724

## 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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 28, 2025
…rientations will Not Work (flutter#171089)

Added docs to warn users that `SystemChrome.setPreferredOrientations`
will not work when Flutter apps target Android 16 (SDK 36).

Fixes flutter#162724

## 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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…r#9589)

flutter/flutter@ac12f66...43657f3

2025-07-10 sokolovskyi.konstantin@gmail.com [web] Add frame number support. (flutter/flutter#171592)
2025-07-10 ybz975218925@gmail.com Fix the hitTest issue of reversed SliverMainAxisGroup. (flutter/flutter#171073)
2025-07-10 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 0-xqmXWc4cXzw3tfe... to lO64ePNEGrGzs-MFC... (flutter/flutter#171937)
2025-07-10 robert.ancell@canonical.com Refactor compositor classes (flutter/flutter#171414)
2025-07-10 matanlurey@users.noreply.github.com Give an actionable error to `flutter_test.*tap` of a `RenderSliver` (flutter/flutter#171930)
2025-07-10 ybz975218925@gmail.com Fix the issue with `SliverMainAxisGroups` growing in the reverse direction during layout. (flutter/flutter#171005)
2025-07-09 30870216+gaaclarke@users.noreply.github.com Adds a MCP server for working with the engine (flutter/flutter#171738)
2025-07-09 matt.boetger@gmail.com Use Async SurfaceHolder Callback to remove need for setting alpha workaround (flutter/flutter#171398)
2025-07-09 43054281+camsim99@users.noreply.github.com Update `CHANGELOG` for 3.32.5, 3.32.6 stable hotfix releases (flutter/flutter#171891)
2025-07-09 matanlurey@users.noreply.github.com Add `flutter config --enable-omit-legacy-version-file` (flutter/flutter#171903)
2025-07-09 40898687+dannyvalentesonos@users.noreply.github.com Allow flutter attach to discover flutter engine running on Custom Device (flutter/flutter#170635)
2025-07-09 matanlurey@users.noreply.github.com Hide the rarely direct used `--sample` argument by default (flutter/flutter#171898)
2025-07-09 matanlurey@users.noreply.github.com Support `NO_COLOR` to opt-out of `flutter` tool ANSI colors (flutter/flutter#171892)
2025-07-09 jessiewong401@gmail.com [Android 16] Added Docs to Warn Users that SystemChrome.setPreferredOrientations will Not Work (flutter/flutter#171089)
2025-07-09 biggs0125@gmail.com Add analytics events for wasm dry runs on web builds (flutter/flutter#171818)
2025-07-09 codefu@google.com feat: new builders for size experiment (flutter/flutter#171886)
2025-07-09 matanlurey@users.noreply.github.com Update `.gitignore`s (flutter/flutter#171907)
2025-07-09 matanlurey@users.noreply.github.com Add total execution time to the flutter upgrade command (flutter/flutter#171475)
2025-07-09 matanlurey@users.noreply.github.com Simplify the template for infrastructure requests (flutter/flutter#171905)
2025-07-09 nt4f04uNd@gmail.com Add detailed error message for BorderRadiusDirectional (flutter/flutter#171805)
2025-07-09 matanlurey@users.noreply.github.com Add public postmortem of the 3.32.3 release. (flutter/flutter#171904)
2025-07-09 matanlurey@users.noreply.github.com Make `labels` field an array (flutter/flutter#171906)
2025-07-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Roll Packages from cba2e90 to 4a231ae (5 revisions) (#171879)" (#171897)" (flutter/flutter#171910)
2025-07-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Packages from cba2e90 to 4a231ae (5 revisions) (#171879)" (flutter/flutter#171897)
2025-07-09 kjlubick@users.noreply.github.com [skia] Fix flag fiddling for Fuchsia, FreeType, & friends (flutter/flutter#171874)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC louisehsu@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…rientations will Not Work (flutter#171089)

Added docs to warn users that `SystemChrome.setPreferredOrientations`
will not work when Flutter apps target Android 16 (SDK 36).

Fixes flutter#162724

## 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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Android 16 orientation change behaviors
3 participants