Skip to content

Conversation

@gmackall
Copy link
Member

@gmackall gmackall commented Jun 12, 2025

Should introduce no behavior changes. Refactors the android platform view code so that

  1. The delegator is ready to delegate between PlatformViewsController (PVC) 1 and 2, and implements a PlatformViewsChannel.PlatformViewsHandler.
  2. The PlatformViewCreationRequest and PlatformViewTouch are fully shared between the two platform view modes
  3. Introduces new factory constructors for the different types of PlatformViewCreationRequests, corresponding to the modes.

Making the flag work on existing widgets will be done in a follow up PR here

.

Pre-launch Checklist

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

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. labels Jun 12, 2025
@gmackall gmackall changed the title Simplify unified pv api Use HCPP if it is available for all android PV paths Jun 12, 2025
@gmackall gmackall changed the title Use HCPP if it is available for all android PV paths Use HCPP if it is available/enabled for all android PV paths Jun 12, 2025
}
dependencies {
classpath "com.android.tools.build:gradle:8.9.1"
classpath "com.android.tools.build:gradle:8.7.1"
Copy link
Member Author

@gmackall gmackall Jun 13, 2025

Choose a reason for hiding this comment

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

Unrelated, but my AS doesn't support AGP 8.9.1 so I'd prefer to lower this (given that it is only used for our IDE support for our convenience while editing the engine). I currently modify it on every local branch and just don't commit, but that's sort of annoying.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am ok with you modifying this but please add a comment above for how our team should decide what version of AGP should go here and when to update it. Without documentation anyone is likely to bump it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment is fine, that said my intent was for the comment to tell the flutter-android team when to update.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think at the end of the day the answer is just going to be "whenever we as a group want to". I think it's not urgent to update this really, we should just avoid it being super old

@github-actions github-actions bot added the team-android Owned by Android platform team label Jul 8, 2025
@gmackall

This comment was marked as off-topic.

@gmackall gmackall requested a review from reidbaker July 25, 2025 16:48
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for adding this readme

}
dependencies {
classpath "com.android.tools.build:gradle:8.9.1"
classpath "com.android.tools.build:gradle:8.7.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment is fine, that said my intent was for the comment to tell the flutter-android team when to update.

@gmackall
Copy link
Member Author

/gemini review

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 is a great step forward in refactoring the Android platform view code. The introduction of the PlatformViewsControllerDelegator and the extraction of shared data classes like PlatformViewCreationRequest and PlatformViewTouch significantly improve the code's structure and maintainability. The changes are logical and well-implemented.

My feedback focuses on improving documentation and API clarity to ensure the new components are easy to understand and use correctly. I've pointed out a few places where Javadoc is missing for new public methods and suggested a clarification for a potentially nullable parameter. I also found a broken link in a new README file.

Overall, this is a solid refactoring. Addressing these minor points will make it even better.

@@ -0,0 +1,2 @@
Everything under this file path will have hcpp enabled, see the configuration here:
https://github.com/flutter/flutter/blob/337a007f5cfb66d0ecc84b1545539231a0be4d61/dev/bots/suite_runners/run_android_engine_tests.dart#L34 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The link to the configuration file uses a specific commit hash and an incorrect line number. This is fragile and will become outdated. To improve maintainability, please:

  1. Use the main branch in the URL instead of a commit hash.
  2. Update the line number to point to the correct code block that enables HCPP tests (around line 117).
Suggested change
https://github.com/flutter/flutter/blob/337a007f5cfb66d0ecc84b1545539231a0be4d61/dev/bots/suite_runners/run_android_engine_tests.dart#L34
https://github.com/flutter/flutter/blob/main/dev/bots/suite_runners/run_android_engine_tests.dart#L117-L125

Copy link
Contributor

Choose a reason for hiding this comment

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

NO, Commit hash's are required for stable links to line numbers and the relevant link is the method not the part of the method associated with hcpp.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah I did not adopt this one for that reason haha

double logicalWidth,
double logicalHeight,
int direction,
RequestedDisplayMode displayMode,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The displayMode parameter in this constructor is not annotated with @Nullable, but it is being passed null from the createHCPPRequest factory method. This could be misleading and potentially lead to an NPE if not handled carefully.

Please add the @Nullable annotation to the displayMode parameter for clarity and to align with its usage.

Suggested change
RequestedDisplayMode displayMode,
@Nullable RequestedDisplayMode displayMode,

Comment on lines 314 to 316
public boolean isHcppEnabled();

void createPlatformViewHcpp(@NonNull PlatformViewCreationRequest request);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new public methods isHcppEnabled and createPlatformViewHcpp in the PlatformViewsHandler interface are missing Javadoc comments. According to the style guide, all public members should be documented.1

Please add Javadoc to explain what these methods do.

    /** Returns true if Hybrid Composition Platform Views++ is enabled. */
    public boolean isHcppEnabled();

    /**
     * The Flutter application would like to display a new Android {@code View} using Hybrid
     * Composition++.
     *
     * @param request The creation request with the parameters for the platform view.
     */
    void createPlatformViewHcpp(@NonNull PlatformViewCreationRequest request);

Style Guide References

Footnotes

  1. All public members should have documentation. (link)

Comment on lines +518 to +520
public PlatformViewsChannel getPlatformViewsChannel() {
return platformViewsChannel;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new public method getPlatformViewsChannel is missing a Javadoc comment. According to the style guide, all public members should be documented.1

  /**
   * Returns the platform views channel.
   *
   * <p>This is intended for the {@code PlatformViewsControllerDelegator} to use.
   */
  public PlatformViewsChannel getPlatformViewsChannel() {
    return platformViewsChannel;
  }

Style Guide References

Footnotes

  1. All public members should have documentation. (link)

Comment on lines +617 to +622
public boolean isHcppEnabled() {
if (flutterJNI == null) {
return false;
}
return flutterJNI.IsSurfaceControlEnabled();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new public method isHcppEnabled is missing a Javadoc comment. According to the style guide, all public members should be documented.1

Style Guide References

Suggested change
public boolean isHcppEnabled() {
if (flutterJNI == null) {
return false;
}
return flutterJNI.IsSurfaceControlEnabled();
}
/** Returns true if Hybrid Composition Platform Views++ is enabled. */
public boolean isHcppEnabled() {
if (flutterJNI == null) {
return false;
}
return flutterJNI.IsSurfaceControlEnabled();
}

Footnotes

  1. All public members should have documentation. (link)

Comment on lines +143 to +150
public void attach(
@Nullable Context context,
@NonNull TextureRegistry textureRegistry,
@NonNull DartExecutor dartExecutor) {
platformViewsController.attach(context, textureRegistry, dartExecutor);
platformViewsController2.attach(context, dartExecutor);
platformViewsController.getPlatformViewsChannel().setPlatformViewsHandler(this);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new public method attach is missing a Javadoc comment. According to the style guide, all public members should be documented.1

  /**
   * Attaches this platform views controller to its input and output channels.
   *
   * @param context The base context that will be passed to embedded views created by this
   *     controller. This should be the context of the Activity hosting the Flutter application.
   * @param textureRegistry The texture registry which provides the output textures into which the
   *     embedded views will be rendered.
   * @param dartExecutor The dart execution context, which is used to set up a system channel.
   */
  public void attach(
      @Nullable Context context,
      @NonNull TextureRegistry textureRegistry,
      @NonNull DartExecutor dartExecutor) {
    platformViewsController.attach(context, textureRegistry, dartExecutor);
    platformViewsController2.attach(context, dartExecutor);
    platformViewsController.getPlatformViewsChannel().setPlatformViewsHandler(this);
  }

Style Guide References

Footnotes

  1. All public members should have documentation. (link)

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
}
}

/** Returns the platform views channel. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

Don't let ai encourage us to writing pointless documentation.

@gmackall gmackall removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jul 29, 2025
Merged via the queue into flutter:master with commit 5f9b9ab Jul 29, 2025
174 of 175 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 30, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 30, 2025
flutter/flutter@46b097a...c3279ca

2025-07-30 [email protected] Roll Skia from 00765f238077 to da5a6704f8a3 (1 revision) (flutter/flutter#172966)
2025-07-30 [email protected] Roll Skia from 62476cd444d2 to 00765f238077 (3 revisions) (flutter/flutter#172955)
2025-07-30 [email protected] Roll Skia from 34693354289f to 62476cd444d2 (1 revision) (flutter/flutter#172950)
2025-07-30 [email protected] Roll Skia from f72bd01a49b1 to 34693354289f (1 revision) (flutter/flutter#172946)
2025-07-30 [email protected] [a11y] add RangeSlider to a11y test app as additional use-case (flutter/flutter#172922)
2025-07-30 [email protected] Roll Skia from a42898e5d622 to f72bd01a49b1 (21 revisions) (flutter/flutter#172944)
2025-07-29 [email protected] Fix SegmentedButton border doesn't reflect states (flutter/flutter#172754)
2025-07-29 [email protected] Fix documentation for FlutterEngineRunTask (flutter/flutter#172889)
2025-07-29 [email protected] Roll Fuchsia Linux SDK from tK_PAaLeo0pUxi8hv... to bQVQlLssTxxLjoDU0... (flutter/flutter#172925)
2025-07-29 [email protected] fix(scrollbar): Update padding type to EdgeInsetsGeometry (flutter/flutter#172056)
2025-07-29 [email protected] Refactor Android platform view code in advance of enabling HCPP on existing PV widgets (behind a flag) (flutter/flutter#170553)
2025-07-29 [email protected] Roll Packages from 6b2e34e to ed235d1 (4 revisions) (flutter/flutter#172905)
2025-07-29 [email protected] Add package PR triage note (flutter/flutter#172898)
2025-07-29 [email protected] Roll Skia from 409e1c7ba09b to a42898e5d622 (29 revisions) (flutter/flutter#172906)
2025-07-29 [email protected] Made `android_gradle_print_build_variants_test.dart` more robust (flutter/flutter#172910)
2025-07-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland licenses cpp switch (#172671)" (flutter/flutter#172912)
2025-07-29 [email protected] Fix Gemini Code Assist for GitHub config yaml (flutter/flutter#172887)
2025-07-29 [email protected] Marks Linux_android_emu_unstable android_defines_test to be unflaky (flutter/flutter#171856)

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

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…r#9699)

flutter/flutter@46b097a...c3279ca

2025-07-30 [email protected] Roll Skia from 00765f238077 to da5a6704f8a3 (1 revision) (flutter/flutter#172966)
2025-07-30 [email protected] Roll Skia from 62476cd444d2 to 00765f238077 (3 revisions) (flutter/flutter#172955)
2025-07-30 [email protected] Roll Skia from 34693354289f to 62476cd444d2 (1 revision) (flutter/flutter#172950)
2025-07-30 [email protected] Roll Skia from f72bd01a49b1 to 34693354289f (1 revision) (flutter/flutter#172946)
2025-07-30 [email protected] [a11y] add RangeSlider to a11y test app as additional use-case (flutter/flutter#172922)
2025-07-30 [email protected] Roll Skia from a42898e5d622 to f72bd01a49b1 (21 revisions) (flutter/flutter#172944)
2025-07-29 [email protected] Fix SegmentedButton border doesn't reflect states (flutter/flutter#172754)
2025-07-29 [email protected] Fix documentation for FlutterEngineRunTask (flutter/flutter#172889)
2025-07-29 [email protected] Roll Fuchsia Linux SDK from tK_PAaLeo0pUxi8hv... to bQVQlLssTxxLjoDU0... (flutter/flutter#172925)
2025-07-29 [email protected] fix(scrollbar): Update padding type to EdgeInsetsGeometry (flutter/flutter#172056)
2025-07-29 [email protected] Refactor Android platform view code in advance of enabling HCPP on existing PV widgets (behind a flag) (flutter/flutter#170553)
2025-07-29 [email protected] Roll Packages from 6b2e34e to ed235d1 (4 revisions) (flutter/flutter#172905)
2025-07-29 [email protected] Add package PR triage note (flutter/flutter#172898)
2025-07-29 [email protected] Roll Skia from 409e1c7ba09b to a42898e5d622 (29 revisions) (flutter/flutter#172906)
2025-07-29 [email protected] Made `android_gradle_print_build_variants_test.dart` more robust (flutter/flutter#172910)
2025-07-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland licenses cpp switch (#172671)" (flutter/flutter#172912)
2025-07-29 [email protected] Fix Gemini Code Assist for GitHub config yaml (flutter/flutter#172887)
2025-07-29 [email protected] Marks Linux_android_emu_unstable android_defines_test to be unflaky (flutter/flutter#171856)

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

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…isting PV widgets (behind a flag) (flutter#170553)

Should introduce no behavior changes. Refactors the android platform
view code so that
1. The delegator is ready to delegate between PlatformViewsController
(PVC) 1 and 2, and implements a
`PlatformViewsChannel.PlatformViewsHandler`.
2. The `PlatformViewCreationRequest` and `PlatformViewTouch` are fully
shared between the two platform view modes
3. Introduces new factory constructors for the different types of
`PlatformViewCreationRequest`s, corresponding to the modes.

Making the flag work on existing widgets will be done in a follow up PR
here
https://github.com/flutter/flutter/blob/67262d924051ee03dd4539926752c1170da4271f/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java#L95.


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

---------

Co-authored-by: Gray Mackall <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…isting PV widgets (behind a flag) (flutter#170553)

Should introduce no behavior changes. Refactors the android platform
view code so that
1. The delegator is ready to delegate between PlatformViewsController
(PVC) 1 and 2, and implements a
`PlatformViewsChannel.PlatformViewsHandler`.
2. The `PlatformViewCreationRequest` and `PlatformViewTouch` are fully
shared between the two platform view modes
3. Introduces new factory constructors for the different types of
`PlatformViewCreationRequest`s, corresponding to the modes.

Making the flag work on existing widgets will be done in a follow up PR
here
https://github.com/flutter/flutter/blob/67262d924051ee03dd4539926752c1170da4271f/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java#L95.


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

---------

Co-authored-by: Gray Mackall <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…isting PV widgets (behind a flag) (flutter#170553)

Should introduce no behavior changes. Refactors the android platform
view code so that
1. The delegator is ready to delegate between PlatformViewsController
(PVC) 1 and 2, and implements a
`PlatformViewsChannel.PlatformViewsHandler`.
2. The `PlatformViewCreationRequest` and `PlatformViewTouch` are fully
shared between the two platform view modes
3. Introduces new factory constructors for the different types of
`PlatformViewCreationRequest`s, corresponding to the modes.

Making the flag work on existing widgets will be done in a follow up PR
here
https://github.com/flutter/flutter/blob/67262d924051ee03dd4539926752c1170da4271f/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java#L95.


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

---------

Co-authored-by: Gray Mackall <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…isting PV widgets (behind a flag) (flutter#170553)

Should introduce no behavior changes. Refactors the android platform
view code so that
1. The delegator is ready to delegate between PlatformViewsController
(PVC) 1 and 2, and implements a
`PlatformViewsChannel.PlatformViewsHandler`.
2. The `PlatformViewCreationRequest` and `PlatformViewTouch` are fully
shared between the two platform view modes
3. Introduces new factory constructors for the different types of
`PlatformViewCreationRequest`s, corresponding to the modes.

Making the flag work on existing widgets will be done in a follow up PR
here
https://github.com/flutter/flutter/blob/67262d924051ee03dd4539926752c1170da4271f/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java#L95.


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

---------

Co-authored-by: Gray Mackall <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants