
Follow-up to https://github.com/flutter/flutter/pull/160937
(https://github.com/flutter/flutter/issues/160933).
This more or less mirrors what we did already for `onSurfaceCreated` to
match `onSurfaceAvailable`.
With this approach, the master branch should immediately start seeing
better behavior in terms of being able to use the `onSurfaceDestroyed`
callback effectively (before the surface has been released). For
example, for a plugin that already uses `onSurfaceDestroyed`, [i.e
`camerax`](97ce56a68e/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java
):
```java
@Override
public void onSurfaceDestroyed() {
// Invalidate the SurfaceRequest so that CameraX knows to to make a new request
// for a surface.
request.invalidate();
}
```
... the request is now invalidated _before_ the surface has been
destroyed, which is what (I believe) we wanted?
---
Folks that want to publish package updates that _definitely_ use the
correct timing will have to wait for the next stable.
/cc @hasali19 would be great to get your input here.
Flutter Engine
gclient
bootstrap
Flutter engine uses gclient
to manage dependencies.
If you've already cloned the flutter repository: