Camille Simon 77b8e5dea7
[CP][Android] Add a way to request new Surfaces from SurfaceProducer … (#172384)
Cherry-picks c7362b4755 to 3.32 stable **without** the changes to the pre-existing `SurfaceProducer.getSurface` method, only the addition of `SurfaceProducer.getForcedNewSurface`.

Note that this change is already present in the 3.35 beta.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?
https://github.com/flutter/flutter/issues/155294, https://github.com/flutter/flutter/issues/169506

### Changelog Description:
Adds a new method for requesting a new surface from the embedder than any previously returned.

### Impact Description:
Developers using `SurfaceProducer.getForcedNewSurface` will receive a `Surface` that is different than previous calls to `SurfaceProducer.getForcedNewSurface` or pre-existing method  `SurfaceProducer.getSurface`.

In other words, there is no impact to current users. This is a new method, so there will be a gap between 3.32.0 and 3.32.8, but I think it's worth landing because this would unblock fixing resuming/pausing the camera preview as described by the linked issues.

### Workaround:

Working around the need for the new `getForcedSurface` method (like the `camera` issues linked above require) can be done by creating new `SurfaceProducer`s; however, this might have other side-effect unbeknownst to me.

### Risk:

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:

You can test with https://github.com/flutter/packages/pull/9360 (which I accidentally landed because I forgot this wasn't in stable yet...oops).
2025-07-22 20:48:20 +00:00
..
.gn

OpenSSF Scorecard

buildroot

Build environment for the Flutter engine

This repository is used by the flutter/engine repository. For instructions on how to use it, see that repository's CONTRIBUTING.md file.

To update your checkout to use the latest buildroot, run gclient sync.

To submit patches to this buildroot repository, create a branch, push to that branch, then submit a PR on GitHub for that branch.

To point the engine to a new version of buildroot after your patch is merged, update the buildroot hash in the engine's DEPS file.