diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index a6daff8fbbdf..8e52b23bd657 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.6.9 + +* Corrects assumption about automatic preview correction happening on API >= 29 to API > 29, + based on the fact that the `ImageReader` Impeller backend is not used for the most part on + devices running API 29+. + ## 0.6.8+3 * Removes dependency on org.jetbrains.kotlin:kotlin-bom. diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java index cd048238ca9c..138e9259e025 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java @@ -106,16 +106,16 @@ public String getTempFilePath(@NonNull String prefix, @NonNull String suffix) { } /** - * Returns whether or not a {@code SurfaceTexture} backs the {@code Surface} provided to CameraX - * to build the camera preview. If it is backed by a {@code Surface}, then the transformation - * needed to correctly rotate the preview has already been applied. + * Returns whether or not Impeller uses an {@code ImageReader} backend to provide a {@code + * Surface} to CameraX to build the preview. If it is backed by an {@code ImageReader}, then + * CameraX will not automatically apply the transformation needed to correct the preview. * - *

This is determined by the engine, who uses {@code SurfaceTexture}s on Android SDKs 29 and - * below. + *

This is determined by the engine, which approximately uses {@code SurfaceTexture}s on + * Android SDKs below 29. */ @Override @NonNull public Boolean isPreviewPreTransformed() { - return Build.VERSION.SDK_INT <= 29; + return Build.VERSION.SDK_INT < 29; } } diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java index 252d3a0a776e..52d02e67f653 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java @@ -146,16 +146,16 @@ public void isPreviewPreTransformed_returnsTrueWhenRunningBelowSdk29() { } @Test - @Config(sdk = 29) - public void isPreviewPreTransformed_returnsTrueWhenRunningSdk29() { + @Config(sdk = 28) + public void isPreviewPreTransformed_returnsTrueWhenRunningSdk28() { final SystemServicesHostApiImpl systemServicesHostApi = new SystemServicesHostApiImpl(mockBinaryMessenger, mockInstanceManager, mockContext); assertTrue(systemServicesHostApi.isPreviewPreTransformed()); } @Test - @Config(sdk = 30) - public void isPreviewPreTransformed_returnsFalseWhenRunningAboveSdk29() { + @Config(sdk = 29) + public void isPreviewPreTransformed_returnsFalseWhenRunningAboveSdk28() { final SystemServicesHostApiImpl systemServicesHostApi = new SystemServicesHostApiImpl(mockBinaryMessenger, mockInstanceManager, mockContext); assertFalse(systemServicesHostApi.isPreviewPreTransformed()); diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 9a845bfc1810..663a5893bf15 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.6.8+3 +version: 0.6.9 environment: sdk: ^3.5.0