Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Android] Add mechanism for setting Android engine flags via Android manifest (take 2)#181632

Merged
auto-submit[bot] merged 7 commits intoflutter:masterfrom
camsim99:manifest_flags
Feb 9, 2026
Merged

[Android] Add mechanism for setting Android engine flags via Android manifest (take 2)#181632
auto-submit[bot] merged 7 commits intoflutter:masterfrom
camsim99:manifest_flags

Conversation

@camsim99
Copy link
Contributor

@camsim99 camsim99 commented Jan 28, 2026

A continuation of #177127. Copying from there:

Overview

Note

This PR is based on conversation & feedback on go/flutter-android-harden-engine-shell-arguments.

Adds a mechanism for setting Android engine flags via the manifest. If a flag is specified on the command line and in manifest metadata, the value specified on the command line will take precedence. Documentation is added on this mechanism

Additionally, this PR removes the exposure of--cache-sksl command line flag as per https://github.com/flutter/flutter/issues/140310#issuecomment-2708459007.

Additionally, this PR adds documentation for the only two supported ways of setting engine flags moving forward -- via the command line or manifest. The Intent mechanism will be removed when #180686 is completed (intended to be a follow up to this PR).

As the unit tests in this PR only cover setting flags via manifest in debug mode, I will follow up this PR with an integration test to test that flags are appropriately respected/ignored in release mode. See #178383 for my currently working but WIP draft.

Part of #172553.

Follow up work:

Add integration test for this new added mechanism

This will land as an immediate follow-up to this PR. WIP in #178383.

Remove support for setting shell arguments via Intent

This task will be a follow up to this work + the integration test landing, and will complete work for #172553. See #180686 for details.

Pre-launch Checklist

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

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. d: examples Sample code and demos team-android Owned by Android platform team labels Jan 28, 2026
@github-actions github-actions bot added team-engine Owned by Engine team d: docs/ flutter/flutter/docs, for contributors labels Jan 28, 2026
@camsim99 camsim99 marked this pull request as ready for review January 29, 2026 18:33
@camsim99 camsim99 requested a review from a team as a code owner January 29, 2026 18:33
Copy link
Contributor

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

Choose a reason for hiding this comment

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

Code Review

This pull request refactors how Flutter engine flags are handled on Android, deprecating the use of Android Intent extras for setting these flags. The FlutterShellArgs class has been completely redesigned to define flags as Flag objects, specifying their command-line argument, manifest metadata key, and whether they are allowed in release mode. A new utility class, FlutterShellArgsIntentUtils, was introduced to encapsulate the logic for extracting flags from Intent extras, with a clear intention for its eventual removal. The FlutterLoader class was updated to process engine flags by prioritizing command-line arguments over AndroidManifest.xml metadata, and then applying internal defaults. It also includes new logic to warn developers about deprecated Intent usage and to enforce release-mode restrictions for certain flags. The documentation (Android-Flutter-Shell-Arguments.md) was added to guide developers on the new recommended methods for setting engine flags (command-line, manifest metadata, or programmatically). Review comments highlighted a potential issue where the PlatformViewsController might not correctly configure software rendering if the --enable-software-rendering flag is passed via the command line, and also pointed out a discrepancy between the documentation and implementation for the ImpellerLazyShaderMode metadata key.

@camsim99
Copy link
Contributor Author

camsim99 commented Feb 3, 2026

