From a41dd6dd4c35a70b0ce77b62f3ba96b4907047fe Mon Sep 17 00:00:00 2001 From: "Bodhi Mulders (BeMacized)" Date: Sun, 27 Dec 2020 14:02:50 +0100 Subject: [PATCH 1/3] Fixed video recording --- .../src/main/java/io/flutter/plugins/camera/Camera.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java b/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java index 0116ce3c0e4d..3c28d6655e48 100644 --- a/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java +++ b/packages/camera/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java @@ -276,7 +276,9 @@ public void onCaptureFailed( @NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure) { - assert (pictureCaptureRequest != null); + if (pictureCaptureRequest == null || pictureCaptureRequest.isFinished()) { + return; + } String reason; switch (failure.getReason()) { case CaptureFailure.REASON_ERROR: From b260102aaeef8a02347d8f73c7bc3f20a32a759e Mon Sep 17 00:00:00 2001 From: "Bodhi Mulders (BeMacized)" Date: Sun, 27 Dec 2020 14:07:13 +0100 Subject: [PATCH 2/3] Update changelog and pubspec version --- packages/camera/camera/CHANGELOG.md | 4 ++++ packages/camera/camera/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 225601054fb9..13427eba8a2a 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.3+2 + +* Fixes stopping video recordings not working on Android before a picture has been taken. + ## 0.6.3+1 * Fixes flash & torch modes not working on some Android devices. diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 43a5fca3da21..1f5d06eecbe3 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -2,7 +2,7 @@ name: camera description: A Flutter plugin for getting information about and controlling the camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video, and streaming image buffers to dart. -version: 0.6.3+1 +version: 0.6.3+2 homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera dependencies: From 34775c2bc4a81f9f0c0706b3143152087a4eae2a Mon Sep 17 00:00:00 2001 From: Bodhi Mulders Date: Sun, 27 Dec 2020 14:27:47 +0100 Subject: [PATCH 3/3] Update packages/camera/camera/CHANGELOG.md Co-authored-by: Maurits van Beusekom --- packages/camera/camera/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 13427eba8a2a..461b2d927eda 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.6.3+2 -* Fixes stopping video recordings not working on Android before a picture has been taken. +* Fixes crash on Android which occurs after video recording has stopped just before taking a picture. ## 0.6.3+1