Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.10.5

* Fixes false positive for CamcorderProfile deprecation warning
that was already fixed.

## 0.10.4

* Temporarily fixes issue with requested video profiles being null by falling back to deprecated behavior in that case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ static Size computeBestPreviewSize(int cameraId, ResolutionPreset preset)
}
}

@SuppressWarnings("deprecation")
// TODO(camsim99): Suppression is currently safe because legacy code is used as a fallback for SDK >= S.
// TODO(camsim99): Suppression is currently safe because legacy code is used as a fallback for SDK < S.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably a typo? You have if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {} a few lines above.

// This should be removed when reverting that fallback behavior: https://github.com/flutter/flutter/issues/119668.
CamcorderProfile profile =
getBestAvailableCamcorderProfileForResolutionPresetLegacy(cameraId, preset);
Expand All @@ -144,6 +143,8 @@ static Size computeBestPreviewSize(int cameraId, ResolutionPreset preset)
* @return The best possible {@link android.media.CamcorderProfile} that matches the supplied
* {@link ResolutionPreset}.
*/
@TargetApi(Build.VERSION_CODES.R)
@SuppressWarnings("deprecation")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camsim99 Apparently @TargetApi() on its own does not silence the deprecation warning? IIRC my original fix (before your changes for that edge case with EncoderProfiles) only added that annotation to get rid of the deprecation warnings, which did work back then. Strange that I did have to add it back here.

public static CamcorderProfile getBestAvailableCamcorderProfileForResolutionPresetLegacy(
int cameraId, ResolutionPreset preset) {
if (cameraId < 0) {
Expand Down Expand Up @@ -256,7 +257,6 @@ private void configureResolution(ResolutionPreset resolutionPreset, int cameraId

if (!captureSizeCalculated) {
recordingProfile = null;
@SuppressWarnings("deprecation")
CamcorderProfile camcorderProfile =
getBestAvailableCamcorderProfileForResolutionPresetLegacy(cameraId, resolutionPreset);
recordingProfileLegacy = camcorderProfile;
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_android
description: Android implementation of the camera plugin.
repository: https://github.com/flutter/plugins/tree/main/packages/camera/camera_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.10.4
version: 0.10.5

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down