You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change timing of onSurfaceDestroyed to match onSurfaceCleanup (#161252)
Follow-up to flutter/flutter#160937
(flutter/flutter#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`](https://github.com/flutter/packages/blob/97ce56a68eea650dc784617b4eed7814cccedeb8/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.
Copy file name to clipboardExpand all lines: engine/src/flutter/shell/platform/android/test/io/flutter/embedding/engine/renderer/FlutterRendererTest.java
+18-2Lines changed: 18 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -767,7 +767,7 @@ public void ImageReaderSurfaceProducerDoesNotCropOrRotate() {
0 commit comments