Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[camera]: add assert to catch bad function call on Android 13
  • Loading branch information
David Roume committed Jan 5, 2023
commit 3f130369c2a9bf640eb8e46ce6457509a964c822
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ static Size computeBestPreviewSize(int cameraId, ResolutionPreset preset)
// ! limiting the condition to Build.VERSION.SDK_INT == 31 && Build.VERSION.SDK_INT == 32 only
// ! to avoid crash on Android 13
if (Build.VERSION.SDK_INT >= 31 && Build.VERSION.SDK_INT < 33) {
throw new AssertionError(
"Calling function [ computeBestPreviewSize ] with SDK v" + Build.VERSION.SDK_INT + " and cameraId = " + cameraId);

EncoderProfiles profile =
getBestAvailableCamcorderProfileForResolutionPreset(cameraId, preset);
List<EncoderProfiles.VideoProfile> videoProfiles = profile.getVideoProfiles();
Expand Down Expand Up @@ -261,6 +264,9 @@ private void configureResolution(ResolutionPreset resolutionPreset, int cameraId
// ! limiting the condition to Build.VERSION.SDK_INT == 31 && Build.VERSION.SDK_INT == 32 only
// ! to avoid crash on Android 13
if (Build.VERSION.SDK_INT >= 31 && Build.VERSION.SDK_INT < 33) {
throw new AssertionError(
"Calling function [ configureResolution ] with SDK v" + Build.VERSION.SDK_INT + " and cameraId = " + cameraId);

recordingProfile =
getBestAvailableCamcorderProfileForResolutionPreset(cameraId, resolutionPreset);
List<EncoderProfiles.VideoProfile> videoProfiles = recordingProfile.getVideoProfiles();
Expand Down