Skip to content

Commit 0e189f7

Browse files
[camera_android_camerax][video_player_android] Suppresses deprecation of the SurfaceProducer.Callback.onSurfaceDestroyed method (flutter#8388)
See flutter/flutter#161256 This was causing errors with the Flutter->Packages roller: ``` > Task :camera_android_camerax:compileDebugJavaWithJavac /b/s/w/ir/x/w/packages/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java:92: warning: [removal] onSurfaceDestroyed() in Callback has been deprecated and marked for removal public void onSurfaceDestroyed() { ^ error: warnings found and -Werror specified 1 error 1 warning ```
1 parent 8ca81bd commit 0e189f7

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

packages/camera/camera_android_camerax/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## NEXT
2+
3+
* Suppresses deprecation and removal warnings for
4+
`TextureRegistry.SurfaceProducer.onSurfaceDestroyed`.
5+
16
## 0.6.11
27

38
* Replaces deprecated Android embedder APIs (`onSurfaceCreated` -> `onSurfaceAvailable`).

packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ public void onSurfaceAvailable() {
8989
}
9090

9191
@Override
92+
// TODO(bparrishMines): Replace with onSurfaceCleanup once available on stable. See
93+
// https://github.com/flutter/flutter/issues/161256.
94+
@SuppressWarnings({"deprecation", "removal"})
9295
public void onSurfaceDestroyed() {
9396
// Invalidate the SurfaceRequest so that CameraX knows to to make a new request
9497
// for a surface.

packages/video_player/video_player_android/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## NEXT
2+
3+
* Suppresses deprecation and removal warnings for
4+
`TextureRegistry.SurfaceProducer.onSurfaceDestroyed`.
5+
16
## 2.7.17
27

38
* Replaces deprecated Android embedder APIs (`onSurfaceCreated` -> `onSurfaceAvailable`).

packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public void onSurfaceAvailable() {
9494
}
9595

9696
@RestrictTo(RestrictTo.Scope.LIBRARY)
97+
// TODO(bparrishMines): Replace with onSurfaceCleanup once available on stable. See
98+
// https://github.com/flutter/flutter/issues/161256.
99+
@SuppressWarnings({"deprecation", "removal"})
97100
public void onSurfaceDestroyed() {
98101
// Intentionally do not call pause/stop here, because the surface has already been released
99102
// at this point (see https://github.com/flutter/flutter/issues/156451).

0 commit comments

Comments
 (0)