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

Flutter Engine

Setting up the Engine development environment

See here

gclient bootstrap

Flutter engine uses gclient to manage dependencies.

If you've already cloned the flutter repository:

  1. Copy one of the engine/scripts/*.gclient to the root folder as .gclient:
    1. Googlers: copy rbe.gclient to enable faster builds with RBE
    2. Everyone else: copy standard.gclient
  2. run gclient sync from the root folder