diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 916559909fd..10ead4c95da 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -49,6 +49,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@a09933a12a80f87b87005513f0abb1494c27a716 # v1.0.26
+ uses: github/codeql-action/upload-sarif@5b6282e01c62d02e720b81eb8a51204f527c3624 # v1.0.26
with:
sarif_file: results.sarif
diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md
index de7c4d96618..90bc65507cc 100644
--- a/packages/camera/camera_android_camerax/CHANGELOG.md
+++ b/packages/camera/camera_android_camerax/CHANGELOG.md
@@ -1,6 +1,6 @@
## 0.5.0+14
-* Wraps classes needed to implement resolution configuration for video recording.
+* Explicitly removes `READ_EXTERNAL_STORAGE` permission that may otherwise be implied from `WRITE_EXTERNAL_STORAGE`.
## 0.5.0+13
diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraAndroidCameraxPlugin.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraAndroidCameraxPlugin.java
index d2a9c277a37..dbae2a46805 100644
--- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraAndroidCameraxPlugin.java
+++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraAndroidCameraxPlugin.java
@@ -103,10 +103,6 @@ public void setUp(
binaryMessenger, new ResolutionStrategyHostApiImpl(instanceManager));
GeneratedCameraXLibrary.AspectRatioStrategyHostApi.setup(
binaryMessenger, new AspectRatioStrategyHostApiImpl(instanceManager));
- GeneratedCameraXLibrary.FallbackStrategyHostApi.setup(
- binaryMessenger, new FallbackStrategyHostApiImpl(instanceManager));
- GeneratedCameraXLibrary.QualitySelectorHostApi.setup(
- binaryMessenger, new QualitySelectorHostApiImpl(instanceManager));
}
@Override
diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FallbackStrategyHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FallbackStrategyHostApiImpl.java
deleted file mode 100644
index 0309d5476a0..00000000000
--- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FallbackStrategyHostApiImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2013 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package io.flutter.plugins.camerax;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.VisibleForTesting;
-import androidx.camera.video.FallbackStrategy;
-import androidx.camera.video.Quality;
-import io.flutter.plugins.camerax.GeneratedCameraXLibrary.FallbackStrategyHostApi;
-import io.flutter.plugins.camerax.GeneratedCameraXLibrary.VideoQualityConstraint;
-import io.flutter.plugins.camerax.GeneratedCameraXLibrary.VideoResolutionFallbackRule;
-
-/**
- * Host API implementation for {@link FallbackStrategy}.
- *
- *
This class may handle instantiating and adding native object instances that are attached to a
- * Dart instance or handle method calls on the associated native class or an instance of the class.
- */
-public class FallbackStrategyHostApiImpl implements FallbackStrategyHostApi {
- private final InstanceManager instanceManager;
-
- private final FallbackStrategyProxy proxy;
-
- /** Proxy for constructors and static method of {@link FallbackStrategy}. */
- @VisibleForTesting
- public static class FallbackStrategyProxy {
- /** Creates an instance of {@link FallbackStrategy}. */
- public @NonNull FallbackStrategy create(
- @NonNull VideoQualityConstraint videoQualityConstraint,
- @NonNull VideoResolutionFallbackRule fallbackRule) {
- Quality videoQuality =
- QualitySelectorHostApiImpl.getQualityFromVideoQualityConstraint(videoQualityConstraint);
-
- switch (fallbackRule) {
- case HIGHER_QUALITY_OR_LOWER_THAN:
- return FallbackStrategy.higherQualityOrLowerThan(videoQuality);
- case HIGHER_QUALITY_THAN:
- return FallbackStrategy.higherQualityThan(videoQuality);
- case LOWER_QUALITY_OR_HIGHER_THAN:
- return FallbackStrategy.lowerQualityOrHigherThan(videoQuality);
- case LOWER_QUALITY_THAN:
- return FallbackStrategy.lowerQualityThan(videoQuality);
- }
- throw new IllegalArgumentException(
- "Specified fallback rule " + fallbackRule + " unrecognized.");
- }
- }
-
- /**
- * Constructs a {@link FallbackStrategyHostApiImpl}.
- *
- * @param instanceManager maintains instances stored to communicate with attached Dart objects
- */
- public FallbackStrategyHostApiImpl(@NonNull InstanceManager instanceManager) {
- this(instanceManager, new FallbackStrategyProxy());
- }
-
- /**
- * Constructs a {@link FallbackStrategyHostApiImpl}.
- *
- * @param instanceManager maintains instances stored to communicate with attached Dart objects
- * @param proxy proxy for constructors and static method of {@link FallbackStrategy}
- */
- FallbackStrategyHostApiImpl(
- @NonNull InstanceManager instanceManager, @NonNull FallbackStrategyProxy proxy) {
- this.instanceManager = instanceManager;
- this.proxy = proxy;
- }
-
- /**
- * Creates a {@link FallbackStrategy} instance with the video quality and fallback rule specified.
- */
- @Override
- public void create(
- @NonNull Long identifier,
- @NonNull VideoQualityConstraint videoQualityConstraint,
- @NonNull VideoResolutionFallbackRule fallbackRule) {
- instanceManager.addDartCreatedInstance(
- proxy.create(videoQualityConstraint, fallbackRule), identifier);
- }
-}
diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java
index d7d378d158b..680ecb80525 100644
--- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java
+++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java
@@ -104,43 +104,6 @@ private LiveDataSupportedType(final int index) {
}
}
- /**
- * Video quality constraints that will be used by a QualitySelector to choose an appropriate video
- * resolution.
- *
- *
These are pre-defined quality constants that are universally used for video.
- *
- *
See https://developer.android.com/reference/androidx/camera/video/Quality.
- */
- public enum VideoQualityConstraint {
- SD(0),
- HD(1),
- FHD(2),
- UHD(3),
- LOWEST(4),
- HIGHEST(5);
-
- final int index;
-
- private VideoQualityConstraint(final int index) {
- this.index = index;
- }
- }
-
- /** Fallback rules for selecting video resolution. */
- public enum VideoResolutionFallbackRule {
- HIGHER_QUALITY_OR_LOWER_THAN(0),
- HIGHER_QUALITY_THAN(1),
- LOWER_QUALITY_OR_HIGHER_THAN(2),
- LOWER_QUALITY_THAN(3);
-
- final int index;
-
- private VideoResolutionFallbackRule(final int index) {
- this.index = index;
- }
- }
-
/** Generated class from Pigeon that represents data sent in messages. */
public static final class ResolutionInfo {
private @NonNull Long width;
@@ -1593,11 +1556,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) {
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
public interface RecorderHostApi {
- void create(
- @NonNull Long identifier,
- @Nullable Long aspectRatio,
- @Nullable Long bitRate,
- @Nullable Long qualitySelectorId);
+ void create(@NonNull Long identifier, @Nullable Long aspectRatio, @Nullable Long bitRate);
@NonNull
Long getAspectRatio(@NonNull Long identifier);
@@ -1628,13 +1587,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo
Number identifierArg = (Number) args.get(0);
Number aspectRatioArg = (Number) args.get(1);
Number bitRateArg = (Number) args.get(2);
- Number qualitySelectorIdArg = (Number) args.get(3);
try {
api.create(
(identifierArg == null) ? null : identifierArg.longValue(),
(aspectRatioArg == null) ? null : aspectRatioArg.longValue(),
- (bitRateArg == null) ? null : bitRateArg.longValue(),
- (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue());
+ (bitRateArg == null) ? null : bitRateArg.longValue());
wrapped.add(0, null);
} catch (Throwable exception) {
ArrayList