For reviewers coming from the last review of the old PR (#177127), here's a recap of what's changed:
notable changes I've made since + some review comments I want to explicitly address:

Notable changes

  1. Removed "soon" verbiage in reference to when the ability to set flags via Intents will be removed -- related discussion
  2. Added back tests for flutterActivity.getFlutterShellArgs() since I'm not yet removing that fuctionality -- done in this commit
  3. Added a warning message for flags that I renamed in case external developers are using the old names. These were only used in Flutter code that I saw but added just in caseI do break people. Done in b8c9f08.
  4. Maintains compatibility with flags that I renamed to match Android convention + match the rest of the manifest flag metadata key names. Done in daf6d37

Notable comments addressed

  1. Maintained refactoring of FlutterShellArgs for simplicity reasons -- related discussion. I also made an internal fix to refactor code there as needed.
  2. Maintained refactoring of flags to live closer to where they are used -- related discussion, i.e changed definition of "io.flutter.automatically-register-plugins" flag to not reference FlutterLoader where it is not used.

@camsim99 camsim99 requested a review from reidbaker February 3, 2026 19:26
@flutter-dashboard

This comment was marked as resolved.

import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
public class FlutterShellArgsTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a test in this file that make sure that flags that are not allowed in release cant be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not aware of a way to run unit tests like these in release mode, but let me know if I'm wrong! I am planning on relying on the integration tests that I'll land immediately after this to test release mode.

Copy link
Contributor

@reidbaker reidbaker Feb 5, 2026

Choose a reason for hiding this comment

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

integration tests in a followup pr are ok with me.
If you wanted to use unit tests (which I think are easier to maintain). You would add a test in FlutterLoaderTest.java then modify ensureInitializationComplete to allow you in testing to override BuildConfig.RELEASE.

public void ensureInitializationComplete(
      @NonNull Context applicationContext, @Nullable String[] args) {
     return ensureInitializationCompleteInternal(applicationContext, args, BuildConfig.RELEASE);
}

@visibleForTesting 
/* package */ void ensureInitializationCompleteInternal(
      @NonNull Context applicationContext, @Nullable String[] args, bool isRelease) {
    if (initialized) { ...

Copy link
Contributor

Choose a reason for hiding this comment

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

@jesswrd in your investigation into AGP 9 did you see anything about BuildConfig.RELEASE being considered difficult to migrate? If so what is the better pattern to use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah that unit test strategy is awesome. I'm gonna add some unit tests before landing this with that. Thanks for the tip!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed the BuildConfig.RELEASE usage in this PR offline with @jesswrd and we decided this is ok to land as is. The concern is that AGP 9 does not support the usage of the BuildConfig API directly. Ultimately, we will need a solution for all BuildConfig usages, and since that does not have a clear timeline, we shouldn't block the increased test coverage by using it for now.

As an aside because we did some brief digging on the BuildConfig that this PR refers to:
We know that BuildConfig.RELEASE actually refers to a Flutter API that is generated by an embedding build. We have not dug further to know how the flutter_runtime_mode is defined (whether it's AGP or not), but this structure may be helpful if we do need to work around AGP 9 restrictions later.

* @param isRelease Whether or not the Flutter component is running in release mode.
*/
@SuppressLint("NewApi") // Calls to Stream and Collection#stream require API 24
public void ensureInitializationComplete(
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be public and should have @VisibleForTesting

@camsim99 camsim99 requested a review from reidbaker February 9, 2026 19:29
@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 9, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Feb 9, 2026
Merged via the queue into flutter:master with commit 99c5bd4 Feb 9, 2026
180 of 181 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 9, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 10, 2026
Roll Flutter from e8f9dc50356d to 9bda20a11f1e (34 revisions)

flutter/flutter@e8f9dc5...9bda20a

2026-02-10 [email protected] Remove Material import from focus_traversal_test.dart (flutter/flutter#180994)
2026-02-10 [email protected] Roll Skia from 6e217430c052 to cffb3bf918df (1 revision) (flutter/flutter#182131)
2026-02-10 [email protected] Encourage splitting large test files in testing documentation 2 (flutter/flutter#182051)
2026-02-10 [email protected] refactor: migrate CupertinoPageTransitionsBuilder to cupertino folder (flutter/flutter#179776)
2026-02-10 [email protected] Delete the last remaining skia only fragment shader tests (flutter/flutter#182127)
2026-02-10 [email protected] [a11y][android] Set new CheckState APIs for android API 36  (flutter/flutter#182113)
2026-02-10 [email protected] Add missing dependencies to framework_tests_misc_leak_tracking (flutter/flutter#181929)
2026-02-10 [email protected] Roll Dart SDK from eee0e2e11174 to 69eb951f8f7e (2 revisions) (flutter/flutter#182128)
2026-02-10 [email protected] Marks Linux_android_emu android_display_cutout to be flaky (flutter/flutter#181901)
2026-02-10 [email protected] Bump Dart to 3.10 (flutter/flutter#174066)
2026-02-10 [email protected] Roll Skia from d4b7e24a209b to 6e217430c052 (6 revisions) (flutter/flutter#182126)
2026-02-09 [email protected] Intercept UIScene device log and print a guided warning (flutter/flutter#181515)
2026-02-09 [email protected] Introduce ScrollCacheExtent and also fixes unbound shrinkwrap cache ex… (flutter/flutter#181092)
2026-02-09 [email protected] [Android] Add mechanism for setting Android engine flags via Android manifest (take 2) (flutter/flutter#181632)
2026-02-09 [email protected] Fix wrong comment about default impeller value (flutter/flutter#181831)
2026-02-09 [email protected] fix build fail for wayland only platform (flutter/flutter#182057)
2026-02-09 [email protected] [AGP 9] Added Warning Against Updating to AGP 9 (flutter/flutter#181977)
2026-02-09 [email protected] Updated Shaderc dep (flutter/flutter#180976)
2026-02-09 [email protected] Refactor accessibility guidelines out to widget layer (flutter/flutter#181672)
2026-02-09 [email protected] Roll Skia from 68dff53238e5 to d4b7e24a209b (2 revisions) (flutter/flutter#182087)
2026-02-09 [email protected] fix: OutlineInputBorder not respecting BorderSide stroke alignment (flutter/flutter#180487)
2026-02-09 [email protected] Adds opengles to engine dart tests (flutter/flutter#181933)
2026-02-09 [email protected] Add command to build a Swift Package for Add to App and generate FlutterPluginRegistrant (flutter/flutter#181224)
2026-02-09 [email protected] Remove unused constant in `bundle.dart` (flutter/flutter#182023)
2026-02-09 [email protected] Roll Fuchsia Linux SDK from iqtwdXlgKIyZkL5Li... to 7BGf7mPQvgLi7Axb6... (flutter/flutter#182082)
2026-02-09 [email protected] Remove unused getters in `user_messages.dart` (flutter/flutter#181867)
2026-02-09 [email protected] Roll Packages from 7805d3e to 3d5eaa5 (3 revisions) (flutter/flutter#182083)
2026-02-09 [email protected] Roll Skia from 5d891cd7fb7f to 68dff53238e5 (1 revision) (flutter/flutter#182080)
2026-02-09 [email protected] Update example description (flutter/flutter#182067)
2026-02-09 [email protected] Roll Dart SDK from 965b51c219d3 to eee0e2e11174 (1 revision) (flutter/flutter#182073)
2026-02-09 [email protected] Roll Skia from 9533d7533d59 to 5d891cd7fb7f (6 revisions) (flutter/flutter#182070)
2026-02-09 [email protected] Add a new flutter cli command, running-apps, using mDNS app discovery (flutter/flutter#180098)
2026-02-09 [email protected] Roll Skia from b7db9f35f0f2 to 9533d7533d59 (2 revisions) (flutter/flutter#182069)
2026-02-08 [email protected] Improve FlWindowMonitor API (flutter/flutter#181885)

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 [email protected],[email protected] 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

...
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
…manifest (take 2) (flutter#181632)

A continuation of flutter#177127.
Copying from there:

# Overview

> [!NOTE]  
> This PR is based on conversation & feedback on
go/flutter-android-harden-engine-shell-arguments.

Adds a mechanism for setting Android engine flags via the manifest. If a
flag is specified on the command line and in manifest metadata, the
value specified on the command line will take precedence. Documentation
is added on this mechanism

Additionally, this PR removes the exposure of`--cache-sksl` command line
flag as per
[https://github.com/flutter/flutter/issues/140310#issuecomment-2708459007](https://www.google.com/url?q=https://github.com/flutter/flutter/issues/140310%23issuecomment-2708459007&sa=D&source=docs&ust=1761156167162464&usg=AOvVaw3a8ubXTtv3apknY2-P9dKe).

Additionally, this PR adds documentation for the only two supported ways
of setting engine flags moving forward -- via the command line or
manifest. The `Intent` mechanism will be removed when
flutter#180686 is completed (intended
to be a follow up to this PR).

As the unit tests in this PR only cover setting flags via manifest in
debug mode, I will follow up this PR with an integration test to test
that flags are appropriately respected/ignored in release mode. See
flutter#178383 for my currently working
but WIP draft.

Part of flutter#172553.

# Follow up work:

## Add integration test for this new added mechanism
This will land as an immediate follow-up to this PR. WIP in
flutter#178383.

## Remove support for setting shell arguments via `Intent`
This task will be a follow up to this work + the integration test
landing, and will complete work for
flutter#172553. See
flutter#180686 for details.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- 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
@camsim99 camsim99 added the revert Autorevert PR (with "Reason for revert:" comment) label Feb 13, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 13, 2026

Time to revert pull request flutter/flutter/181632 has elapsed.
You need to open the revert manually and process as a regular pull request.

@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Feb 13, 2026
camsim99 added a commit to camsim99/flutter that referenced this pull request Feb 13, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 17, 2026
#182388)

Reverts #181632 due to internal
performance regressions of startup time in the order of 100ms.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- 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
camsim99 added a commit to camsim99/flutter that referenced this pull request Feb 18, 2026
…manifest (take 2) (flutter#181632)

A continuation of flutter#177127.
Copying from there:

# Overview

> [!NOTE]  
> This PR is based on conversation & feedback on
go/flutter-android-harden-engine-shell-arguments.

Adds a mechanism for setting Android engine flags via the manifest. If a
flag is specified on the command line and in manifest metadata, the
value specified on the command line will take precedence. Documentation
is added on this mechanism

Additionally, this PR removes the exposure of`--cache-sksl` command line
flag as per
[https://github.com/flutter/flutter/issues/140310#issuecomment-2708459007](https://www.google.com/url?q=https://github.com/flutter/flutter/issues/140310%23issuecomment-2708459007&sa=D&source=docs&ust=1761156167162464&usg=AOvVaw3a8ubXTtv3apknY2-P9dKe).

Additionally, this PR adds documentation for the only two supported ways
of setting engine flags moving forward -- via the command line or
manifest. The `Intent` mechanism will be removed when
flutter#180686 is completed (intended
to be a follow up to this PR).

As the unit tests in this PR only cover setting flags via manifest in
debug mode, I will follow up this PR with an integration test to test
that flags are appropriately respected/ignored in release mode. See
flutter#178383 for my currently working
but WIP draft.

Part of flutter#172553.

# Follow up work:

## Add integration test for this new added mechanism
This will land as an immediate follow-up to this PR. WIP in
flutter#178383.

## Remove support for setting shell arguments via `Intent`
This task will be a follow up to this work + the integration test
landing, and will complete work for
flutter#172553. See
flutter#180686 for details.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- 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
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
…manifest (take 2) (flutter#181632)

A continuation of flutter#177127.
Copying from there:

# Overview

> [!NOTE]  
> This PR is based on conversation & feedback on
go/flutter-android-harden-engine-shell-arguments.

Adds a mechanism for setting Android engine flags via the manifest. If a
flag is specified on the command line and in manifest metadata, the
value specified on the command line will take precedence. Documentation
is added on this mechanism

Additionally, this PR removes the exposure of`--cache-sksl` command line
flag as per
[https://github.com/flutter/flutter/issues/140310#issuecomment-2708459007](https://www.google.com/url?q=https://github.com/flutter/flutter/issues/140310%23issuecomment-2708459007&sa=D&source=docs&ust=1761156167162464&usg=AOvVaw3a8ubXTtv3apknY2-P9dKe).

Additionally, this PR adds documentation for the only two supported ways
of setting engine flags moving forward -- via the command line or
manifest. The `Intent` mechanism will be removed when
flutter#180686 is completed (intended
to be a follow up to this PR).

As the unit tests in this PR only cover setting flags via manifest in
debug mode, I will follow up this PR with an integration test to test
that flags are appropriately respected/ignored in release mode. See
flutter#178383 for my currently working
but WIP draft.

Part of flutter#172553.

# Follow up work:

## Add integration test for this new added mechanism
This will land as an immediate follow-up to this PR. WIP in
flutter#178383.

## Remove support for setting shell arguments via `Intent`
This task will be a follow up to this work + the integration test
landing, and will complete work for
flutter#172553. See
flutter#180686 for details.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- 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
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
flutter#182388)

Reverts flutter#181632 due to internal
performance regressions of startup time in the order of 100ms.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- 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
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Feb 27, 2026
flutter#182388)

Reverts flutter#181632 due to internal
performance regressions of startup time in the order of 100ms.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- 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

d: docs/ flutter/flutter/docs, for contributors d: examples Sample code and demos engine flutter/engine related. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team team-engine Owned by Engine team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants