From b6729acd31d9b1050cb70bc0ad70a708aea3078b Mon Sep 17 00:00:00 2001 From: camsim99 Date: Fri, 2 Feb 2024 10:41:34 -0800 Subject: [PATCH 01/23] Start implementation of setting points + offset --- .../lib/src/android_camera_camerax.dart | 88 +++++++++++++++++++ .../lib/src/camera_control.dart | 8 ++ .../lib/src/focus_metering_action.dart | 8 +- 3 files changed, 102 insertions(+), 2 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index bbadd42ddd2..1a195433717 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:math' show Point; import 'package:async/async.dart'; import 'package:camera_platform_interface/camera_platform_interface.dart'; @@ -21,10 +22,12 @@ import 'camerax_proxy.dart'; import 'device_orientation_manager.dart'; import 'exposure_state.dart'; import 'fallback_strategy.dart'; +import 'focus_metering_action.dart'; import 'image_analysis.dart'; import 'image_capture.dart'; import 'image_proxy.dart'; import 'live_data.dart'; +import 'metering_point.dart'; import 'observer.dart'; import 'pending_recording.dart'; import 'plane_proxy.dart'; @@ -180,6 +183,10 @@ class AndroidCameraCameraX extends CameraPlatform { /// for an example on how setting target rotations for [UseCase]s works. bool shouldSetDefaultRotation = false; + /// The currently set [FocusMeteringAction] used to enable auto-focus and + /// auto-exposure. + FocusMeteringAction? currentFocusMeteringAction; + /// Returns list of all available cameras and their descriptions. @override Future> availableCameras() async { @@ -424,6 +431,18 @@ class AndroidCameraCameraX extends CameraPlatform { captureOrientationLocked = false; } + /// Sets the exposure point for automatically determining the exposure values. + /// + /// Supplying `null` for the [point] argument will result in resetting to the + /// original exposure point value. + /// + /// [cameraId] is not used. + @override + Future setExposurePoint(int cameraId, Point? point) async { + await _startFocusAndMeteringFor( + meteringPoint: point, meteringMode: FocusMeteringAction.flagAe); + } + /// Gets the minimum supported exposure offset for the selected camera in EV units. /// /// [cameraId] not used. @@ -455,6 +474,34 @@ class AndroidCameraCameraX extends CameraPlatform { return exposureState.exposureCompensationStep; } + /// Sets the exposure offset for the selected camera. + /// + /// The supplied [offset] value should be in EV units. 1 EV unit represents a + /// doubling in brightness. It should be between the minimum and maximum offsets + /// obtained through `getMinExposureOffset` and `getMaxExposureOffset` respectively. + /// Throws a `CameraException` when an illegal offset is supplied. + /// + /// When the supplied [offset] value does not align with the step size obtained + /// through `getExposureStepSize`, it will automatically be rounded to the nearest step. + /// + /// Returns the (rounded) offset value that was set. + @override + Future setExposureOffset(int cameraId, double offset) { + // double minOffset = TODO(camsim99): here + } + + /// Sets the focus point for automatically determining the focus values. + /// + /// Supplying `null` for the [point] argument will result in resetting to the + /// original focus point value. + /// + /// [cameraId] is not used. + @override + Future setFocusPoint(int cameraId, Point? point) async { + await _startFocusAndMeteringFor( + meteringPoint: point, meteringMode: FocusMeteringAction.flagAf); + } + /// Gets the maximum supported zoom level for the selected camera. /// /// [cameraId] not used. @@ -974,4 +1021,45 @@ class AndroidCameraCameraX extends CameraPlatform { return proxy.createQualitySelector( videoQuality: videoQuality, fallbackStrategy: fallbackStrategy); } + + Future _startFocusAndMeteringFor( + {required Point? meteringPoint, + required int? meteringMode}) async { + // TODO(camsim99): Consider caching cameraControl when camera created. + final CameraControl cameraControl = await camera!.getCameraControl(); + if (meteringPoint == null) { + if (currentFocusMeteringAction == null) { + return; + } + final List<(MeteringPoint, int?)> newMeteringPointInfos = + currentFocusMeteringAction!.meteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 != meteringMode) + .toList(); + currentFocusMeteringAction = + FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); + + await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); + } else if (meteringPoint.x < 0 || + meteringPoint.x > 1 || + meteringPoint.y < 0 && meteringPoint.y > 1) { + throw CameraException('TODO(camsim99)', 'TODO(camsim99)'); + } + + List<(MeteringPoint, int?)> newMeteringPointInfos = + <(MeteringPoint, int?)>[]; + if (currentFocusMeteringAction != null) { + newMeteringPointInfos = currentFocusMeteringAction!.meteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 != meteringMode) + .toList(); + } + final MeteringPoint newMeteringPoint = + MeteringPoint(x: meteringPoint!.x, y: meteringPoint.y); + newMeteringPointInfos.add((newMeteringPoint, meteringMode)); + currentFocusMeteringAction = + FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); + + await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); + } } diff --git a/packages/camera/camera_android_camerax/lib/src/camera_control.dart b/packages/camera/camera_android_camerax/lib/src/camera_control.dart index 9c50ffa161f..d21e737362f 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -56,6 +56,10 @@ class CameraControl extends JavaObject { /// Will trigger an auto focus action and enable auto focus/auto exposure/ /// auto white balance metering regions. /// + /// Only one [FocusMeteringAction] is allowed to run at a time; if multiple + /// are executed in a row, only the latest one will work and other actions + /// will be canceled. + /// /// Returns null if focus and metering could not be started. Future startFocusAndMetering( FocusMeteringAction action) { @@ -74,6 +78,10 @@ class CameraControl extends JavaObject { /// of the current [ExposureState]'s `exposureCompensationRange` for the call /// to succeed. /// + /// Only one [setExposureCompensationIndex] is allowed to run at a time; if + /// multiple are executed in a row, only the latest setting will be kept in + /// the camera. + /// /// Returns null if the exposure compensation index failed to be set. Future setExposureCompensationIndex(int index) async { return _api.setExposureCompensationIndexFromInstance(this, index); diff --git a/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart index 6d9ebd97f01..851dc7aca2e 100644 --- a/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart +++ b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart @@ -19,8 +19,7 @@ class FocusMeteringAction extends JavaObject { FocusMeteringAction({ BinaryMessenger? binaryMessenger, InstanceManager? instanceManager, - required List<(MeteringPoint meteringPoint, int? meteringMode)> - meteringPointInfos, + required this.meteringPointInfos, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, @@ -35,6 +34,7 @@ class FocusMeteringAction extends JavaObject { FocusMeteringAction.detached({ BinaryMessenger? binaryMessenger, InstanceManager? instanceManager, + required this.meteringPointInfos, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, @@ -45,6 +45,10 @@ class FocusMeteringAction extends JavaObject { late final _FocusMeteringActionHostApiImpl _api; + /// The requested [MeteringPoint]s and modes those points are relevant to. + final List<(MeteringPoint meteringPoint, int? meteringMode)> + meteringPointInfos; + /// Flag for metering mode that indicates the auto focus region is enabled. /// /// An autofocus scan is also triggered when [flagAf] is assigned. From 14d10242db3654da339875ee1ae6c3889d8cb0c3 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 5 Feb 2024 11:36:54 -0800 Subject: [PATCH 02/23] Finish adding intial impls --- .../lib/src/android_camera_camerax.dart | 36 ++++++++++++++++--- .../lib/src/focus_metering_action.dart | 4 ++- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 1a195433717..e3066193508 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -465,13 +465,17 @@ class AndroidCameraCameraX extends CameraPlatform { /// Gets the supported step size for exposure offset for the selected camera in EV units. /// - /// Returns 0 when exposure compensation is not supported. - /// /// [cameraId] not used. @override Future getExposureOffsetStepSize(int cameraId) async { final ExposureState exposureState = await cameraInfo!.getExposureState(); - return exposureState.exposureCompensationStep; + final double exposureOffsetStepSize = + (await cameraInfo!.getExposureState()).exposureCompensationStep; + if (exposureOffsetStepSize == 0) { + throw CameraException( + 'TODO(camsim99)', 'Exposure compensation not supported'); + } + return exposureOffsetStepSize; } /// Sets the exposure offset for the selected camera. @@ -486,8 +490,29 @@ class AndroidCameraCameraX extends CameraPlatform { /// /// Returns the (rounded) offset value that was set. @override - Future setExposureOffset(int cameraId, double offset) { - // double minOffset = TODO(camsim99): here + Future setExposureOffset(int cameraId, double offset) async { + final double minOffset = await getMinExposureOffset(cameraId); + final double maxOffset = await getMaxExposureOffset(cameraId); + + if (offset < minOffset || offset > maxOffset) { + throw CameraException('TODO(camsim99)', 'TODO(camsim99)'); + } + + final double exposureOffsetStepSize = + (await cameraInfo!.getExposureState()).exposureCompensationStep; + if (exposureOffsetStepSize == 0) { + throw CameraException( + 'TODO(camsim99)', 'Exposure compensation not supported'); + } + + final int roundedExposureCompensationIndex = + (offset / exposureOffsetStepSize) as int; + final CameraControl cameraControl = await camera!.getCameraControl(); + + await cameraControl + .setExposureCompensationIndex(roundedExposureCompensationIndex); + + return roundedExposureCompensationIndex * exposureOffsetStepSize; } /// Sets the focus point for automatically determining the focus values. @@ -1022,6 +1047,7 @@ class AndroidCameraCameraX extends CameraPlatform { videoQuality: videoQuality, fallbackStrategy: fallbackStrategy); } + /// TODO(camsim99) Future _startFocusAndMeteringFor( {required Point? meteringPoint, required int? meteringMode}) async { diff --git a/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart index 851dc7aca2e..bd2847f1ec2 100644 --- a/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart +++ b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart @@ -101,7 +101,9 @@ class _FocusMeteringActionHostApiImpl extends FocusMeteringActionHostApi { final int identifier = instanceManager.addDartCreatedInstance(instance, onCopy: (FocusMeteringAction original) { return FocusMeteringAction.detached( - binaryMessenger: binaryMessenger, instanceManager: instanceManager); + binaryMessenger: binaryMessenger, + instanceManager: instanceManager, + meteringPointInfos: original.meteringPointInfos); }); final List meteringPointInfosWithIds = From 975806bd685a787d0101aece0cb5db460a33db1f Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 5 Feb 2024 12:41:01 -0800 Subject: [PATCH 03/23] Fix crashes --- .../camerax/CameraAndroidCameraxPlugin.java | 3 ++ .../camerax/CameraControlHostApiImpl.java | 5 ++++ .../example/lib/main.dart | 30 +++++++++++++------ .../lib/src/android_camera_camerax.dart | 8 ++++- 4 files changed, 36 insertions(+), 10 deletions(-) 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 b0e0493cbe2..24fed292ec8 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 @@ -119,6 +119,9 @@ public void setUp( cameraControlHostApiImpl = new CameraControlHostApiImpl(binaryMessenger, instanceManager, context); GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl); + GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup(binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup(binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, new MeteringPointHostApiImpl(instanceManager)); } @Override diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java index 9d9778c6921..fa7281b091d 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java @@ -162,6 +162,11 @@ public void onSuccess(Integer integerResult) { } public void onFailure(Throwable t) { + if (t instanceof CameraControl.OperationCanceledException) { + // TODO(camsim99): make result nullable, return null result here if canceled because we don't want this to throw an exception + result.success(3L); + return; + } result.error(t); } }, diff --git a/packages/camera/camera_android_camerax/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index 4484c5dac98..adb86837371 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -282,14 +282,15 @@ class _CameraExampleHomeState extends State IconButton( icon: const Icon(Icons.exposure), color: Colors.blue, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? onExposureModeButtonPressed + : null, ), IconButton( icon: const Icon(Icons.filter_center_focus), color: Colors.blue, onPressed: - () {}, // TODO(camsim99): Add functionality back here. + controller != null ? onFocusModeButtonPressed : null, ) ] : [], @@ -394,8 +395,13 @@ class _CameraExampleHomeState extends State style: styleAuto, onPressed: () {}, // TODO(camsim99): Add functionality back here. - onLongPress: - () {}, // TODO(camsim99): Add functionality back here., + onLongPress: () { + if (controller != null) { + CameraPlatform.instance + .setExposurePoint(controller!.cameraId, null); + showInSnackBar('Resetting exposure point'); + } + }, child: const Text('AUTO'), ), TextButton( @@ -406,8 +412,9 @@ class _CameraExampleHomeState extends State ), TextButton( style: styleLocked, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => controller!.setExposureOffset(0.0) + : null, child: const Text('RESET OFFSET'), ), ], @@ -468,8 +475,13 @@ class _CameraExampleHomeState extends State style: styleAuto, onPressed: () {}, // TODO(camsim99): Add functionality back here. - onLongPress: - () {}, // TODO(camsim99): Add functionality back here. + onLongPress: () { + if (controller != null) { + CameraPlatform.instance + .setFocusPoint(controller!.cameraId, null); + } + showInSnackBar('Resetting focus point'); + }, child: const Text('AUTO'), ), TextButton( diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index e3066193508..62959043d5f 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -491,6 +491,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// Returns the (rounded) offset value that was set. @override Future setExposureOffset(int cameraId, double offset) async { + // TODO(camsim99): Cache these values if possible in an attempt to improve performance. final double minOffset = await getMinExposureOffset(cameraId); final double maxOffset = await getMaxExposureOffset(cameraId); @@ -506,7 +507,7 @@ class AndroidCameraCameraX extends CameraPlatform { } final int roundedExposureCompensationIndex = - (offset / exposureOffsetStepSize) as int; + (offset / exposureOffsetStepSize).round(); final CameraControl cameraControl = await camera!.getCameraControl(); await cameraControl @@ -1062,10 +1063,15 @@ class AndroidCameraCameraX extends CameraPlatform { .where(((MeteringPoint, int?) meteringPointInfo) => meteringPointInfo.$2 != meteringMode) .toList(); + if (newMeteringPointInfos.isEmpty) { + await cameraControl.cancelFocusAndMetering(); + return; + } currentFocusMeteringAction = FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); + return; } else if (meteringPoint.x < 0 || meteringPoint.x > 1 || meteringPoint.y < 0 && meteringPoint.y > 1) { From a7181b2b59228fa2c0daeb5f20deef9a2ca7c221 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Feb 2024 10:59:16 -0800 Subject: [PATCH 04/23] Cleanup pt1 --- .../camerax/CameraControlHostApiImpl.java | 11 +- .../camerax/GeneratedCameraXLibrary.java | 1193 +++++------------ .../lib/src/android_camera_camerax.dart | 16 +- .../lib/src/camera_control.dart | 17 +- .../lib/src/camerax_library.g.dart | 518 +++---- .../pigeons/camerax_library.dart | 4 +- .../test/test_camerax_library.g.dart | 1022 +++++--------- 7 files changed, 880 insertions(+), 1901 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java index fa7281b091d..0dfcdb6efb1 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java @@ -113,6 +113,12 @@ public void onSuccess(FocusMeteringResult focusMeteringResult) { } public void onFailure(Throwable t) { + if (t instanceof CameraControl.OperationCanceledException) { + // Operation was canceled due to camera being closed or a new request was submitted, which + // is not actionable and should not block a new value from potentially being submitted. + result.success(null); + return; + } result.error(t); } }, @@ -163,8 +169,9 @@ public void onSuccess(Integer integerResult) { public void onFailure(Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // TODO(camsim99): make result nullable, return null result here if canceled because we don't want this to throw an exception - result.success(3L); + // Operation was canceled due to camera being closed or a new request was submitted, which + // is not actionable and should not block a new value from potentially being submitted. + result.success(null); return; } result.error(t); 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 0797d7bee8f..ef51890a187 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 @@ -18,7 +18,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -33,7 +35,8 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) + { super(message); this.code = code; this.details = details; @@ -52,7 +55,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -60,7 +63,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /** * The states the camera can be in. * - *

See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. + * See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. */ public enum CameraStateType { CLOSED(0), @@ -79,19 +82,20 @@ private CameraStateType(final int index) { /** * The types (T) properly wrapped to be used as a LiveData. * - *

If you need to add another type to support a type S to use a LiveData in this plugin, - * ensure the following is done on the Dart side: + * If you need to add another type to support a type S to use a LiveData in + * this plugin, ensure the following is done on the Dart side: * - *

* In `../lib/src/live_data.dart`, add new cases for S in - * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a - * LiveData instance and in `LiveDataFlutterApiImpl#create` to create the expected type of - * LiveData when requested. + * * In `../lib/src/live_data.dart`, add new cases for S in + * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of + * type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` + * to create the expected type of LiveData when requested. * - *

On the native side, ensure the following is done: + * On the native side, ensure the following is done: * - *

* Update `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for - * instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle - * receiving calls with instances of type S if a LiveData instance is observed. + * * Update `LiveDataHostApiImpl#getValue` is updated to properly return + * identifiers for instances of type S. + * * Update `ObserverFlutterApiWrapper#onChanged` to properly handle receiving + * calls with instances of type S if a LiveData instance is observed. */ public enum LiveDataSupportedType { CAMERA_STATE(0), @@ -105,12 +109,12 @@ private LiveDataSupportedType(final int index) { } /** - * Video quality constraints that will be used by a QualitySelector to choose an appropriate video - * resolution. + * 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. + * These are pre-defined quality constants that are universally used for video. * - *

See https://developer.android.com/reference/androidx/camera/video/Quality. + * See https://developer.android.com/reference/androidx/camera/video/Quality. */ public enum VideoQuality { SD(0), @@ -130,7 +134,7 @@ private VideoQuality(final int index) { /** * Fallback rules for selecting video resolution. * - *

See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. + * See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. */ public enum VideoResolutionFallbackRule { HIGHER_QUALITY_OR_LOWER_THAN(0), @@ -211,13 +215,9 @@ ArrayList toList() { static @NonNull ResolutionInfo fromList(@NonNull ArrayList list) { ResolutionInfo pigeonResult = new ResolutionInfo(); Object width = list.get(0); - pigeonResult.setWidth( - (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = list.get(1); - pigeonResult.setHeight( - (height == null) - ? null - : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); return pigeonResult; } } @@ -459,19 +459,9 @@ ArrayList toList() { static @NonNull ExposureCompensationRange fromList(@NonNull ArrayList list) { ExposureCompensationRange pigeonResult = new ExposureCompensationRange(); Object minCompensation = list.get(0); - pigeonResult.setMinCompensation( - (minCompensation == null) - ? null - : ((minCompensation instanceof Integer) - ? (Integer) minCompensation - : (Long) minCompensation)); + pigeonResult.setMinCompensation((minCompensation == null) ? null : ((minCompensation instanceof Integer) ? (Integer) minCompensation : (Long) minCompensation)); Object maxCompensation = list.get(1); - pigeonResult.setMaxCompensation( - (maxCompensation == null) - ? null - : ((maxCompensation instanceof Integer) - ? (Integer) maxCompensation - : (Long) maxCompensation)); + pigeonResult.setMaxCompensation((maxCompensation == null) ? null : ((maxCompensation instanceof Integer) ? (Integer) maxCompensation : (Long) maxCompensation)); return pigeonResult; } } @@ -479,7 +469,7 @@ ArrayList toList() { /** * Convenience class for sending lists of [Quality]s. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class VideoQualityData { private @NonNull VideoQuality quality; @@ -530,12 +520,13 @@ ArrayList toList() { } /** - * Convenience class for building [FocusMeteringAction] with multiple metering points. + * Convenience class for building [FocusMeteringAction]s with multiple metering + * points. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class MeteringPointInfo { - /** Instance manager ID corresponding to [MeteringPoint] that relates to this info. */ + /** InstanceManager ID for a [MeteringPoint]. */ private @NonNull Long meteringPointId; public @NonNull Long getMeteringPointId() { @@ -549,7 +540,11 @@ public void setMeteringPointId(@NonNull Long setterArg) { this.meteringPointId = setterArg; } - /** Metering mode represented by one of the [FocusMeteringAction] constants. */ + /** + * The metering mode of the [MeteringPoint] whose ID is [meteringPointId]. + * + * Metering mode should be one of the [FocusMeteringAction] constants. + */ private @Nullable Long meteringMode; public @Nullable Long getMeteringMode() { @@ -598,17 +593,9 @@ ArrayList toList() { static @NonNull MeteringPointInfo fromList(@NonNull ArrayList list) { MeteringPointInfo pigeonResult = new MeteringPointInfo(); Object meteringPointId = list.get(0); - pigeonResult.setMeteringPointId( - (meteringPointId == null) - ? null - : ((meteringPointId instanceof Integer) - ? (Integer) meteringPointId - : (Long) meteringPointId)); + pigeonResult.setMeteringPointId((meteringPointId == null) ? null : ((meteringPointId instanceof Integer) ? (Integer) meteringPointId : (Long) meteringPointId)); Object meteringMode = list.get(1); - pigeonResult.setMeteringMode( - (meteringMode == null) - ? null - : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); + pigeonResult.setMeteringMode((meteringMode == null) ? null : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); return pigeonResult; } } @@ -624,7 +611,7 @@ public interface InstanceManagerHostApi { /** * Clear the native `InstanceManager`. * - *

This is typically only used after a hot restart. + * This is typically only used after a hot restart. */ void clear(); @@ -632,12 +619,8 @@ public interface InstanceManagerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `InstanceManagerHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { + /**Sets up an instance of `InstanceManagerHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -649,7 +632,8 @@ static void setup( try { api.clear(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -670,9 +654,7 @@ public interface JavaObjectHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObjectHostApi api) { { BasicMessageChannel channel = @@ -687,7 +669,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObject try { api.dispose((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -707,7 +690,7 @@ public JavaObjectFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -716,7 +699,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -729,32 +711,28 @@ public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraInfoHostApi { - @NonNull + @NonNull Long getSensorRotationDegrees(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraState(@NonNull Long identifier); - @NonNull + @NonNull Long getExposureState(@NonNull Long identifier); - @NonNull + @NonNull Long getZoomState(@NonNull Long identifier); /** The codec used by CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -762,11 +740,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getSensorRotationDegrees( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getSensorRotationDegrees((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -787,11 +764,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getCameraState( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getCameraState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -804,9 +780,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -814,11 +788,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getExposureState( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getExposureState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -839,10 +812,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -862,7 +835,7 @@ public CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -871,7 +844,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -886,19 +858,15 @@ public interface CameraSelectorHostApi { void create(@NonNull Long identifier, @Nullable Long lensFacing); - @NonNull + @NonNull List filter(@NonNull Long identifier, @NonNull List cameraInfoIds); /** The codec used by CameraSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `CameraSelectorHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { + /**Sets up an instance of `CameraSelectorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -911,11 +879,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number lensFacingArg = (Number) args.get(1); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (lensFacingArg == null) ? null : lensFacingArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (lensFacingArg == null) ? null : lensFacingArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -937,12 +904,10 @@ static void setup( Number identifierArg = (Number) args.get(0); List cameraInfoIdsArg = (List) args.get(1); try { - List output = - api.filter( - (identifierArg == null) ? null : identifierArg.longValue(), - cameraInfoIdsArg); + List output = api.filter((identifierArg == null) ? null : identifierArg.longValue(), cameraInfoIdsArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -962,7 +927,7 @@ public CameraSelectorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -971,9 +936,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraSelectorFlutterApi.create", getCodec()); @@ -987,16 +950,13 @@ public interface ProcessCameraProviderHostApi { void getInstance(@NonNull Result result); - @NonNull + @NonNull List getAvailableCameraInfos(@NonNull Long identifier); - @NonNull - Long bindToLifecycle( - @NonNull Long identifier, - @NonNull Long cameraSelectorIdentifier, - @NonNull List useCaseIds); + @NonNull + Long bindToLifecycle(@NonNull Long identifier, @NonNull Long cameraSelectorIdentifier, @NonNull List useCaseIds); - @NonNull + @NonNull Boolean isBound(@NonNull Long identifier, @NonNull Long useCaseIdentifier); void unbind(@NonNull Long identifier, @NonNull List useCaseIds); @@ -1007,18 +967,12 @@ Long bindToLifecycle( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { + /**Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1045,9 +999,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1055,11 +1007,10 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = - api.getAvailableCameraInfos( - (identifierArg == null) ? null : identifierArg.longValue()); + List output = api.getAvailableCameraInfos((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1072,9 +1023,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1084,15 +1033,10 @@ public void error(Throwable error) { Number cameraSelectorIdentifierArg = (Number) args.get(1); List useCaseIdsArg = (List) args.get(2); try { - Long output = - api.bindToLifecycle( - (identifierArg == null) ? null : identifierArg.longValue(), - (cameraSelectorIdentifierArg == null) - ? null - : cameraSelectorIdentifierArg.longValue(), - useCaseIdsArg); + Long output = api.bindToLifecycle((identifierArg == null) ? null : identifierArg.longValue(), (cameraSelectorIdentifierArg == null) ? null : cameraSelectorIdentifierArg.longValue(), useCaseIdsArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1105,9 +1049,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1116,12 +1058,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number useCaseIdentifierArg = (Number) args.get(1); try { - Boolean output = - api.isBound( - (identifierArg == null) ? null : identifierArg.longValue(), - (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); + Boolean output = api.isBound((identifierArg == null) ? null : identifierArg.longValue(), (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1134,9 +1074,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1145,10 +1083,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); List useCaseIdsArg = (List) args.get(1); try { - api.unbind( - (identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); + api.unbind((identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1161,9 +1099,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1173,7 +1109,8 @@ public void error(Throwable error) { try { api.unbindAll((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1193,7 +1130,7 @@ public ProcessCameraProviderFlutterApi(@NonNull BinaryMessenger argBinaryMesseng this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1202,13 +1139,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -1217,17 +1151,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraHostApi { - @NonNull + @NonNull Long getCameraInfo(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraControl(@NonNull Long identifier); /** The codec used by CameraHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHostApi api) { { BasicMessageChannel channel = @@ -1240,10 +1174,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1264,11 +1198,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getCameraControl( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getCameraControl((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1288,7 +1221,7 @@ public CameraFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1297,7 +1230,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1337,28 +1269,21 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface SystemServicesHostApi { - void requestCameraPermissions( - @NonNull Boolean enableAudio, @NonNull Result result); + void requestCameraPermissions(@NonNull Boolean enableAudio, @NonNull Result result); - @NonNull + @NonNull String getTempFilePath(@NonNull String prefix, @NonNull String suffix); /** The codec used by SystemServicesHostApi. */ static @NonNull MessageCodec getCodec() { return SystemServicesHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `SystemServicesHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { + /**Sets up an instance of `SystemServicesHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1387,9 +1312,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1400,7 +1323,8 @@ public void error(Throwable error) { try { String output = api.getTempFilePath(prefixArg, suffixArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1420,7 +1344,7 @@ public SystemServicesFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1429,13 +1353,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", getCodec()); channel.send( new ArrayList(Collections.singletonList(errorDescriptionArg)), channelReply -> callback.reply(null)); @@ -1444,30 +1365,23 @@ public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { + /**Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1476,11 +1390,10 @@ static void setup( Boolean isFrontFacingArg = (Boolean) args.get(0); Number sensorOrientationArg = (Number) args.get(1); try { - api.startListeningForDeviceOrientationChange( - isFrontFacingArg, - (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); + api.startListeningForDeviceOrientationChange(isFrontFacingArg, (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1493,9 +1406,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1503,7 +1414,8 @@ static void setup( try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1516,9 +1428,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1526,7 +1436,8 @@ static void setup( try { Long output = api.getDefaultDisplayRotation(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1546,7 +1457,7 @@ public DeviceOrientationManagerFlutterApi(@NonNull BinaryMessenger argBinaryMess this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1555,14 +1466,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void onDeviceOrientationChanged( - @NonNull String orientationArg, @NonNull Reply callback) { + public void onDeviceOrientationChanged(@NonNull String orientationArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", getCodec()); channel.send( new ArrayList(Collections.singletonList(orientationArg)), channelReply -> callback.reply(null)); @@ -1598,15 +1505,14 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PreviewHostApi { - void create( - @NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); + void create(@NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); - @NonNull + @NonNull Long setSurfaceProvider(@NonNull Long identifier); void releaseFlutterSurfaceTexture(); - @NonNull + @NonNull ResolutionInfo getResolutionInfo(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1615,7 +1521,7 @@ void create( static @NonNull MessageCodec getCodec() { return PreviewHostApiCodec.INSTANCE; } - /** Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHostApi api) { { BasicMessageChannel channel = @@ -1630,14 +1536,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number rotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue(), - (resolutionSelectorIdArg == null) - ? null - : resolutionSelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1650,9 +1552,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1660,11 +1560,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.setSurfaceProvider( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.setSurfaceProvider((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1677,9 +1576,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1687,7 +1584,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos try { api.releaseFlutterSurfaceTexture(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1708,11 +1606,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - ResolutionInfo output = - api.getResolutionInfo( - (identifierArg == null) ? null : identifierArg.longValue()); + ResolutionInfo output = api.getResolutionInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1734,11 +1631,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1753,10 +1649,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoCaptureHostApi { - @NonNull + @NonNull Long withOutput(@NonNull Long videoOutputId); - @NonNull + @NonNull Long getOutput(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1765,10 +1661,7 @@ public interface VideoCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `VideoCaptureHostApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `VideoCaptureHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptureHostApi api) { { BasicMessageChannel channel = @@ -1781,11 +1674,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number videoOutputIdArg = (Number) args.get(0); try { - Long output = - api.withOutput( - (videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); + Long output = api.withOutput((videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1806,10 +1698,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1822,9 +1714,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1833,11 +1723,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1857,7 +1746,7 @@ public VideoCaptureFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1866,7 +1755,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1879,28 +1767,22 @@ 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, @Nullable Long qualitySelectorId); - @NonNull + @NonNull Long getAspectRatio(@NonNull Long identifier); - @NonNull + @NonNull Long getTargetVideoEncodingBitRate(@NonNull Long identifier); - @NonNull + @NonNull Long prepareRecording(@NonNull Long identifier, @NonNull String path); /** The codec used by RecorderHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHostApi api) { { BasicMessageChannel channel = @@ -1916,13 +1798,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo 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()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), (bitRateArg == null) ? null : bitRateArg.longValue(), (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1943,11 +1822,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getAspectRatio( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getAspectRatio((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1960,9 +1838,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1970,11 +1846,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getTargetVideoEncodingBitRate( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getTargetVideoEncodingBitRate((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1996,11 +1871,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number identifierArg = (Number) args.get(0); String pathArg = (String) args.get(1); try { - Long output = - api.prepareRecording( - (identifierArg == null) ? null : identifierArg.longValue(), pathArg); + Long output = api.prepareRecording((identifierArg == null) ? null : identifierArg.longValue(), pathArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2020,7 +1894,7 @@ public RecorderFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2029,12 +1903,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @Nullable Long aspectRatioArg, - @Nullable Long bitRateArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @Nullable Long bitRateArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.RecorderFlutterApi.create", getCodec()); @@ -2046,19 +1915,15 @@ public void create( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PendingRecordingHostApi { - @NonNull + @NonNull Long start(@NonNull Long identifier); /** The codec used by PendingRecordingHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `PendingRecordingHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { + /**Sets up an instance of `PendingRecordingHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2070,10 +1935,10 @@ static void setup( ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.start((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.start((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2093,7 +1958,7 @@ public PendingRecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2102,7 +1967,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2127,9 +1991,7 @@ public interface RecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingHostApi api) { { BasicMessageChannel channel = @@ -2144,7 +2006,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2167,7 +2030,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.pause((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2190,7 +2054,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.resume((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2213,7 +2078,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.stop((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2233,7 +2099,7 @@ public RecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2242,7 +2108,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2255,11 +2120,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageCaptureHostApi { - void create( - @NonNull Long identifier, - @Nullable Long targetRotation, - @Nullable Long flashMode, - @Nullable Long resolutionSelectorId); + void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long flashMode, @Nullable Long resolutionSelectorId); void setFlashMode(@NonNull Long identifier, @NonNull Long flashMode); @@ -2271,10 +2132,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ImageCaptureHostApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `ImageCaptureHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptureHostApi api) { { BasicMessageChannel channel = @@ -2290,15 +2148,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number flashModeArg = (Number) args.get(2); Number resolutionSelectorIdArg = (Number) args.get(3); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (targetRotationArg == null) ? null : targetRotationArg.longValue(), - (flashModeArg == null) ? null : flashModeArg.longValue(), - (resolutionSelectorIdArg == null) - ? null - : resolutionSelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2320,11 +2173,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number identifierArg = (Number) args.get(0); Number flashModeArg = (Number) args.get(1); try { - api.setFlashMode( - (identifierArg == null) ? null : identifierArg.longValue(), - (flashModeArg == null) ? null : flashModeArg.longValue()); + api.setFlashMode((identifierArg == null) ? null : identifierArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2357,8 +2209,7 @@ public void error(Throwable error) { } }; - api.takePicture( - (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.takePicture((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -2367,9 +2218,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2378,11 +2227,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2396,8 +2244,7 @@ public void error(Throwable error) { } private static class ResolutionStrategyHostApiCodec extends StandardMessageCodec { - public static final ResolutionStrategyHostApiCodec INSTANCE = - new ResolutionStrategyHostApiCodec(); + public static final ResolutionStrategyHostApiCodec INSTANCE = new ResolutionStrategyHostApiCodec(); private ResolutionStrategyHostApiCodec() {} @@ -2425,19 +2272,14 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionStrategyHostApi { - void create( - @NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); + void create(@NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); /** The codec used by ResolutionStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionStrategyHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { + /**Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2451,12 +2293,10 @@ static void setup( ResolutionInfo boundSizeArg = (ResolutionInfo) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - boundSizeArg, - (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), boundSizeArg, (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2471,21 +2311,14 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionSelectorHostApi { - void create( - @NonNull Long identifier, - @Nullable Long resolutionStrategyIdentifier, - @Nullable Long aspectRatioStrategyIdentifier); + void create(@NonNull Long identifier, @Nullable Long resolutionStrategyIdentifier, @Nullable Long aspectRatioStrategyIdentifier); /** The codec used by ResolutionSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { + /**Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2499,16 +2332,10 @@ static void setup( Number resolutionStrategyIdentifierArg = (Number) args.get(1); Number aspectRatioStrategyIdentifierArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (resolutionStrategyIdentifierArg == null) - ? null - : resolutionStrategyIdentifierArg.longValue(), - (aspectRatioStrategyIdentifierArg == null) - ? null - : aspectRatioStrategyIdentifierArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (resolutionStrategyIdentifierArg == null) ? null : resolutionStrategyIdentifierArg.longValue(), (aspectRatioStrategyIdentifierArg == null) ? null : aspectRatioStrategyIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2523,25 +2350,18 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AspectRatioStrategyHostApi { - void create( - @NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); + void create(@NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); /** The codec used by AspectRatioStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { + /**Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2551,14 +2371,10 @@ static void setup( Number preferredAspectRatioArg = (Number) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (preferredAspectRatioArg == null) - ? null - : preferredAspectRatioArg.longValue(), - (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (preferredAspectRatioArg == null) ? null : preferredAspectRatioArg.longValue(), (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2605,7 +2421,7 @@ public CameraStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2614,12 +2430,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return CameraStateFlutterApiCodec.INSTANCE; } - - public void create( - @NonNull Long identifierArg, - @NonNull CameraStateTypeData typeArg, - @Nullable Long errorIdentifierArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull CameraStateTypeData typeArg, @Nullable Long errorIdentifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateFlutterApi.create", getCodec()); @@ -2663,7 +2474,7 @@ public ExposureStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2672,19 +2483,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return ExposureStateFlutterApiCodec.INSTANCE; } - - public void create( - @NonNull Long identifierArg, - @NonNull ExposureCompensationRange exposureCompensationRangeArg, - @NonNull Double exposureCompensationStepArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull ExposureCompensationRange exposureCompensationRangeArg, @NonNull Double exposureCompensationStepArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ExposureStateFlutterApi.create", getCodec()); channel.send( - new ArrayList( - Arrays.asList( - identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), + new ArrayList(Arrays.asList(identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), channelReply -> callback.reply(null)); } } @@ -2696,7 +2500,7 @@ public ZoomStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2705,12 +2509,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @NonNull Double minZoomRatioArg, - @NonNull Double maxZoomRatioArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, @NonNull Double maxZoomRatioArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ZoomStateFlutterApi.create", getCodec()); @@ -2722,10 +2521,7 @@ public void create( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageAnalysisHostApi { - void create( - @NonNull Long identifier, - @Nullable Long targetRotation, - @Nullable Long resolutionSelectorId); + void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long resolutionSelectorId); void setAnalyzer(@NonNull Long identifier, @NonNull Long analyzerIdentifier); @@ -2737,12 +2533,8 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ImageAnalysisHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { + /**Sets up an instance of `ImageAnalysisHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2756,14 +2548,10 @@ static void setup( Number targetRotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (targetRotationArg == null) ? null : targetRotationArg.longValue(), - (resolutionSelectorIdArg == null) - ? null - : resolutionSelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2785,11 +2573,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number analyzerIdentifierArg = (Number) args.get(1); try { - api.setAnalyzer( - (identifierArg == null) ? null : identifierArg.longValue(), - (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); + api.setAnalyzer((identifierArg == null) ? null : identifierArg.longValue(), (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2802,9 +2589,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2814,7 +2599,8 @@ static void setup( try { api.clearAnalyzer((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2827,9 +2613,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2838,11 +2622,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2863,9 +2646,7 @@ public interface AnalyzerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHostApi api) { { BasicMessageChannel channel = @@ -2880,7 +2661,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2901,9 +2683,7 @@ public interface ObserverHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHostApi api) { { BasicMessageChannel channel = @@ -2918,7 +2698,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2938,7 +2719,7 @@ public ObserverFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2947,11 +2728,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void onChanged( - @NonNull Long identifierArg, - @NonNull Long valueIdentifierArg, - @NonNull Reply callback) { + public void onChanged(@NonNull Long identifierArg, @NonNull Long valueIdentifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ObserverFlutterApi.onChanged", getCodec()); @@ -2968,7 +2745,7 @@ public CameraStateErrorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2977,9 +2754,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateErrorFlutterApi.create", getCodec()); @@ -3022,16 +2797,14 @@ public interface LiveDataHostApi { void removeObservers(@NonNull Long identifier); - @Nullable + @Nullable Long getValue(@NonNull Long identifier, @NonNull LiveDataSupportedTypeData type); /** The codec used by LiveDataHostApi. */ static @NonNull MessageCodec getCodec() { return LiveDataHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHostApi api) { { BasicMessageChannel channel = @@ -3045,11 +2818,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); Number observerIdentifierArg = (Number) args.get(1); try { - api.observe( - (identifierArg == null) ? null : identifierArg.longValue(), - (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); + api.observe((identifierArg == null) ? null : identifierArg.longValue(), (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3072,7 +2844,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo try { api.removeObservers((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3094,11 +2867,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); LiveDataSupportedTypeData typeArg = (LiveDataSupportedTypeData) args.get(1); try { - Long output = - api.getValue( - (identifierArg == null) ? null : identifierArg.longValue(), typeArg); + Long output = api.getValue((identifierArg == null) ? null : identifierArg.longValue(), typeArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3145,7 +2917,7 @@ public LiveDataFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3154,11 +2926,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return LiveDataFlutterApiCodec.INSTANCE; } - - public void create( - @NonNull Long identifierArg, - @NonNull LiveDataSupportedTypeData typeArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull LiveDataSupportedTypeData typeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.LiveDataFlutterApi.create", getCodec()); @@ -3175,7 +2943,7 @@ public AnalyzerFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3184,7 +2952,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3193,11 +2960,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } - - public void analyze( - @NonNull Long identifierArg, - @NonNull Long imageProxyIdentifierArg, - @NonNull Reply callback) { + public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.AnalyzerFlutterApi.analyze", getCodec()); @@ -3209,7 +2972,7 @@ public void analyze( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageProxyHostApi { - @NonNull + @NonNull List getPlanes(@NonNull Long identifier); void close(@NonNull Long identifier); @@ -3218,9 +2981,7 @@ public interface ImageProxyHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxyHostApi api) { { BasicMessageChannel channel = @@ -3233,10 +2994,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = - api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); + List output = api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3259,7 +3020,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3279,7 +3041,7 @@ public ImageProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3288,13 +3050,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @NonNull Long formatArg, - @NonNull Long heightArg, - @NonNull Long widthArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull Long formatArg, @NonNull Long heightArg, @NonNull Long widthArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ImageProxyFlutterApi.create", getCodec()); @@ -3311,7 +3067,7 @@ public PlaneProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3320,19 +3076,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @NonNull byte[] bufferArg, - @NonNull Long pixelStrideArg, - @NonNull Long rowStrideArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull byte[] bufferArg, @NonNull Long pixelStrideArg, @NonNull Long rowStrideArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.PlaneProxyFlutterApi.create", getCodec()); channel.send( - new ArrayList( - Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), + new ArrayList(Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), channelReply -> callback.reply(null)); } } @@ -3371,24 +3120,17 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface QualitySelectorHostApi { - void create( - @NonNull Long identifier, - @NonNull List videoQualityDataList, - @Nullable Long fallbackStrategyId); + void create(@NonNull Long identifier, @NonNull List videoQualityDataList, @Nullable Long fallbackStrategyId); - @NonNull + @NonNull ResolutionInfo getResolution(@NonNull Long cameraInfoId, @NonNull VideoQuality quality); /** The codec used by QualitySelectorHostApi. */ static @NonNull MessageCodec getCodec() { return QualitySelectorHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `QualitySelectorHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { + /**Sets up an instance of `QualitySelectorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3399,16 +3141,13 @@ static void setup( ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List videoQualityDataListArg = - (List) args.get(1); + List videoQualityDataListArg = (List) args.get(1); Number fallbackStrategyIdArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - videoQualityDataListArg, - (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), videoQualityDataListArg, (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3421,24 +3160,19 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number cameraInfoIdArg = (Number) args.get(0); - VideoQuality qualityArg = - args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; try { - ResolutionInfo output = - api.getResolution( - (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), - qualityArg); + ResolutionInfo output = api.getResolution((cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), qualityArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3453,21 +3187,14 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FallbackStrategyHostApi { - void create( - @NonNull Long identifier, - @NonNull VideoQuality quality, - @NonNull VideoResolutionFallbackRule fallbackRule); + void create(@NonNull Long identifier, @NonNull VideoQuality quality, @NonNull VideoResolutionFallbackRule fallbackRule); /** The codec used by FallbackStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `FallbackStrategyHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { + /**Sets up an instance of `FallbackStrategyHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3478,19 +3205,13 @@ static void setup( ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - VideoQuality qualityArg = - args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; - VideoResolutionFallbackRule fallbackRuleArg = - args.get(2) == null - ? null - : VideoResolutionFallbackRule.values()[(int) args.get(2)]; + VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoResolutionFallbackRule fallbackRuleArg = args.get(2) == null ? null : VideoResolutionFallbackRule.values()[(int) args.get(2)]; try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - qualityArg, - fallbackRuleArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), qualityArg, fallbackRuleArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3505,32 +3226,22 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraControlHostApi { - void enableTorch( - @NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); + void enableTorch(@NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); - void setZoomRatio( - @NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); + void setZoomRatio(@NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); - void startFocusAndMetering( - @NonNull Long identifier, - @NonNull Long focusMeteringActionId, - @NonNull Result result); + void startFocusAndMetering(@NonNull Long identifier, @NonNull Long focusMeteringActionId, @NonNull Result result); void cancelFocusAndMetering(@NonNull Long identifier, @NonNull Result result); - void setExposureCompensationIndex( - @NonNull Long identifier, @NonNull Long index, @NonNull Result result); + void setExposureCompensationIndex(@NonNull Long identifier, @NonNull Long index, @NonNull Result result); /** The codec used by CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `CameraControlHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { + /**Sets up an instance of `CameraControlHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3555,10 +3266,7 @@ public void error(Throwable error) { } }; - api.enableTorch( - (identifierArg == null) ? null : identifierArg.longValue(), - torchArg, - resultCallback); + api.enableTorch((identifierArg == null) ? null : identifierArg.longValue(), torchArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3567,9 +3275,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3590,10 +3296,7 @@ public void error(Throwable error) { } }; - api.setZoomRatio( - (identifierArg == null) ? null : identifierArg.longValue(), - ratioArg, - resultCallback); + api.setZoomRatio((identifierArg == null) ? null : identifierArg.longValue(), ratioArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3602,9 +3305,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3625,12 +3326,7 @@ public void error(Throwable error) { } }; - api.startFocusAndMetering( - (identifierArg == null) ? null : identifierArg.longValue(), - (focusMeteringActionIdArg == null) - ? null - : focusMeteringActionIdArg.longValue(), - resultCallback); + api.startFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), (focusMeteringActionIdArg == null) ? null : focusMeteringActionIdArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3639,9 +3335,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3661,8 +3355,7 @@ public void error(Throwable error) { } }; - api.cancelFocusAndMetering( - (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.cancelFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3671,9 +3364,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3694,10 +3385,7 @@ public void error(Throwable error) { } }; - api.setExposureCompensationIndex( - (identifierArg == null) ? null : identifierArg.longValue(), - (indexArg == null) ? null : indexArg.longValue(), - resultCallback); + api.setExposureCompensationIndex((identifierArg == null) ? null : identifierArg.longValue(), (indexArg == null) ? null : indexArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3713,7 +3401,7 @@ public CameraControlFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3722,7 +3410,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3734,8 +3421,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { } private static class FocusMeteringActionHostApiCodec extends StandardMessageCodec { - public static final FocusMeteringActionHostApiCodec INSTANCE = - new FocusMeteringActionHostApiCodec(); + public static final FocusMeteringActionHostApiCodec INSTANCE = new FocusMeteringActionHostApiCodec(); private FocusMeteringActionHostApiCodec() {} @@ -3769,32 +3455,24 @@ public interface FocusMeteringActionHostApi { static @NonNull MessageCodec getCodec() { return FocusMeteringActionHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { + /**Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FocusMeteringActionHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FocusMeteringActionHostApi.create", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List meteringPointInfosArg = - (List) args.get(1); + List meteringPointInfosArg = (List) args.get(1); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - meteringPointInfosArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3809,25 +3487,19 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringResultHostApi { - @NonNull + @NonNull Boolean isFocusSuccessful(@NonNull Long identifier); /** The codec used by FocusMeteringResultHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { + /**Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3835,11 +3507,10 @@ static void setup( ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Boolean output = - api.isFocusSuccessful( - (identifierArg == null) ? null : identifierArg.longValue()); + Boolean output = api.isFocusSuccessful((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3859,7 +3530,7 @@ public FocusMeteringResultFlutterApi(@NonNull BinaryMessenger argBinaryMessenger this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3868,13 +3539,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -3883,22 +3551,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MeteringPointHostApi { - void create( - @NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); + void create(@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); - @NonNull + @NonNull Double getDefaultPointSize(); /** The codec used by MeteringPointHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `MeteringPointHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { + /**Sets up an instance of `MeteringPointHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3913,36 +3576,10 @@ static void setup( Double yArg = (Double) args.get(2); Double sizeArg = (Double) args.get(3); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - xArg, - yArg, - sizeArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg); wrapped.add(0, null); - } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; } - reply.reply(wrapped); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", - getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - try { - Double output = api.getDefaultPointSize(); - wrapped.add(0, output); - } catch (Throwable exception) { + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3952,111 +3589,19 @@ static void setup( channel.setMessageHandler(null); } } - } - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ - public interface DisplayOrientedMeteringPointFactoryHostApi { - - void create( - @NonNull Long identifier, - @NonNull Long cameraInfoId, - @NonNull Long width, - @NonNull Long height); - - @NonNull - Long createPoint(@NonNull Long x, @NonNull Long y, @Nullable Long size); - - @NonNull - Long getDefaultPointSize(); - - /** The codec used by DisplayOrientedMeteringPointFactoryHostApi. */ - static @NonNull MessageCodec getCodec() { - return new StandardMessageCodec(); - } - /** - * Sets up an instance of `DisplayOrientedMeteringPointFactoryHostApi` to handle messages - * through the `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, - @Nullable DisplayOrientedMeteringPointFactoryHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - Number identifierArg = (Number) args.get(0); - Number cameraInfoIdArg = (Number) args.get(1); - Number widthArg = (Number) args.get(2); - Number heightArg = (Number) args.get(3); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), - (widthArg == null) ? null : widthArg.longValue(), - (heightArg == null) ? null : heightArg.longValue()); - wrapped.add(0, null); - } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; - } - reply.reply(wrapped); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.createPoint", - getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - Number xArg = (Number) args.get(0); - Number yArg = (Number) args.get(1); - Number sizeArg = (Number) args.get(2); - try { - Long output = - api.createPoint( - (xArg == null) ? null : xArg.longValue(), - (yArg == null) ? null : yArg.longValue(), - (sizeArg == null) ? null : sizeArg.longValue()); + Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; } - reply.reply(wrapped); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.getDefaultPointSize", - getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - try { - Long output = api.getDefaultPointSize(); - wrapped.add(0, output); - } catch (Throwable exception) { + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 62959043d5f..53e135498bf 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -187,6 +187,11 @@ class AndroidCameraCameraX extends CameraPlatform { /// auto-exposure. FocusMeteringAction? currentFocusMeteringAction; + /// Error code indicating that exposure compensation is not supported by + /// CameraX for the device. + static const String exposureCompensationNotSupported = + 'exposureCompensationNotSupported'; + /// Returns list of all available cameras and their descriptions. @override Future> availableCameras() async { @@ -470,10 +475,12 @@ class AndroidCameraCameraX extends CameraPlatform { Future getExposureOffsetStepSize(int cameraId) async { final ExposureState exposureState = await cameraInfo!.getExposureState(); final double exposureOffsetStepSize = - (await cameraInfo!.getExposureState()).exposureCompensationStep; + exposureState.exposureCompensationStep; if (exposureOffsetStepSize == 0) { - throw CameraException( - 'TODO(camsim99)', 'Exposure compensation not supported'); + // CameraX returns a step size of 0 if exposure compensation is not + // supported for the device. + throw CameraException(exposureCompensationNotSupported, + 'Exposure compensation not supported for the device.'); } return exposureOffsetStepSize; } @@ -491,7 +498,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// Returns the (rounded) offset value that was set. @override Future setExposureOffset(int cameraId, double offset) async { - // TODO(camsim99): Cache these values if possible in an attempt to improve performance. + // TODO(camsim99): cache camera + related values if possible. final double minOffset = await getMinExposureOffset(cameraId); final double maxOffset = await getMaxExposureOffset(cameraId); @@ -512,7 +519,6 @@ class AndroidCameraCameraX extends CameraPlatform { await cameraControl .setExposureCompensationIndex(roundedExposureCompensationIndex); - return roundedExposureCompensationIndex * exposureOffsetStepSize; } diff --git a/packages/camera/camera_android_camerax/lib/src/camera_control.dart b/packages/camera/camera_android_camerax/lib/src/camera_control.dart index d21e737362f..808fcf44652 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -141,8 +141,13 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { instanceManager.getIdentifier(instance)!; final int actionIdentifier = instanceManager.getIdentifier(action)!; try { - final int focusMeteringResultId = await startFocusAndMetering( + final int? focusMeteringResultId = await startFocusAndMetering( cameraControlIdentifier, actionIdentifier); + if (focusMeteringResultId == null) { + SystemServices.cameraErrorStreamController.add( + 'Starting focus and metering was canceled due to the camera being closed or a new request being submitted.'); + return Future.value(); + } return instanceManager.getInstanceWithWeakReference( focusMeteringResultId); } on PlatformException catch (e) { @@ -166,8 +171,16 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { CameraControl instance, int index) async { final int identifier = instanceManager.getIdentifier(instance)!; try { - return setExposureCompensationIndex(identifier, index); + final int? exposureCompensationIndex = + await setExposureCompensationIndex(identifier, index); + if (exposureCompensationIndex == null) { + SystemServices.cameraErrorStreamController.add( + 'Setting exposure compensation index was canceled due to the camera being closed or a new request being submitted.'); + return Future.value(); + } + return exposureCompensationIndex; } on PlatformException catch (e) { + // TODO(camsim99): perhaps throw cameraexception here. SystemServices.cameraErrorStreamController.add(e.message ?? 'Setting the camera exposure compensation index failed.'); return Future.value(); diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index e57dc8222ac..d8b72ceb837 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -210,7 +210,7 @@ class VideoQualityData { } } -/// Convenience class for building [FocusMeteringAction] with multiple metering +/// Convenience class for building [FocusMeteringAction]s with multiple metering /// points. class MeteringPointInfo { MeteringPointInfo({ @@ -218,11 +218,12 @@ class MeteringPointInfo { this.meteringMode, }); - /// Instance manager ID corresponding to [MeteringPoint] that relates to this - /// info. + /// InstanceManager ID for a [MeteringPoint]. int meteringPointId; - /// Metering mode represented by one of the [FocusMeteringAction] constants. + /// The metering mode of the [MeteringPoint] whose ID is [meteringPointId]. + /// + /// Metering mode should be one of the [FocusMeteringAction] constants. int? meteringMode; Object encode() { @@ -258,7 +259,8 @@ class InstanceManagerHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -314,8 +316,7 @@ abstract class JavaObjectFlutterApi { void dispose(int identifier); - static void setup(JavaObjectFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(JavaObjectFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectFlutterApi.dispose', codec, @@ -325,7 +326,7 @@ abstract class JavaObjectFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -462,8 +463,7 @@ abstract class CameraInfoFlutterApi { void create(int identifier); - static void setup(CameraInfoFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraInfoFlutterApi.create', codec, @@ -473,7 +473,7 @@ abstract class CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -500,8 +500,8 @@ class CameraSelectorHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_lensFacing]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_lensFacing]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -518,13 +518,12 @@ class CameraSelectorHostApi { } } - Future> filter( - int arg_identifier, List arg_cameraInfoIds) async { + Future> filter(int arg_identifier, List arg_cameraInfoIds) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_cameraInfoIds]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_cameraInfoIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -552,8 +551,7 @@ abstract class CameraSelectorFlutterApi { void create(int identifier, int? lensFacing); - static void setup(CameraSelectorFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraSelectorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorFlutterApi.create', codec, @@ -563,7 +561,7 @@ abstract class CameraSelectorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -591,7 +589,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -615,8 +614,7 @@ class ProcessCameraProviderHostApi { Future> getAvailableCameraInfos(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -641,17 +639,12 @@ class ProcessCameraProviderHostApi { } } - Future bindToLifecycle(int arg_identifier, - int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { + Future bindToLifecycle(int arg_identifier, int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_cameraSelectorIdentifier, - arg_useCaseIds - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_cameraSelectorIdentifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -678,8 +671,7 @@ class ProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_useCaseIdentifier]) - as List?; + await channel.send([arg_identifier, arg_useCaseIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -705,8 +697,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_useCaseIds]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -751,8 +743,7 @@ abstract class ProcessCameraProviderFlutterApi { void create(int identifier); - static void setup(ProcessCameraProviderFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ProcessCameraProviderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create', codec, @@ -762,7 +753,7 @@ abstract class ProcessCameraProviderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -855,7 +846,7 @@ abstract class CameraFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -883,7 +874,7 @@ class _SystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -901,11 +892,9 @@ class SystemServicesHostApi { static const MessageCodec codec = _SystemServicesHostApiCodec(); - Future requestCameraPermissions( - bool arg_enableAudio) async { + Future requestCameraPermissions(bool arg_enableAudio) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', - codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_enableAudio]) as List?; @@ -958,8 +947,7 @@ abstract class SystemServicesFlutterApi { void onCameraError(String errorDescription); - static void setup(SystemServicesFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(SystemServicesFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError', codec, @@ -969,7 +957,7 @@ abstract class SystemServicesFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); final List args = (message as List?)!; final String? arg_errorDescription = (args[0] as String?); assert(arg_errorDescription != null, @@ -992,15 +980,12 @@ class DeviceOrientationManagerHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future startListeningForDeviceOrientationChange( - bool arg_isFrontFacing, int arg_sensorOrientation) async { + Future startListeningForDeviceOrientationChange(bool arg_isFrontFacing, int arg_sensorOrientation) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_isFrontFacing, arg_sensorOrientation]) - as List?; + await channel.send([arg_isFrontFacing, arg_sensorOrientation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1019,10 +1004,10 @@ class DeviceOrientationManagerHostApi { Future stopListeningForDeviceOrientationChange() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1041,10 +1026,10 @@ class DeviceOrientationManagerHostApi { Future getDefaultDisplayRotation() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1072,19 +1057,17 @@ abstract class DeviceOrientationManagerFlutterApi { void onDeviceOrientationChanged(String orientation); - static void setup(DeviceOrientationManagerFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(DeviceOrientationManagerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); final List args = (message as List?)!; final String? arg_orientation = (args[0] as String?); assert(arg_orientation != null, @@ -1112,7 +1095,7 @@ class _PreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1130,14 +1113,12 @@ class PreviewHostApi { static const MessageCodec codec = _PreviewHostApiCodec(); - Future create(int arg_identifier, int? arg_rotation, - int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_rotation, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_identifier, arg_rotation, arg_resolutionSelectorId]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation, arg_resolutionSelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1185,7 +1166,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1233,8 +1215,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1320,8 +1302,8 @@ class VideoCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1344,8 +1326,7 @@ abstract class VideoCaptureFlutterApi { void create(int identifier); - static void setup(VideoCaptureFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(VideoCaptureFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureFlutterApi.create', codec, @@ -1355,7 +1336,7 @@ abstract class VideoCaptureFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1378,17 +1359,12 @@ class RecorderHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_aspectRatio, - int? arg_bitRate, int? arg_qualitySelectorId) async { + Future create(int arg_identifier, int? arg_aspectRatio, int? arg_bitRate, int? arg_qualitySelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_aspectRatio, - arg_bitRate, - arg_qualitySelectorId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1434,8 +1410,7 @@ class RecorderHostApi { Future getTargetVideoEncodingBitRate(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', - codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -1464,8 +1439,8 @@ class RecorderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_path]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_path]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1493,8 +1468,7 @@ abstract class RecorderFlutterApi { void create(int identifier, int? aspectRatio, int? bitRate); - static void setup(RecorderFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(RecorderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderFlutterApi.create', codec, @@ -1504,7 +1478,7 @@ abstract class RecorderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1562,8 +1536,7 @@ abstract class PendingRecordingFlutterApi { void create(int identifier); - static void setup(PendingRecordingFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(PendingRecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingFlutterApi.create', codec, @@ -1573,7 +1546,7 @@ abstract class PendingRecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1690,8 +1663,7 @@ abstract class RecordingFlutterApi { void create(int identifier); - static void setup(RecordingFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(RecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingFlutterApi.create', codec, @@ -1701,7 +1673,7 @@ abstract class RecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1724,17 +1696,12 @@ class ImageCaptureHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, - int? arg_flashMode, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, int? arg_flashMode, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_targetRotation, - arg_flashMode, - arg_resolutionSelectorId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1755,8 +1722,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_flashMode]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_flashMode]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1804,8 +1771,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1838,7 +1805,7 @@ class _ResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1856,14 +1823,12 @@ class ResolutionStrategyHostApi { static const MessageCodec codec = _ResolutionStrategyHostApiCodec(); - Future create(int arg_identifier, ResolutionInfo? arg_boundSize, - int? arg_fallbackRule) async { + Future create(int arg_identifier, ResolutionInfo? arg_boundSize, int? arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_boundSize, arg_fallbackRule]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_boundSize, arg_fallbackRule]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1891,16 +1856,12 @@ class ResolutionSelectorHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, - int? arg_aspectRatioStrategyIdentifier) async { + Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, int? arg_aspectRatioStrategyIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_resolutionStrategyIdentifier, - arg_aspectRatioStrategyIdentifier - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_resolutionStrategyIdentifier, arg_aspectRatioStrategyIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1928,16 +1889,12 @@ class AspectRatioStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_preferredAspectRatio, - int arg_fallbackRule) async { + Future create(int arg_identifier, int arg_preferredAspectRatio, int arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_preferredAspectRatio, - arg_fallbackRule - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_preferredAspectRatio, arg_fallbackRule]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1970,7 +1927,7 @@ class _CameraStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraStateTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1983,8 +1940,7 @@ abstract class CameraStateFlutterApi { void create(int identifier, CameraStateTypeData type, int? errorIdentifier); - static void setup(CameraStateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateFlutterApi.create', codec, @@ -1994,13 +1950,12 @@ abstract class CameraStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null int.'); - final CameraStateTypeData? arg_type = - (args[1] as CameraStateTypeData?); + final CameraStateTypeData? arg_type = (args[1] as CameraStateTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null CameraStateTypeData.'); final int? arg_errorIdentifier = (args[2] as int?); @@ -2027,7 +1982,7 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ExposureCompensationRange.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2038,13 +1993,9 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { abstract class ExposureStateFlutterApi { static const MessageCodec codec = _ExposureStateFlutterApiCodec(); - void create( - int identifier, - ExposureCompensationRange exposureCompensationRange, - double exposureCompensationStep); + void create(int identifier, ExposureCompensationRange exposureCompensationRange, double exposureCompensationStep); - static void setup(ExposureStateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ExposureStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ExposureStateFlutterApi.create', codec, @@ -2054,20 +2005,18 @@ abstract class ExposureStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null int.'); - final ExposureCompensationRange? arg_exposureCompensationRange = - (args[1] as ExposureCompensationRange?); + final ExposureCompensationRange? arg_exposureCompensationRange = (args[1] as ExposureCompensationRange?); assert(arg_exposureCompensationRange != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null ExposureCompensationRange.'); final double? arg_exposureCompensationStep = (args[2] as double?); assert(arg_exposureCompensationStep != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null double.'); - api.create(arg_identifier!, arg_exposureCompensationRange!, - arg_exposureCompensationStep!); + api.create(arg_identifier!, arg_exposureCompensationRange!, arg_exposureCompensationStep!); return; }); } @@ -2080,8 +2029,7 @@ abstract class ZoomStateFlutterApi { void create(int identifier, double minZoomRatio, double maxZoomRatio); - static void setup(ZoomStateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ZoomStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ZoomStateFlutterApi.create', codec, @@ -2091,7 +2039,7 @@ abstract class ZoomStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2120,16 +2068,12 @@ class ImageAnalysisHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, - int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_targetRotation, - arg_resolutionSelectorId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_targetRotation, arg_resolutionSelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2146,14 +2090,12 @@ class ImageAnalysisHostApi { } } - Future setAnalyzer( - int arg_identifier, int arg_analyzerIdentifier) async { + Future setAnalyzer(int arg_identifier, int arg_analyzerIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_analyzerIdentifier]) - as List?; + await channel.send([arg_identifier, arg_analyzerIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2196,8 +2138,8 @@ class ImageAnalysisHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2286,8 +2228,7 @@ abstract class ObserverFlutterApi { void onChanged(int identifier, int valueIdentifier); - static void setup(ObserverFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ObserverFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverFlutterApi.onChanged', codec, @@ -2297,7 +2238,7 @@ abstract class ObserverFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); + 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2318,8 +2259,7 @@ abstract class CameraStateErrorFlutterApi { void create(int identifier, int code); - static void setup(CameraStateErrorFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateErrorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateErrorFlutterApi.create', codec, @@ -2329,7 +2269,7 @@ abstract class CameraStateErrorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2360,7 +2300,7 @@ class _LiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2383,8 +2323,7 @@ class LiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_observerIdentifier]) - as List?; + await channel.send([arg_identifier, arg_observerIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2423,13 +2362,12 @@ class LiveDataHostApi { } } - Future getValue( - int arg_identifier, LiveDataSupportedTypeData arg_type) async { + Future getValue(int arg_identifier, LiveDataSupportedTypeData arg_type) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_type]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_type]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2462,7 +2400,7 @@ class _LiveDataFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2475,8 +2413,7 @@ abstract class LiveDataFlutterApi { void create(int identifier, LiveDataSupportedTypeData type); - static void setup(LiveDataFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(LiveDataFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataFlutterApi.create', codec, @@ -2486,13 +2423,12 @@ abstract class LiveDataFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = - (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null LiveDataSupportedTypeData.'); api.create(arg_identifier!, arg_type!); @@ -2510,8 +2446,7 @@ abstract class AnalyzerFlutterApi { void analyze(int identifier, int imageProxyIdentifier); - static void setup(AnalyzerFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(AnalyzerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerFlutterApi.create', codec, @@ -2521,7 +2456,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2540,7 +2475,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2621,8 +2556,7 @@ abstract class ImageProxyFlutterApi { void create(int identifier, int format, int height, int width); - static void setup(ImageProxyFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ImageProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyFlutterApi.create', codec, @@ -2632,7 +2566,7 @@ abstract class ImageProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2659,8 +2593,7 @@ abstract class PlaneProxyFlutterApi { void create(int identifier, Uint8List buffer, int pixelStride, int rowStride); - static void setup(PlaneProxyFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(PlaneProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PlaneProxyFlutterApi.create', codec, @@ -2670,7 +2603,7 @@ abstract class PlaneProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2684,8 +2617,7 @@ abstract class PlaneProxyFlutterApi { final int? arg_rowStride = (args[3] as int?); assert(arg_rowStride != null, 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null, expected non-null int.'); - api.create( - arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); + api.create(arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); return; }); } @@ -2711,9 +2643,9 @@ class _QualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2731,18 +2663,12 @@ class QualitySelectorHostApi { static const MessageCodec codec = _QualitySelectorHostApiCodec(); - Future create( - int arg_identifier, - List arg_videoQualityDataList, - int? arg_fallbackStrategyId) async { + Future create(int arg_identifier, List arg_videoQualityDataList, int? arg_fallbackStrategyId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_videoQualityDataList, - arg_fallbackStrategyId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_videoQualityDataList, arg_fallbackStrategyId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2759,13 +2685,12 @@ class QualitySelectorHostApi { } } - Future getResolution( - int arg_cameraInfoId, VideoQuality arg_quality) async { + Future getResolution(int arg_cameraInfoId, VideoQuality arg_quality) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_cameraInfoId, arg_quality.index]) as List?; + final List? replyList = + await channel.send([arg_cameraInfoId, arg_quality.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2798,16 +2723,12 @@ class FallbackStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, VideoQuality arg_quality, - VideoResolutionFallbackRule arg_fallbackRule) async { + Future create(int arg_identifier, VideoQuality arg_quality, VideoResolutionFallbackRule arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_quality.index, - arg_fallbackRule.index - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_quality.index, arg_fallbackRule.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2839,8 +2760,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_torch]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_torch]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2861,8 +2782,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_ratio]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_ratio]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2879,14 +2800,12 @@ class CameraControlHostApi { } } - Future startFocusAndMetering( - int arg_identifier, int arg_focusMeteringActionId) async { + Future startFocusAndMetering(int arg_identifier, int arg_focusMeteringActionId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_focusMeteringActionId]) - as List?; + await channel.send([arg_identifier, arg_focusMeteringActionId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2898,13 +2817,8 @@ class CameraControlHostApi { message: replyList[1] as String?, details: replyList[2], ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (replyList[0] as int?)!; + return (replyList[0] as int?); } } @@ -2930,14 +2844,12 @@ class CameraControlHostApi { } } - Future setExposureCompensationIndex( - int arg_identifier, int arg_index) async { + Future setExposureCompensationIndex(int arg_identifier, int arg_index) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_index]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2949,13 +2861,8 @@ class CameraControlHostApi { message: replyList[1] as String?, details: replyList[2], ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (replyList[0] as int?)!; + return (replyList[0] as int?); } } } @@ -2965,8 +2872,7 @@ abstract class CameraControlFlutterApi { void create(int identifier); - static void setup(CameraControlFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraControlFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlFlutterApi.create', codec, @@ -2976,7 +2882,7 @@ abstract class CameraControlFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3004,7 +2910,7 @@ class _FocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3022,14 +2928,12 @@ class FocusMeteringActionHostApi { static const MessageCodec codec = _FocusMeteringActionHostApiCodec(); - Future create(int arg_identifier, - List arg_meteringPointInfos) async { + Future create(int arg_identifier, List arg_meteringPointInfos) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_meteringPointInfos]) - as List?; + await channel.send([arg_identifier, arg_meteringPointInfos]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3059,8 +2963,7 @@ class FocusMeteringResultHostApi { Future isFocusSuccessful(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', - codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -3091,8 +2994,7 @@ abstract class FocusMeteringResultFlutterApi { void create(int identifier); - static void setup(FocusMeteringResultFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(FocusMeteringResultFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringResultFlutterApi.create', codec, @@ -3102,7 +3004,7 @@ abstract class FocusMeteringResultFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3125,14 +3027,12 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create( - int arg_identifier, double arg_x, double arg_y, double? arg_size) async { + Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_x, arg_y, arg_size]) - as List?; + await channel.send([arg_identifier, arg_x, arg_y, arg_size]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3153,71 +3053,8 @@ class MeteringPointHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as double?)!; - } - } -} - -class DisplayOrientedMeteringPointFactoryHostApi { - /// Constructor for [DisplayOrientedMeteringPointFactoryHostApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default - /// BinaryMessenger will be used which routes to the host platform. - DisplayOrientedMeteringPointFactoryHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future create(int arg_identifier, int arg_cameraInfoId, int arg_width, - int arg_height) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_identifier, arg_cameraInfoId, arg_width, arg_height]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else { - return; - } - } - - Future createPoint(int arg_x, int arg_y, int? arg_size) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.createPoint', - codec, - binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_x, arg_y, arg_size]) as List?; + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3235,34 +3072,7 @@ class DisplayOrientedMeteringPointFactoryHostApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as int?)!; - } - } - - Future getDefaultPointSize() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.getDefaultPointSize', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (replyList[0] as int?)!; + return (replyList[0] as double?)!; } } } diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index 7fbc7e1abaf..120d0f13401 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -463,13 +463,13 @@ abstract class CameraControlHostApi { void setZoomRatio(int identifier, double ratio); @async - int startFocusAndMetering(int identifier, int focusMeteringActionId); + int? startFocusAndMetering(int identifier, int focusMeteringActionId); @async void cancelFocusAndMetering(int identifier); @async - int setExposureCompensationIndex(int identifier, int index); + int? setExposureCompensationIndex(int identifier, int index); } @FlutterApi() diff --git a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index abb6fad2987..2694c8a1548 100644 --- a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart @@ -14,8 +14,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; abstract class TestInstanceManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); /// Clear the native `InstanceManager`. @@ -23,19 +22,15 @@ abstract class TestInstanceManagerHostApi { /// This is typically only used after a hot restart. void clear(); - static void setup(TestInstanceManagerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestInstanceManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message api.clear(); return []; @@ -46,27 +41,22 @@ abstract class TestInstanceManagerHostApi { } abstract class TestJavaObjectHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void dispose(int identifier); - static void setup(TestJavaObjectHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestJavaObjectHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -80,8 +70,7 @@ abstract class TestJavaObjectHostApi { } abstract class TestCameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getSensorRotationDegrees(int identifier); @@ -92,22 +81,17 @@ abstract class TestCameraInfoHostApi { int getZoomState(int identifier); - static void setup(TestCameraInfoHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', - codec, + 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -122,14 +106,11 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getCameraState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -144,14 +125,11 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getExposureState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -166,14 +144,11 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getZoomState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -187,29 +162,24 @@ abstract class TestCameraInfoHostApi { } abstract class TestCameraSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? lensFacing); List filter(int identifier, List cameraInfoIds); - static void setup(TestCameraSelectorHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -225,24 +195,19 @@ abstract class TestCameraSelectorHostApi { 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null int.'); - final List? arg_cameraInfoIds = - (args[1] as List?)?.cast(); + final List? arg_cameraInfoIds = (args[1] as List?)?.cast(); assert(arg_cameraInfoIds != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List.'); - final List output = - api.filter(arg_identifier!, arg_cameraInfoIds!); + final List output = api.filter(arg_identifier!, arg_cameraInfoIds!); return [output]; }); } @@ -251,16 +216,14 @@ abstract class TestCameraSelectorHostApi { } abstract class TestProcessCameraProviderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future getInstance(); List getAvailableCameraInfos(int identifier); - int bindToLifecycle( - int identifier, int cameraSelectorIdentifier, List useCaseIds); + int bindToLifecycle(int identifier, int cameraSelectorIdentifier, List useCaseIds); bool isBound(int identifier, int useCaseIdentifier); @@ -268,19 +231,15 @@ abstract class TestProcessCameraProviderHostApi { void unbindAll(int identifier); - static void setup(TestProcessCameraProviderHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestProcessCameraProviderHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final int output = await api.getInstance(); return [output]; @@ -289,42 +248,33 @@ abstract class TestProcessCameraProviderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.'); - final List output = - api.getAvailableCameraInfos(arg_identifier!); + final List output = api.getAvailableCameraInfos(arg_identifier!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -332,12 +282,10 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_cameraSelectorIdentifier = (args[1] as int?); assert(arg_cameraSelectorIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null int.'); - final List? arg_useCaseIds = - (args[2] as List?)?.cast(); + final List? arg_useCaseIds = (args[2] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List.'); - final int output = api.bindToLifecycle( - arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); + final int output = api.bindToLifecycle(arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); return [output]; }); } @@ -347,14 +295,11 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -362,8 +307,7 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_useCaseIdentifier = (args[1] as int?); assert(arg_useCaseIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.'); - final bool output = - api.isBound(arg_identifier!, arg_useCaseIdentifier!); + final bool output = api.isBound(arg_identifier!, arg_useCaseIdentifier!); return [output]; }); } @@ -373,20 +317,16 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null int.'); - final List? arg_useCaseIds = - (args[1] as List?)?.cast(); + final List? arg_useCaseIds = (args[1] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List.'); api.unbind(arg_identifier!, arg_useCaseIds!); @@ -399,14 +339,11 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -420,29 +357,24 @@ abstract class TestProcessCameraProviderHostApi { } abstract class TestCameraHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getCameraInfo(int identifier); int getCameraControl(int identifier); - static void setup(TestCameraHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraHostApi.getCameraInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -457,14 +389,11 @@ abstract class TestCameraHostApi { 'dev.flutter.pigeon.CameraHostApi.getCameraControl', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -492,7 +421,7 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -501,37 +430,29 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { } abstract class TestSystemServicesHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestSystemServicesHostApiCodec(); - Future requestCameraPermissions( - bool enableAudio); + Future requestCameraPermissions(bool enableAudio); String getTempFilePath(String prefix, String suffix); - static void setup(TestSystemServicesHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestSystemServicesHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', - codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); final List args = (message as List?)!; final bool? arg_enableAudio = (args[0] as bool?); assert(arg_enableAudio != null, 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.'); - final CameraPermissionsErrorData? output = - await api.requestCameraPermissions(arg_enableAudio!); + final CameraPermissionsErrorData? output = await api.requestCameraPermissions(arg_enableAudio!); return [output]; }); } @@ -541,14 +462,11 @@ abstract class TestSystemServicesHostApi { 'dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); final List args = (message as List?)!; final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, @@ -565,33 +483,26 @@ abstract class TestSystemServicesHostApi { } abstract class TestDeviceOrientationManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void startListeningForDeviceOrientationChange( - bool isFrontFacing, int sensorOrientation); + void startListeningForDeviceOrientationChange(bool isFrontFacing, int sensorOrientation); void stopListeningForDeviceOrientationChange(); int getDefaultDisplayRotation(); - static void setup(TestDeviceOrientationManagerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestDeviceOrientationManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); final List args = (message as List?)!; final bool? arg_isFrontFacing = (args[0] as bool?); assert(arg_isFrontFacing != null, @@ -599,24 +510,19 @@ abstract class TestDeviceOrientationManagerHostApi { final int? arg_sensorOrientation = (args[1] as int?); assert(arg_sensorOrientation != null, 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.'); - api.startListeningForDeviceOrientationChange( - arg_isFrontFacing!, arg_sensorOrientation!); + api.startListeningForDeviceOrientationChange(arg_isFrontFacing!, arg_sensorOrientation!); return []; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message api.stopListeningForDeviceOrientationChange(); return []; @@ -625,16 +531,12 @@ abstract class TestDeviceOrientationManagerHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final int output = api.getDefaultDisplayRotation(); return [output]; @@ -659,7 +561,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -668,8 +570,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { } abstract class TestPreviewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestPreviewHostApiCodec(); void create(int identifier, int? rotation, int? resolutionSelectorId); @@ -682,21 +583,17 @@ abstract class TestPreviewHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestPreviewHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestPreviewHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -713,14 +610,11 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -732,16 +626,12 @@ abstract class TestPreviewHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', - codec, + 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message api.releaseFlutterSurfaceTexture(); return []; @@ -753,14 +643,11 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -775,14 +662,11 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -799,8 +683,7 @@ abstract class TestPreviewHostApi { } abstract class TestVideoCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int withOutput(int videoOutputId); @@ -809,21 +692,17 @@ abstract class TestVideoCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestVideoCaptureHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestVideoCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.withOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); final List args = (message as List?)!; final int? arg_videoOutputId = (args[0] as int?); assert(arg_videoOutputId != null, @@ -838,14 +717,11 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.getOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -860,14 +736,11 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -884,12 +757,10 @@ abstract class TestVideoCaptureHostApi { } abstract class TestRecorderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create( - int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); + void create(int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); int getAspectRatio(int identifier); @@ -897,21 +768,17 @@ abstract class TestRecorderHostApi { int prepareRecording(int identifier, String path); - static void setup(TestRecorderHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecorderHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -919,8 +786,7 @@ abstract class TestRecorderHostApi { final int? arg_aspectRatio = (args[1] as int?); final int? arg_bitRate = (args[2] as int?); final int? arg_qualitySelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, - arg_qualitySelectorId); + api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId); return []; }); } @@ -930,14 +796,11 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.getAspectRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -949,18 +812,14 @@ abstract class TestRecorderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', - codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -975,14 +834,11 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -999,27 +855,22 @@ abstract class TestRecorderHostApi { } abstract class TestPendingRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int start(int identifier); - static void setup(TestPendingRecordingHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestPendingRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingHostApi.start', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1033,8 +884,7 @@ abstract class TestPendingRecordingHostApi { } abstract class TestRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void close(int identifier); @@ -1045,21 +895,17 @@ abstract class TestRecordingHostApi { void stop(int identifier); - static void setup(TestRecordingHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1074,14 +920,11 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.pause', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1096,14 +939,11 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.resume', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1118,14 +958,11 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.stop', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1139,12 +976,10 @@ abstract class TestRecordingHostApi { } abstract class TestImageCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? targetRotation, int? flashMode, - int? resolutionSelectorId); + void create(int identifier, int? targetRotation, int? flashMode, int? resolutionSelectorId); void setFlashMode(int identifier, int flashMode); @@ -1152,21 +987,17 @@ abstract class TestImageCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageCaptureHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1174,8 +1005,7 @@ abstract class TestImageCaptureHostApi { final int? arg_targetRotation = (args[1] as int?); final int? arg_flashMode = (args[2] as int?); final int? arg_resolutionSelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_flashMode, - arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId); return []; }); } @@ -1185,14 +1015,11 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1210,14 +1037,11 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1232,14 +1056,11 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1270,7 +1091,7 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1279,28 +1100,22 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestResolutionStrategyHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = _TestResolutionStrategyHostApiCodec(); void create(int identifier, ResolutionInfo? boundSize, int? fallbackRule); - static void setup(TestResolutionStrategyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1316,36 +1131,29 @@ abstract class TestResolutionStrategyHostApi { } abstract class TestResolutionSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? resolutionStrategyIdentifier, - int? aspectRatioStrategyIdentifier); + void create(int identifier, int? resolutionStrategyIdentifier, int? aspectRatioStrategyIdentifier); - static void setup(TestResolutionSelectorHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null, expected non-null int.'); final int? arg_resolutionStrategyIdentifier = (args[1] as int?); final int? arg_aspectRatioStrategyIdentifier = (args[2] as int?); - api.create(arg_identifier!, arg_resolutionStrategyIdentifier, - arg_aspectRatioStrategyIdentifier); + api.create(arg_identifier!, arg_resolutionStrategyIdentifier, arg_aspectRatioStrategyIdentifier); return []; }); } @@ -1354,27 +1162,22 @@ abstract class TestResolutionSelectorHostApi { } abstract class TestAspectRatioStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int preferredAspectRatio, int fallbackRule); - static void setup(TestAspectRatioStrategyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestAspectRatioStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1385,8 +1188,7 @@ abstract class TestAspectRatioStrategyHostApi { final int? arg_fallbackRule = (args[2] as int?); assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null, expected non-null int.'); - api.create( - arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); + api.create(arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); return []; }); } @@ -1395,8 +1197,7 @@ abstract class TestAspectRatioStrategyHostApi { } abstract class TestImageAnalysisHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? targetRotation, int? resolutionSelectorId); @@ -1407,29 +1208,24 @@ abstract class TestImageAnalysisHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageAnalysisHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageAnalysisHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null, expected non-null int.'); final int? arg_targetRotation = (args[1] as int?); final int? arg_resolutionSelectorId = (args[2] as int?); - api.create( - arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); return []; }); } @@ -1439,14 +1235,11 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1464,14 +1257,11 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1486,14 +1276,11 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1510,27 +1297,22 @@ abstract class TestImageAnalysisHostApi { } abstract class TestAnalyzerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestAnalyzerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestAnalyzerHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1544,27 +1326,22 @@ abstract class TestAnalyzerHostApi { } abstract class TestObserverHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestObserverHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestObserverHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1592,7 +1369,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1601,8 +1378,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { } abstract class TestLiveDataHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestLiveDataHostApiCodec(); void observe(int identifier, int observerIdentifier); @@ -1611,21 +1387,17 @@ abstract class TestLiveDataHostApi { int? getValue(int identifier, LiveDataSupportedTypeData type); - static void setup(TestLiveDataHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestLiveDataHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1643,14 +1415,11 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.removeObservers', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1665,20 +1434,16 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = - (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null LiveDataSupportedTypeData.'); final int? output = api.getValue(arg_identifier!, arg_type!); @@ -1690,29 +1455,24 @@ abstract class TestLiveDataHostApi { } abstract class TestImageProxyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); List getPlanes(int identifier); void close(int identifier); - static void setup(TestImageProxyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageProxyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyHostApi.getPlanes', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1727,14 +1487,11 @@ abstract class TestImageProxyHostApi { 'dev.flutter.pigeon.ImageProxyHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1765,9 +1522,9 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1776,41 +1533,33 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { } abstract class TestQualitySelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestQualitySelectorHostApiCodec(); - void create(int identifier, List videoQualityDataList, - int? fallbackStrategyId); + void create(int identifier, List videoQualityDataList, int? fallbackStrategyId); ResolutionInfo getResolution(int cameraInfoId, VideoQuality quality); - static void setup(TestQualitySelectorHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestQualitySelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null int.'); - final List? arg_videoQualityDataList = - (args[1] as List?)?.cast(); + final List? arg_videoQualityDataList = (args[1] as List?)?.cast(); assert(arg_videoQualityDataList != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null List.'); final int? arg_fallbackStrategyId = (args[2] as int?); - api.create(arg_identifier!, arg_videoQualityDataList!, - arg_fallbackStrategyId); + api.create(arg_identifier!, arg_videoQualityDataList!, arg_fallbackStrategyId); return []; }); } @@ -1820,24 +1569,19 @@ abstract class TestQualitySelectorHostApi { 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); final List args = (message as List?)!; final int? arg_cameraInfoId = (args[0] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null int.'); - final VideoQuality? arg_quality = - args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null VideoQuality.'); - final ResolutionInfo output = - api.getResolution(arg_cameraInfoId!, arg_quality!); + final ResolutionInfo output = api.getResolution(arg_cameraInfoId!, arg_quality!); return [output]; }); } @@ -1846,39 +1590,30 @@ abstract class TestQualitySelectorHostApi { } abstract class TestFallbackStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, VideoQuality quality, - VideoResolutionFallbackRule fallbackRule); + void create(int identifier, VideoQuality quality, VideoResolutionFallbackRule fallbackRule); - static void setup(TestFallbackStrategyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestFallbackStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null int.'); - final VideoQuality? arg_quality = - args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoQuality.'); - final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null - ? null - : VideoResolutionFallbackRule.values[args[2] as int]; + final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null ? null : VideoResolutionFallbackRule.values[args[2] as int]; assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoResolutionFallbackRule.'); api.create(arg_identifier!, arg_quality!, arg_fallbackRule!); @@ -1890,35 +1625,30 @@ abstract class TestFallbackStrategyHostApi { } abstract class TestCameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future enableTorch(int identifier, bool torch); Future setZoomRatio(int identifier, double ratio); - Future startFocusAndMetering(int identifier, int focusMeteringActionId); + Future startFocusAndMetering(int identifier, int focusMeteringActionId); Future cancelFocusAndMetering(int identifier); - Future setExposureCompensationIndex(int identifier, int index); + Future setExposureCompensationIndex(int identifier, int index); - static void setup(TestCameraControlHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1936,14 +1666,11 @@ abstract class TestCameraControlHostApi { 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1958,18 +1685,14 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1977,26 +1700,21 @@ abstract class TestCameraControlHostApi { final int? arg_focusMeteringActionId = (args[1] as int?); assert(arg_focusMeteringActionId != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null, expected non-null int.'); - final int output = await api.startFocusAndMetering( - arg_identifier!, arg_focusMeteringActionId!); + final int? output = await api.startFocusAndMetering(arg_identifier!, arg_focusMeteringActionId!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2008,18 +1726,14 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2027,8 +1741,7 @@ abstract class TestCameraControlHostApi { final int? arg_index = (args[1] as int?); assert(arg_index != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null, expected non-null int.'); - final int output = await api.setExposureCompensationIndex( - arg_identifier!, arg_index!); + final int? output = await api.setExposureCompensationIndex(arg_identifier!, arg_index!); return [output]; }); } @@ -2051,7 +1764,7 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2060,34 +1773,27 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { } abstract class TestFocusMeteringActionHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestFocusMeteringActionHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = _TestFocusMeteringActionHostApiCodec(); void create(int identifier, List meteringPointInfos); - static void setup(TestFocusMeteringActionHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringActionHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null int.'); - final List? arg_meteringPointInfos = - (args[1] as List?)?.cast(); + final List? arg_meteringPointInfos = (args[1] as List?)?.cast(); assert(arg_meteringPointInfos != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null List.'); api.create(arg_identifier!, arg_meteringPointInfos!); @@ -2099,28 +1805,22 @@ abstract class TestFocusMeteringActionHostApi { } abstract class TestFocusMeteringResultHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); bool isFocusSuccessful(int identifier); - static void setup(TestFocusMeteringResultHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringResultHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', - codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2134,29 +1834,24 @@ abstract class TestFocusMeteringResultHostApi { } abstract class TestMeteringPointHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, double x, double y, double? size); double getDefaultPointSize(); - static void setup(TestMeteringPointHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestMeteringPointHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2178,12 +1873,9 @@ abstract class TestMeteringPointHostApi { 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final double output = api.getDefaultPointSize(); return [output]; @@ -2192,97 +1884,3 @@ abstract class TestMeteringPointHostApi { } } } - -abstract class TestDisplayOrientedMeteringPointFactoryHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); - - void create(int identifier, int cameraInfoId, int width, int height); - - int createPoint(int x, int y, int? size); - - int getDefaultPointSize(); - - static void setup(TestDisplayOrientedMeteringPointFactoryHostApi? api, - {BinaryMessenger? binaryMessenger}) { - { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create', - codec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create was null.'); - final List args = (message as List?)!; - final int? arg_identifier = (args[0] as int?); - assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create was null, expected non-null int.'); - final int? arg_cameraInfoId = (args[1] as int?); - assert(arg_cameraInfoId != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create was null, expected non-null int.'); - final int? arg_width = (args[2] as int?); - assert(arg_width != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create was null, expected non-null int.'); - final int? arg_height = (args[3] as int?); - assert(arg_height != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.create was null, expected non-null int.'); - api.create( - arg_identifier!, arg_cameraInfoId!, arg_width!, arg_height!); - return []; - }); - } - } - { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.createPoint', - codec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.createPoint was null.'); - final List args = (message as List?)!; - final int? arg_x = (args[0] as int?); - assert(arg_x != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.createPoint was null, expected non-null int.'); - final int? arg_y = (args[1] as int?); - assert(arg_y != null, - 'Argument for dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.createPoint was null, expected non-null int.'); - final int? arg_size = (args[2] as int?); - final int output = api.createPoint(arg_x!, arg_y!, arg_size); - return [output]; - }); - } - } - { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DisplayOrientedMeteringPointFactoryHostApi.getDefaultPointSize', - codec, - binaryMessenger: binaryMessenger); - if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); - } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { - // ignore message - final int output = api.getDefaultPointSize(); - return [output]; - }); - } - } - } -} From ea5f15ff8b01c40b787b3624d1b3a2f01f21d537 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Feb 2024 12:42:54 -0800 Subject: [PATCH 05/23] Cleanup pt2 --- .../camerax/CameraAndroidCameraxPlugin.java | 9 +- .../camerax/CameraControlHostApiImpl.java | 6 + .../camerax/GeneratedCameraXLibrary.java | 1075 +++++++++++------ .../lib/src/android_camera_camerax.dart | 131 +- .../lib/src/camera_control.dart | 3 +- .../lib/src/camerax_library.g.dart | 404 ++++--- .../test/test_camerax_library.g.dart | 924 +++++++++----- 7 files changed, 1668 insertions(+), 884 deletions(-) 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 24fed292ec8..fdca88b4f3c 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 @@ -119,9 +119,12 @@ public void setUp( cameraControlHostApiImpl = new CameraControlHostApiImpl(binaryMessenger, instanceManager, context); GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl); - GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup(binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager)); - GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup(binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); - GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, new MeteringPointHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup( + binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup( + binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.MeteringPointHostApi.setup( + binaryMessenger, new MeteringPointHostApiImpl(instanceManager)); } @Override diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java index 0dfcdb6efb1..8f7794f898f 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java @@ -83,6 +83,12 @@ public void onSuccess(Void voidResult) { } public void onFailure(Throwable t) { + if (t instanceof CameraControl.OperationCanceledException) { + // Operation was canceled due to camera being closed or a new request was submitted, which + // is not actionable and should not block a new value from potentially being submitted. + result.success(null); + return; + } result.error(t); } }, 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 ef51890a187..b9143ae4b6c 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 @@ -18,9 +18,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -35,8 +33,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -55,7 +52,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -63,7 +60,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /** * The states the camera can be in. * - * See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. + *

See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. */ public enum CameraStateType { CLOSED(0), @@ -82,20 +79,19 @@ private CameraStateType(final int index) { /** * The types (T) properly wrapped to be used as a LiveData. * - * If you need to add another type to support a type S to use a LiveData in - * this plugin, ensure the following is done on the Dart side: + *

If you need to add another type to support a type S to use a LiveData in this plugin, + * ensure the following is done on the Dart side: * - * * In `../lib/src/live_data.dart`, add new cases for S in - * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of - * type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` - * to create the expected type of LiveData when requested. + *

* In `../lib/src/live_data.dart`, add new cases for S in + * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a + * LiveData instance and in `LiveDataFlutterApiImpl#create` to create the expected type of + * LiveData when requested. * - * On the native side, ensure the following is done: + *

On the native side, ensure the following is done: * - * * Update `LiveDataHostApiImpl#getValue` is updated to properly return - * identifiers for instances of type S. - * * Update `ObserverFlutterApiWrapper#onChanged` to properly handle receiving - * calls with instances of type S if a LiveData instance is observed. + *

* Update `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for + * instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle + * receiving calls with instances of type S if a LiveData instance is observed. */ public enum LiveDataSupportedType { CAMERA_STATE(0), @@ -109,12 +105,12 @@ private LiveDataSupportedType(final int index) { } /** - * Video quality constraints that will be used by a QualitySelector to choose - * an appropriate video resolution. + * 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. + *

These are pre-defined quality constants that are universally used for video. * - * See https://developer.android.com/reference/androidx/camera/video/Quality. + *

See https://developer.android.com/reference/androidx/camera/video/Quality. */ public enum VideoQuality { SD(0), @@ -134,7 +130,7 @@ private VideoQuality(final int index) { /** * Fallback rules for selecting video resolution. * - * See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. + *

See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. */ public enum VideoResolutionFallbackRule { HIGHER_QUALITY_OR_LOWER_THAN(0), @@ -215,9 +211,13 @@ ArrayList toList() { static @NonNull ResolutionInfo fromList(@NonNull ArrayList list) { ResolutionInfo pigeonResult = new ResolutionInfo(); Object width = list.get(0); - pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth( + (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = list.get(1); - pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight( + (height == null) + ? null + : ((height instanceof Integer) ? (Integer) height : (Long) height)); return pigeonResult; } } @@ -459,9 +459,19 @@ ArrayList toList() { static @NonNull ExposureCompensationRange fromList(@NonNull ArrayList list) { ExposureCompensationRange pigeonResult = new ExposureCompensationRange(); Object minCompensation = list.get(0); - pigeonResult.setMinCompensation((minCompensation == null) ? null : ((minCompensation instanceof Integer) ? (Integer) minCompensation : (Long) minCompensation)); + pigeonResult.setMinCompensation( + (minCompensation == null) + ? null + : ((minCompensation instanceof Integer) + ? (Integer) minCompensation + : (Long) minCompensation)); Object maxCompensation = list.get(1); - pigeonResult.setMaxCompensation((maxCompensation == null) ? null : ((maxCompensation instanceof Integer) ? (Integer) maxCompensation : (Long) maxCompensation)); + pigeonResult.setMaxCompensation( + (maxCompensation == null) + ? null + : ((maxCompensation instanceof Integer) + ? (Integer) maxCompensation + : (Long) maxCompensation)); return pigeonResult; } } @@ -469,7 +479,7 @@ ArrayList toList() { /** * Convenience class for sending lists of [Quality]s. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class VideoQualityData { private @NonNull VideoQuality quality; @@ -520,10 +530,9 @@ ArrayList toList() { } /** - * Convenience class for building [FocusMeteringAction]s with multiple metering - * points. + * Convenience class for building [FocusMeteringAction]s with multiple metering points. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class MeteringPointInfo { /** InstanceManager ID for a [MeteringPoint]. */ @@ -543,7 +552,7 @@ public void setMeteringPointId(@NonNull Long setterArg) { /** * The metering mode of the [MeteringPoint] whose ID is [meteringPointId]. * - * Metering mode should be one of the [FocusMeteringAction] constants. + *

Metering mode should be one of the [FocusMeteringAction] constants. */ private @Nullable Long meteringMode; @@ -593,9 +602,17 @@ ArrayList toList() { static @NonNull MeteringPointInfo fromList(@NonNull ArrayList list) { MeteringPointInfo pigeonResult = new MeteringPointInfo(); Object meteringPointId = list.get(0); - pigeonResult.setMeteringPointId((meteringPointId == null) ? null : ((meteringPointId instanceof Integer) ? (Integer) meteringPointId : (Long) meteringPointId)); + pigeonResult.setMeteringPointId( + (meteringPointId == null) + ? null + : ((meteringPointId instanceof Integer) + ? (Integer) meteringPointId + : (Long) meteringPointId)); Object meteringMode = list.get(1); - pigeonResult.setMeteringMode((meteringMode == null) ? null : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); + pigeonResult.setMeteringMode( + (meteringMode == null) + ? null + : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); return pigeonResult; } } @@ -611,7 +628,7 @@ public interface InstanceManagerHostApi { /** * Clear the native `InstanceManager`. * - * This is typically only used after a hot restart. + *

This is typically only used after a hot restart. */ void clear(); @@ -619,8 +636,12 @@ public interface InstanceManagerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `InstanceManagerHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { + /** + * Sets up an instance of `InstanceManagerHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -632,8 +653,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceMa try { api.clear(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -654,7 +674,9 @@ public interface JavaObjectHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObjectHostApi api) { { BasicMessageChannel channel = @@ -669,8 +691,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObject try { api.dispose((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -690,7 +711,7 @@ public JavaObjectFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -699,6 +720,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -711,28 +733,32 @@ public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraInfoHostApi { - @NonNull + @NonNull Long getSensorRotationDegrees(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraState(@NonNull Long identifier); - @NonNull + @NonNull Long getExposureState(@NonNull Long identifier); - @NonNull + @NonNull Long getZoomState(@NonNull Long identifier); /** The codec used by CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -740,10 +766,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getSensorRotationDegrees((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getSensorRotationDegrees( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -764,10 +791,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraState( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -780,7 +808,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -788,10 +818,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getExposureState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getExposureState( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -812,10 +843,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -835,7 +866,7 @@ public CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -844,6 +875,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -858,15 +890,19 @@ public interface CameraSelectorHostApi { void create(@NonNull Long identifier, @Nullable Long lensFacing); - @NonNull + @NonNull List filter(@NonNull Long identifier, @NonNull List cameraInfoIds); /** The codec used by CameraSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraSelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { + /** + * Sets up an instance of `CameraSelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -879,10 +915,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSele Number identifierArg = (Number) args.get(0); Number lensFacingArg = (Number) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (lensFacingArg == null) ? null : lensFacingArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (lensFacingArg == null) ? null : lensFacingArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -904,10 +941,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSele Number identifierArg = (Number) args.get(0); List cameraInfoIdsArg = (List) args.get(1); try { - List output = api.filter((identifierArg == null) ? null : identifierArg.longValue(), cameraInfoIdsArg); + List output = + api.filter( + (identifierArg == null) ? null : identifierArg.longValue(), + cameraInfoIdsArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -927,7 +966,7 @@ public CameraSelectorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -936,7 +975,9 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraSelectorFlutterApi.create", getCodec()); @@ -950,13 +991,16 @@ public interface ProcessCameraProviderHostApi { void getInstance(@NonNull Result result); - @NonNull + @NonNull List getAvailableCameraInfos(@NonNull Long identifier); - @NonNull - Long bindToLifecycle(@NonNull Long identifier, @NonNull Long cameraSelectorIdentifier, @NonNull List useCaseIds); + @NonNull + Long bindToLifecycle( + @NonNull Long identifier, + @NonNull Long cameraSelectorIdentifier, + @NonNull List useCaseIds); - @NonNull + @NonNull Boolean isBound(@NonNull Long identifier, @NonNull Long useCaseIdentifier); void unbind(@NonNull Long identifier, @NonNull List useCaseIds); @@ -967,12 +1011,18 @@ public interface ProcessCameraProviderHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { + /** + * Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -999,7 +1049,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1007,10 +1059,11 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = api.getAvailableCameraInfos((identifierArg == null) ? null : identifierArg.longValue()); + List output = + api.getAvailableCameraInfos( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1023,7 +1076,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1033,10 +1088,15 @@ public void error(Throwable error) { Number cameraSelectorIdentifierArg = (Number) args.get(1); List useCaseIdsArg = (List) args.get(2); try { - Long output = api.bindToLifecycle((identifierArg == null) ? null : identifierArg.longValue(), (cameraSelectorIdentifierArg == null) ? null : cameraSelectorIdentifierArg.longValue(), useCaseIdsArg); + Long output = + api.bindToLifecycle( + (identifierArg == null) ? null : identifierArg.longValue(), + (cameraSelectorIdentifierArg == null) + ? null + : cameraSelectorIdentifierArg.longValue(), + useCaseIdsArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1049,7 +1109,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1058,10 +1120,12 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number useCaseIdentifierArg = (Number) args.get(1); try { - Boolean output = api.isBound((identifierArg == null) ? null : identifierArg.longValue(), (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); + Boolean output = + api.isBound( + (identifierArg == null) ? null : identifierArg.longValue(), + (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1074,7 +1138,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1083,10 +1149,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); List useCaseIdsArg = (List) args.get(1); try { - api.unbind((identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); + api.unbind( + (identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1099,7 +1165,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1109,8 +1177,7 @@ public void error(Throwable error) { try { api.unbindAll((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1130,7 +1197,7 @@ public ProcessCameraProviderFlutterApi(@NonNull BinaryMessenger argBinaryMesseng this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1139,10 +1206,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", + getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -1151,17 +1221,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraHostApi { - @NonNull + @NonNull Long getCameraInfo(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraControl(@NonNull Long identifier); /** The codec used by CameraHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHostApi api) { { BasicMessageChannel channel = @@ -1174,10 +1244,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1198,10 +1268,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraControl((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraControl( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1221,7 +1292,7 @@ public CameraFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1230,6 +1301,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1269,21 +1341,28 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface SystemServicesHostApi { - void requestCameraPermissions(@NonNull Boolean enableAudio, @NonNull Result result); + void requestCameraPermissions( + @NonNull Boolean enableAudio, @NonNull Result result); - @NonNull + @NonNull String getTempFilePath(@NonNull String prefix, @NonNull String suffix); /** The codec used by SystemServicesHostApi. */ static @NonNull MessageCodec getCodec() { return SystemServicesHostApiCodec.INSTANCE; } - /**Sets up an instance of `SystemServicesHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { + /** + * Sets up an instance of `SystemServicesHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1312,7 +1391,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1323,8 +1404,7 @@ public void error(Throwable error) { try { String output = api.getTempFilePath(prefixArg, suffixArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1344,7 +1424,7 @@ public SystemServicesFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1353,10 +1433,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", + getCodec()); channel.send( new ArrayList(Collections.singletonList(errorDescriptionArg)), channelReply -> callback.reply(null)); @@ -1365,23 +1448,30 @@ public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { + /** + * Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1390,10 +1480,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie Boolean isFrontFacingArg = (Boolean) args.get(0); Number sensorOrientationArg = (Number) args.get(1); try { - api.startListeningForDeviceOrientationChange(isFrontFacingArg, (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); + api.startListeningForDeviceOrientationChange( + isFrontFacingArg, + (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1406,7 +1497,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1414,8 +1507,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1428,7 +1520,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1436,8 +1530,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie try { Long output = api.getDefaultDisplayRotation(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1457,7 +1550,7 @@ public DeviceOrientationManagerFlutterApi(@NonNull BinaryMessenger argBinaryMess this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1466,10 +1559,14 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onDeviceOrientationChanged(@NonNull String orientationArg, @NonNull Reply callback) { + + public void onDeviceOrientationChanged( + @NonNull String orientationArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", + getCodec()); channel.send( new ArrayList(Collections.singletonList(orientationArg)), channelReply -> callback.reply(null)); @@ -1505,14 +1602,15 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PreviewHostApi { - void create(@NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); - @NonNull + @NonNull Long setSurfaceProvider(@NonNull Long identifier); void releaseFlutterSurfaceTexture(); - @NonNull + @NonNull ResolutionInfo getResolutionInfo(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1521,7 +1619,7 @@ public interface PreviewHostApi { static @NonNull MessageCodec getCodec() { return PreviewHostApiCodec.INSTANCE; } - /**Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHostApi api) { { BasicMessageChannel channel = @@ -1536,10 +1634,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number rotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1552,7 +1654,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1560,10 +1664,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.setSurfaceProvider((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.setSurfaceProvider( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1576,7 +1681,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1584,8 +1691,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos try { api.releaseFlutterSurfaceTexture(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1606,10 +1712,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - ResolutionInfo output = api.getResolutionInfo((identifierArg == null) ? null : identifierArg.longValue()); + ResolutionInfo output = + api.getResolutionInfo( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1631,10 +1738,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1649,10 +1757,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoCaptureHostApi { - @NonNull + @NonNull Long withOutput(@NonNull Long videoOutputId); - @NonNull + @NonNull Long getOutput(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1661,7 +1769,10 @@ public interface VideoCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `VideoCaptureHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `VideoCaptureHostApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptureHostApi api) { { BasicMessageChannel channel = @@ -1674,10 +1785,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number videoOutputIdArg = (Number) args.get(0); try { - Long output = api.withOutput((videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); + Long output = + api.withOutput( + (videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1698,10 +1810,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1714,7 +1826,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1723,10 +1837,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1746,7 +1861,7 @@ public VideoCaptureFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1755,6 +1870,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1767,22 +1883,28 @@ 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, + @Nullable Long qualitySelectorId); - @NonNull + @NonNull Long getAspectRatio(@NonNull Long identifier); - @NonNull + @NonNull Long getTargetVideoEncodingBitRate(@NonNull Long identifier); - @NonNull + @NonNull Long prepareRecording(@NonNull Long identifier, @NonNull String path); /** The codec used by RecorderHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHostApi api) { { BasicMessageChannel channel = @@ -1798,10 +1920,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo 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()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), + (bitRateArg == null) ? null : bitRateArg.longValue(), + (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1822,10 +1947,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getAspectRatio((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getAspectRatio( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1838,7 +1964,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1846,10 +1974,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getTargetVideoEncodingBitRate((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getTargetVideoEncodingBitRate( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1871,10 +2000,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number identifierArg = (Number) args.get(0); String pathArg = (String) args.get(1); try { - Long output = api.prepareRecording((identifierArg == null) ? null : identifierArg.longValue(), pathArg); + Long output = + api.prepareRecording( + (identifierArg == null) ? null : identifierArg.longValue(), pathArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1894,7 +2024,7 @@ public RecorderFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1903,7 +2033,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @Nullable Long bitRateArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @Nullable Long aspectRatioArg, + @Nullable Long bitRateArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.RecorderFlutterApi.create", getCodec()); @@ -1915,15 +2050,19 @@ public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @ /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PendingRecordingHostApi { - @NonNull + @NonNull Long start(@NonNull Long identifier); /** The codec used by PendingRecordingHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `PendingRecordingHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { + /** + * Sets up an instance of `PendingRecordingHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1935,10 +2074,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRec ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.start((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.start((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1958,7 +2097,7 @@ public PendingRecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1967,6 +2106,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1991,7 +2131,9 @@ public interface RecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingHostApi api) { { BasicMessageChannel channel = @@ -2006,8 +2148,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2030,8 +2171,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.pause((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2054,8 +2194,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.resume((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2078,8 +2217,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.stop((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2099,7 +2237,7 @@ public RecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2108,6 +2246,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2120,7 +2259,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageCaptureHostApi { - void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long flashMode, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, + @Nullable Long targetRotation, + @Nullable Long flashMode, + @Nullable Long resolutionSelectorId); void setFlashMode(@NonNull Long identifier, @NonNull Long flashMode); @@ -2132,7 +2275,10 @@ public interface ImageCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageCaptureHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ImageCaptureHostApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptureHostApi api) { { BasicMessageChannel channel = @@ -2148,10 +2294,15 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number flashModeArg = (Number) args.get(2); Number resolutionSelectorIdArg = (Number) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (targetRotationArg == null) ? null : targetRotationArg.longValue(), + (flashModeArg == null) ? null : flashModeArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2173,10 +2324,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number identifierArg = (Number) args.get(0); Number flashModeArg = (Number) args.get(1); try { - api.setFlashMode((identifierArg == null) ? null : identifierArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue()); + api.setFlashMode( + (identifierArg == null) ? null : identifierArg.longValue(), + (flashModeArg == null) ? null : flashModeArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2209,7 +2361,8 @@ public void error(Throwable error) { } }; - api.takePicture((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.takePicture( + (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -2218,7 +2371,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2227,10 +2382,11 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2244,7 +2400,8 @@ public void error(Throwable error) { } private static class ResolutionStrategyHostApiCodec extends StandardMessageCodec { - public static final ResolutionStrategyHostApiCodec INSTANCE = new ResolutionStrategyHostApiCodec(); + public static final ResolutionStrategyHostApiCodec INSTANCE = + new ResolutionStrategyHostApiCodec(); private ResolutionStrategyHostApiCodec() {} @@ -2272,14 +2429,19 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionStrategyHostApi { - void create(@NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); + void create( + @NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); /** The codec used by ResolutionStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionStrategyHostApiCodec.INSTANCE; } - /**Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { + /** + * Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2293,10 +2455,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution ResolutionInfo boundSizeArg = (ResolutionInfo) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), boundSizeArg, (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + boundSizeArg, + (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2311,14 +2475,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionSelectorHostApi { - void create(@NonNull Long identifier, @Nullable Long resolutionStrategyIdentifier, @Nullable Long aspectRatioStrategyIdentifier); + void create( + @NonNull Long identifier, + @Nullable Long resolutionStrategyIdentifier, + @Nullable Long aspectRatioStrategyIdentifier); /** The codec used by ResolutionSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { + /** + * Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2332,10 +2503,16 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution Number resolutionStrategyIdentifierArg = (Number) args.get(1); Number aspectRatioStrategyIdentifierArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (resolutionStrategyIdentifierArg == null) ? null : resolutionStrategyIdentifierArg.longValue(), (aspectRatioStrategyIdentifierArg == null) ? null : aspectRatioStrategyIdentifierArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (resolutionStrategyIdentifierArg == null) + ? null + : resolutionStrategyIdentifierArg.longValue(), + (aspectRatioStrategyIdentifierArg == null) + ? null + : aspectRatioStrategyIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2350,18 +2527,25 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AspectRatioStrategyHostApi { - void create(@NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); + void create( + @NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); /** The codec used by AspectRatioStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { + /** + * Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2371,10 +2555,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRati Number preferredAspectRatioArg = (Number) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (preferredAspectRatioArg == null) ? null : preferredAspectRatioArg.longValue(), (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (preferredAspectRatioArg == null) + ? null + : preferredAspectRatioArg.longValue(), + (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2421,7 +2609,7 @@ public CameraStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2430,7 +2618,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return CameraStateFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull CameraStateTypeData typeArg, @Nullable Long errorIdentifierArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull CameraStateTypeData typeArg, + @Nullable Long errorIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateFlutterApi.create", getCodec()); @@ -2474,7 +2667,7 @@ public ExposureStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2483,12 +2676,19 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return ExposureStateFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull ExposureCompensationRange exposureCompensationRangeArg, @NonNull Double exposureCompensationStepArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull ExposureCompensationRange exposureCompensationRangeArg, + @NonNull Double exposureCompensationStepArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ExposureStateFlutterApi.create", getCodec()); channel.send( - new ArrayList(Arrays.asList(identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), + new ArrayList( + Arrays.asList( + identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), channelReply -> callback.reply(null)); } } @@ -2500,7 +2700,7 @@ public ZoomStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2509,7 +2709,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, @NonNull Double maxZoomRatioArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull Double minZoomRatioArg, + @NonNull Double maxZoomRatioArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ZoomStateFlutterApi.create", getCodec()); @@ -2521,7 +2726,10 @@ public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageAnalysisHostApi { - void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, + @Nullable Long targetRotation, + @Nullable Long resolutionSelectorId); void setAnalyzer(@NonNull Long identifier, @NonNull Long analyzerIdentifier); @@ -2533,8 +2741,12 @@ public interface ImageAnalysisHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageAnalysisHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { + /** + * Sets up an instance of `ImageAnalysisHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2548,10 +2760,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number targetRotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (targetRotationArg == null) ? null : targetRotationArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2573,10 +2789,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number identifierArg = (Number) args.get(0); Number analyzerIdentifierArg = (Number) args.get(1); try { - api.setAnalyzer((identifierArg == null) ? null : identifierArg.longValue(), (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); + api.setAnalyzer( + (identifierArg == null) ? null : identifierArg.longValue(), + (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2589,7 +2806,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2599,8 +2818,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly try { api.clearAnalyzer((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2613,7 +2831,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2622,10 +2842,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2646,7 +2867,9 @@ public interface AnalyzerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHostApi api) { { BasicMessageChannel channel = @@ -2661,8 +2884,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2683,7 +2905,9 @@ public interface ObserverHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHostApi api) { { BasicMessageChannel channel = @@ -2698,8 +2922,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2719,7 +2942,7 @@ public ObserverFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2728,7 +2951,11 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onChanged(@NonNull Long identifierArg, @NonNull Long valueIdentifierArg, @NonNull Reply callback) { + + public void onChanged( + @NonNull Long identifierArg, + @NonNull Long valueIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ObserverFlutterApi.onChanged", getCodec()); @@ -2745,7 +2972,7 @@ public CameraStateErrorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2754,7 +2981,9 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateErrorFlutterApi.create", getCodec()); @@ -2797,14 +3026,16 @@ public interface LiveDataHostApi { void removeObservers(@NonNull Long identifier); - @Nullable + @Nullable Long getValue(@NonNull Long identifier, @NonNull LiveDataSupportedTypeData type); /** The codec used by LiveDataHostApi. */ static @NonNull MessageCodec getCodec() { return LiveDataHostApiCodec.INSTANCE; } - /**Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHostApi api) { { BasicMessageChannel channel = @@ -2818,10 +3049,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); Number observerIdentifierArg = (Number) args.get(1); try { - api.observe((identifierArg == null) ? null : identifierArg.longValue(), (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); + api.observe( + (identifierArg == null) ? null : identifierArg.longValue(), + (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2844,8 +3076,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo try { api.removeObservers((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2867,10 +3098,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); LiveDataSupportedTypeData typeArg = (LiveDataSupportedTypeData) args.get(1); try { - Long output = api.getValue((identifierArg == null) ? null : identifierArg.longValue(), typeArg); + Long output = + api.getValue( + (identifierArg == null) ? null : identifierArg.longValue(), typeArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2917,7 +3149,7 @@ public LiveDataFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2926,7 +3158,11 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return LiveDataFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull LiveDataSupportedTypeData typeArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull LiveDataSupportedTypeData typeArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.LiveDataFlutterApi.create", getCodec()); @@ -2943,7 +3179,7 @@ public AnalyzerFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2952,6 +3188,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2960,7 +3197,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } - public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentifierArg, @NonNull Reply callback) { + + public void analyze( + @NonNull Long identifierArg, + @NonNull Long imageProxyIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.AnalyzerFlutterApi.analyze", getCodec()); @@ -2972,7 +3213,7 @@ public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentif /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageProxyHostApi { - @NonNull + @NonNull List getPlanes(@NonNull Long identifier); void close(@NonNull Long identifier); @@ -2981,7 +3222,9 @@ public interface ImageProxyHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxyHostApi api) { { BasicMessageChannel channel = @@ -2994,10 +3237,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); + List output = + api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3020,8 +3263,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3041,7 +3283,7 @@ public ImageProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3050,7 +3292,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Long formatArg, @NonNull Long heightArg, @NonNull Long widthArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull Long formatArg, + @NonNull Long heightArg, + @NonNull Long widthArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ImageProxyFlutterApi.create", getCodec()); @@ -3067,7 +3315,7 @@ public PlaneProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3076,12 +3324,19 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull byte[] bufferArg, @NonNull Long pixelStrideArg, @NonNull Long rowStrideArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull byte[] bufferArg, + @NonNull Long pixelStrideArg, + @NonNull Long rowStrideArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.PlaneProxyFlutterApi.create", getCodec()); channel.send( - new ArrayList(Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), + new ArrayList( + Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), channelReply -> callback.reply(null)); } } @@ -3120,17 +3375,24 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface QualitySelectorHostApi { - void create(@NonNull Long identifier, @NonNull List videoQualityDataList, @Nullable Long fallbackStrategyId); + void create( + @NonNull Long identifier, + @NonNull List videoQualityDataList, + @Nullable Long fallbackStrategyId); - @NonNull + @NonNull ResolutionInfo getResolution(@NonNull Long cameraInfoId, @NonNull VideoQuality quality); /** The codec used by QualitySelectorHostApi. */ static @NonNull MessageCodec getCodec() { return QualitySelectorHostApiCodec.INSTANCE; } - /**Sets up an instance of `QualitySelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { + /** + * Sets up an instance of `QualitySelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3141,13 +3403,16 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List videoQualityDataListArg = (List) args.get(1); + List videoQualityDataListArg = + (List) args.get(1); Number fallbackStrategyIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), videoQualityDataListArg, (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + videoQualityDataListArg, + (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3160,19 +3425,24 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number cameraInfoIdArg = (Number) args.get(0); - VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoQuality qualityArg = + args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; try { - ResolutionInfo output = api.getResolution((cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), qualityArg); + ResolutionInfo output = + api.getResolution( + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), + qualityArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3187,14 +3457,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FallbackStrategyHostApi { - void create(@NonNull Long identifier, @NonNull VideoQuality quality, @NonNull VideoResolutionFallbackRule fallbackRule); + void create( + @NonNull Long identifier, + @NonNull VideoQuality quality, + @NonNull VideoResolutionFallbackRule fallbackRule); /** The codec used by FallbackStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `FallbackStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { + /** + * Sets up an instance of `FallbackStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3205,13 +3482,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackSt ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; - VideoResolutionFallbackRule fallbackRuleArg = args.get(2) == null ? null : VideoResolutionFallbackRule.values()[(int) args.get(2)]; + VideoQuality qualityArg = + args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoResolutionFallbackRule fallbackRuleArg = + args.get(2) == null + ? null + : VideoResolutionFallbackRule.values()[(int) args.get(2)]; try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), qualityArg, fallbackRuleArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + qualityArg, + fallbackRuleArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3226,22 +3509,32 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackSt /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraControlHostApi { - void enableTorch(@NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); + void enableTorch( + @NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); - void setZoomRatio(@NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); + void setZoomRatio( + @NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); - void startFocusAndMetering(@NonNull Long identifier, @NonNull Long focusMeteringActionId, @NonNull Result result); + void startFocusAndMetering( + @NonNull Long identifier, + @NonNull Long focusMeteringActionId, + @NonNull Result result); void cancelFocusAndMetering(@NonNull Long identifier, @NonNull Result result); - void setExposureCompensationIndex(@NonNull Long identifier, @NonNull Long index, @NonNull Result result); + void setExposureCompensationIndex( + @NonNull Long identifier, @NonNull Long index, @NonNull Result result); /** The codec used by CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraControlHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { + /** + * Sets up an instance of `CameraControlHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3266,7 +3559,10 @@ public void error(Throwable error) { } }; - api.enableTorch((identifierArg == null) ? null : identifierArg.longValue(), torchArg, resultCallback); + api.enableTorch( + (identifierArg == null) ? null : identifierArg.longValue(), + torchArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3275,7 +3571,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3296,7 +3594,10 @@ public void error(Throwable error) { } }; - api.setZoomRatio((identifierArg == null) ? null : identifierArg.longValue(), ratioArg, resultCallback); + api.setZoomRatio( + (identifierArg == null) ? null : identifierArg.longValue(), + ratioArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3305,7 +3606,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3326,7 +3629,12 @@ public void error(Throwable error) { } }; - api.startFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), (focusMeteringActionIdArg == null) ? null : focusMeteringActionIdArg.longValue(), resultCallback); + api.startFocusAndMetering( + (identifierArg == null) ? null : identifierArg.longValue(), + (focusMeteringActionIdArg == null) + ? null + : focusMeteringActionIdArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3335,7 +3643,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3355,7 +3665,8 @@ public void error(Throwable error) { } }; - api.cancelFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.cancelFocusAndMetering( + (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3364,7 +3675,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3385,7 +3698,10 @@ public void error(Throwable error) { } }; - api.setExposureCompensationIndex((identifierArg == null) ? null : identifierArg.longValue(), (indexArg == null) ? null : indexArg.longValue(), resultCallback); + api.setExposureCompensationIndex( + (identifierArg == null) ? null : identifierArg.longValue(), + (indexArg == null) ? null : indexArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3401,7 +3717,7 @@ public CameraControlFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3410,6 +3726,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3421,7 +3738,8 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { } private static class FocusMeteringActionHostApiCodec extends StandardMessageCodec { - public static final FocusMeteringActionHostApiCodec INSTANCE = new FocusMeteringActionHostApiCodec(); + public static final FocusMeteringActionHostApiCodec INSTANCE = + new FocusMeteringActionHostApiCodec(); private FocusMeteringActionHostApiCodec() {} @@ -3455,24 +3773,32 @@ public interface FocusMeteringActionHostApi { static @NonNull MessageCodec getCodec() { return FocusMeteringActionHostApiCodec.INSTANCE; } - /**Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { + /** + * Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringActionHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringActionHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List meteringPointInfosArg = (List) args.get(1); + List meteringPointInfosArg = + (List) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + meteringPointInfosArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3487,19 +3813,25 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeter /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringResultHostApi { - @NonNull + @NonNull Boolean isFocusSuccessful(@NonNull Long identifier); /** The codec used by FocusMeteringResultHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { + /** + * Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3507,10 +3839,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeter ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Boolean output = api.isFocusSuccessful((identifierArg == null) ? null : identifierArg.longValue()); + Boolean output = + api.isFocusSuccessful( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3530,7 +3863,7 @@ public FocusMeteringResultFlutterApi(@NonNull BinaryMessenger argBinaryMessenger this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3539,10 +3872,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", + getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -3551,17 +3887,22 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MeteringPointHostApi { - void create(@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); + void create( + @NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); - @NonNull + @NonNull Double getDefaultPointSize(); /** The codec used by MeteringPointHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `MeteringPointHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { + /** + * Sets up an instance of `MeteringPointHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3576,10 +3917,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo Double yArg = (Double) args.get(2); Double sizeArg = (Double) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + xArg, + yArg, + sizeArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3592,7 +3936,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3600,8 +3946,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo try { Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 53e135498bf..c08762faa8d 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -7,7 +7,8 @@ import 'dart:math' show Point; import 'package:async/async.dart'; import 'package:camera_platform_interface/camera_platform_interface.dart'; -import 'package:flutter/services.dart' show DeviceOrientation; +import 'package:flutter/services.dart' + show DeviceOrientation, PlatformException; import 'package:flutter/widgets.dart'; import 'package:stream_transform/stream_transform.dart'; @@ -72,6 +73,9 @@ class AndroidCameraCameraX extends CameraPlatform { @visibleForTesting CameraInfo? cameraInfo; + /// The [CameraControl] instance that corresponds to the [camera] instance. + CameraControl? cameraControl; + /// The [LiveData] of the [CameraState] that represents the state of the /// [camera] instance. LiveData? liveCameraState; @@ -498,27 +502,25 @@ class AndroidCameraCameraX extends CameraPlatform { /// Returns the (rounded) offset value that was set. @override Future setExposureOffset(int cameraId, double offset) async { - // TODO(camsim99): cache camera + related values if possible. - final double minOffset = await getMinExposureOffset(cameraId); - final double maxOffset = await getMaxExposureOffset(cameraId); - - if (offset < minOffset || offset > maxOffset) { - throw CameraException('TODO(camsim99)', 'TODO(camsim99)'); - } - final double exposureOffsetStepSize = (await cameraInfo!.getExposureState()).exposureCompensationStep; if (exposureOffsetStepSize == 0) { - throw CameraException( - 'TODO(camsim99)', 'Exposure compensation not supported'); + throw CameraException(exposureCompensationNotSupported, + 'Exposure compensation not supported'); } final int roundedExposureCompensationIndex = (offset / exposureOffsetStepSize).round(); - final CameraControl cameraControl = await camera!.getCameraControl(); - await cameraControl - .setExposureCompensationIndex(roundedExposureCompensationIndex); + try { + await cameraControl! + .setExposureCompensationIndex(roundedExposureCompensationIndex); + } on PlatformException catch (e) { + throw CameraException( + 'setExposureOffsetFailed', + e.message ?? + 'Setting the camera exposure compensation index failed.'); + } return roundedExposureCompensationIndex * exposureOffsetStepSize; } @@ -575,8 +577,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// Throws a `CameraException` when an illegal zoom level is supplied. @override Future setZoomLevel(int cameraId, double zoom) async { - final CameraControl cameraControl = await camera!.getCameraControl(); - await cameraControl.setZoomRatio(zoom); + await cameraControl!.setZoomRatio(zoom); } /// The ui orientation changed. @@ -663,8 +664,7 @@ class AndroidCameraCameraX extends CameraPlatform { CameraControl? cameraControl; // Turn off torch mode if it is enabled and not being redundantly set. if (mode != FlashMode.torch && torchEnabled) { - cameraControl = await camera!.getCameraControl(); - await cameraControl.enableTorch(false); + await cameraControl!.enableTorch(false); torchEnabled = false; } @@ -681,8 +681,7 @@ class AndroidCameraCameraX extends CameraPlatform { // Torch mode enabled already. return; } - cameraControl = await camera!.getCameraControl(); - await cameraControl.enableTorch(true); + await cameraControl!.enableTorch(true); torchEnabled = true; } } @@ -754,7 +753,7 @@ class AndroidCameraCameraX extends CameraPlatform { if (videoOutputPath == null) { // Stop the current active recording as we will be unable to complete it // in this error case. - unawaited(recording!.close()); + await recording!.close(); recording = null; pendingRecording = null; throw CameraException( @@ -763,7 +762,7 @@ class AndroidCameraCameraX extends CameraPlatform { 'while reporting success. The platform should always ' 'return a valid path or report an error.'); } - unawaited(recording!.close()); + await recording!.close(); recording = null; pendingRecording = null; return XFile(videoOutputPath!); @@ -905,14 +904,15 @@ class AndroidCameraCameraX extends CameraPlatform { // Methods concerning camera state: - /// Updates [cameraInfo] to the information corresponding to [camera] and - /// adds observers to the [LiveData] of the [CameraState] of the current - /// [camera], saved as [liveCameraState]. + /// Updates [cameraInfo] and [cameraControl] to the information corresponding + /// to [camera] and adds observers to the [LiveData] of the [CameraState] of + /// the current [camera], saved as [liveCameraState]. /// /// If a previous [liveCameraState] was stored, existing observers are /// removed, as well. Future _updateCameraInfoAndLiveCameraState(int cameraId) async { cameraInfo = await camera!.getCameraInfo(); + cameraControl = await camera!.getCameraControl(); await liveCameraState?.removeObservers(); liveCameraState = await cameraInfo!.getCameraState(); await liveCameraState!.observe(_createCameraClosingObserver(cameraId)); @@ -1054,50 +1054,83 @@ class AndroidCameraCameraX extends CameraPlatform { videoQuality: videoQuality, fallbackStrategy: fallbackStrategy); } - /// TODO(camsim99) + // Methods for configuring auto-focus and auto-exposure: + + /// Starts a foucs and metering action. + /// + /// If [meteringPoint] is non-null, this action includes + /// * metering points and their modes previously added to + /// [currentFocusMeteringAction] that do not share a metering mode with + /// [meteringPoint] and + /// * [meteringPoint] with the specified [meteringMode]. + /// If [meteringPoint] is null, this action includes only metering points and + /// their modes previously added to [currentFocusMeteringAction] that do not + /// share a metering mode with [meteringPoint]. If there are no such metering + /// points, then any previously enabled focus and metering actions will be + /// canceled. Future _startFocusAndMeteringFor( {required Point? meteringPoint, - required int? meteringMode}) async { - // TODO(camsim99): Consider caching cameraControl when camera created. - final CameraControl cameraControl = await camera!.getCameraControl(); + required int meteringMode}) async { if (meteringPoint == null) { + // Try to clear any metering point from previous action with the specified + // meteringMode. if (currentFocusMeteringAction == null) { + // Attempting to clear a metering point from a previous action, but no + // such action exists. return; } + + // Remove metering point with specified meteringMode from current focus + // and metering action, as only one focus or exposure point may be set + // at once in this plugin. final List<(MeteringPoint, int?)> newMeteringPointInfos = currentFocusMeteringAction!.meteringPointInfos .where(((MeteringPoint, int?) meteringPointInfo) => + // meteringPointInfo may technically include points without a + // mode specified, but this logic is safe because this plugin + // only explicitly uses FocusMeteringAction.flagAe or + // FocusMeteringAction.flagAf. meteringPointInfo.$2 != meteringMode) .toList(); + if (newMeteringPointInfos.isEmpty) { - await cameraControl.cancelFocusAndMetering(); + // If no other metering points were specified, cancel any previously + // started focus and metering actions. + await cameraControl!.cancelFocusAndMetering(); return; } + currentFocusMeteringAction = FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); - - await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); - return; } else if (meteringPoint.x < 0 || meteringPoint.x > 1 || meteringPoint.y < 0 && meteringPoint.y > 1) { - throw CameraException('TODO(camsim99)', 'TODO(camsim99)'); - } - - List<(MeteringPoint, int?)> newMeteringPointInfos = - <(MeteringPoint, int?)>[]; - if (currentFocusMeteringAction != null) { - newMeteringPointInfos = currentFocusMeteringAction!.meteringPointInfos - .where(((MeteringPoint, int?) meteringPointInfo) => - meteringPointInfo.$2 != meteringMode) - .toList(); + throw CameraException('meteringPointInvalid', + 'The coordinates of a metering point for an auto-focus or auto-exposure action must be within (0,0) and (1,1).'); + } else { + // Add new metering point with specified meteringMode, which might + // involve replacing a metering point with the same specified meteringMode + // from the current focus and metering action. + List<(MeteringPoint, int?)> newMeteringPointInfos = + <(MeteringPoint, int?)>[]; + + if (currentFocusMeteringAction != null) { + newMeteringPointInfos = currentFocusMeteringAction!.meteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + // meteringPointInfo may technically include points without a + // mode specified, but this logic is safe because this plugin + // only explicitly uses FocusMeteringAction.flagAe or + // FocusMeteringAction.flagAf. + meteringPointInfo.$2 != meteringMode) + .toList(); + } + final MeteringPoint newMeteringPoint = + MeteringPoint(x: meteringPoint.x, y: meteringPoint.y); + newMeteringPointInfos.add((newMeteringPoint, meteringMode)); + currentFocusMeteringAction = + FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); } - final MeteringPoint newMeteringPoint = - MeteringPoint(x: meteringPoint!.x, y: meteringPoint.y); - newMeteringPointInfos.add((newMeteringPoint, meteringMode)); - currentFocusMeteringAction = - FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); - await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); + await cameraControl!.startFocusAndMetering(currentFocusMeteringAction!); } } diff --git a/packages/camera/camera_android_camerax/lib/src/camera_control.dart b/packages/camera/camera_android_camerax/lib/src/camera_control.dart index 808fcf44652..89a5118cc7b 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -180,10 +180,9 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { } return exposureCompensationIndex; } on PlatformException catch (e) { - // TODO(camsim99): perhaps throw cameraexception here. SystemServices.cameraErrorStreamController.add(e.message ?? 'Setting the camera exposure compensation index failed.'); - return Future.value(); + rethrow; } } } diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index d8b72ceb837..e1612382cea 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -259,8 +259,7 @@ class InstanceManagerHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -316,7 +315,8 @@ abstract class JavaObjectFlutterApi { void dispose(int identifier); - static void setup(JavaObjectFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(JavaObjectFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectFlutterApi.dispose', codec, @@ -326,7 +326,7 @@ abstract class JavaObjectFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -463,7 +463,8 @@ abstract class CameraInfoFlutterApi { void create(int identifier); - static void setup(CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraInfoFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraInfoFlutterApi.create', codec, @@ -473,7 +474,7 @@ abstract class CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -500,8 +501,8 @@ class CameraSelectorHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_lensFacing]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_lensFacing]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -518,12 +519,13 @@ class CameraSelectorHostApi { } } - Future> filter(int arg_identifier, List arg_cameraInfoIds) async { + Future> filter( + int arg_identifier, List arg_cameraInfoIds) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraInfoIds]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_cameraInfoIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -551,7 +553,8 @@ abstract class CameraSelectorFlutterApi { void create(int identifier, int? lensFacing); - static void setup(CameraSelectorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraSelectorFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorFlutterApi.create', codec, @@ -561,7 +564,7 @@ abstract class CameraSelectorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -589,8 +592,7 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -614,7 +616,8 @@ class ProcessCameraProviderHostApi { Future> getAvailableCameraInfos(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -639,12 +642,17 @@ class ProcessCameraProviderHostApi { } } - Future bindToLifecycle(int arg_identifier, int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { + Future bindToLifecycle(int arg_identifier, + int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraSelectorIdentifier, arg_useCaseIds]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_cameraSelectorIdentifier, + arg_useCaseIds + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -671,7 +679,8 @@ class ProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_useCaseIdentifier]) as List?; + await channel.send([arg_identifier, arg_useCaseIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -697,8 +706,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_useCaseIds]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -743,7 +752,8 @@ abstract class ProcessCameraProviderFlutterApi { void create(int identifier); - static void setup(ProcessCameraProviderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ProcessCameraProviderFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create', codec, @@ -753,7 +763,7 @@ abstract class ProcessCameraProviderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -846,7 +856,7 @@ abstract class CameraFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -874,7 +884,7 @@ class _SystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -892,9 +902,11 @@ class SystemServicesHostApi { static const MessageCodec codec = _SystemServicesHostApiCodec(); - Future requestCameraPermissions(bool arg_enableAudio) async { + Future requestCameraPermissions( + bool arg_enableAudio) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_enableAudio]) as List?; @@ -947,7 +959,8 @@ abstract class SystemServicesFlutterApi { void onCameraError(String errorDescription); - static void setup(SystemServicesFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(SystemServicesFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError', codec, @@ -957,7 +970,7 @@ abstract class SystemServicesFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); final List args = (message as List?)!; final String? arg_errorDescription = (args[0] as String?); assert(arg_errorDescription != null, @@ -980,12 +993,15 @@ class DeviceOrientationManagerHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future startListeningForDeviceOrientationChange(bool arg_isFrontFacing, int arg_sensorOrientation) async { + Future startListeningForDeviceOrientationChange( + bool arg_isFrontFacing, int arg_sensorOrientation) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', + codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_isFrontFacing, arg_sensorOrientation]) as List?; + await channel.send([arg_isFrontFacing, arg_sensorOrientation]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1004,10 +1020,10 @@ class DeviceOrientationManagerHostApi { Future stopListeningForDeviceOrientationChange() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1026,10 +1042,10 @@ class DeviceOrientationManagerHostApi { Future getDefaultDisplayRotation() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1057,17 +1073,19 @@ abstract class DeviceOrientationManagerFlutterApi { void onDeviceOrientationChanged(String orientation); - static void setup(DeviceOrientationManagerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(DeviceOrientationManagerFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); final List args = (message as List?)!; final String? arg_orientation = (args[0] as String?); assert(arg_orientation != null, @@ -1095,7 +1113,7 @@ class _PreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1113,12 +1131,14 @@ class PreviewHostApi { static const MessageCodec codec = _PreviewHostApiCodec(); - Future create(int arg_identifier, int? arg_rotation, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_rotation, + int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_rotation, arg_resolutionSelectorId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1166,8 +1186,7 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1215,8 +1234,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1302,8 +1321,8 @@ class VideoCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1326,7 +1345,8 @@ abstract class VideoCaptureFlutterApi { void create(int identifier); - static void setup(VideoCaptureFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(VideoCaptureFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureFlutterApi.create', codec, @@ -1336,7 +1356,7 @@ abstract class VideoCaptureFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1359,12 +1379,17 @@ class RecorderHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_aspectRatio, int? arg_bitRate, int? arg_qualitySelectorId) async { + Future create(int arg_identifier, int? arg_aspectRatio, + int? arg_bitRate, int? arg_qualitySelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_aspectRatio, + arg_bitRate, + arg_qualitySelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1410,7 +1435,8 @@ class RecorderHostApi { Future getTargetVideoEncodingBitRate(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -1439,8 +1465,8 @@ class RecorderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_path]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_path]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1468,7 +1494,8 @@ abstract class RecorderFlutterApi { void create(int identifier, int? aspectRatio, int? bitRate); - static void setup(RecorderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(RecorderFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderFlutterApi.create', codec, @@ -1478,7 +1505,7 @@ abstract class RecorderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1536,7 +1563,8 @@ abstract class PendingRecordingFlutterApi { void create(int identifier); - static void setup(PendingRecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(PendingRecordingFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingFlutterApi.create', codec, @@ -1546,7 +1574,7 @@ abstract class PendingRecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1663,7 +1691,8 @@ abstract class RecordingFlutterApi { void create(int identifier); - static void setup(RecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(RecordingFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingFlutterApi.create', codec, @@ -1673,7 +1702,7 @@ abstract class RecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1696,12 +1725,17 @@ class ImageCaptureHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, int? arg_flashMode, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, + int? arg_flashMode, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_targetRotation, + arg_flashMode, + arg_resolutionSelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1722,8 +1756,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_flashMode]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_flashMode]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1771,8 +1805,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1805,7 +1839,7 @@ class _ResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1823,12 +1857,14 @@ class ResolutionStrategyHostApi { static const MessageCodec codec = _ResolutionStrategyHostApiCodec(); - Future create(int arg_identifier, ResolutionInfo? arg_boundSize, int? arg_fallbackRule) async { + Future create(int arg_identifier, ResolutionInfo? arg_boundSize, + int? arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_boundSize, arg_fallbackRule]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_boundSize, arg_fallbackRule]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1856,12 +1892,16 @@ class ResolutionSelectorHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, int? arg_aspectRatioStrategyIdentifier) async { + Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, + int? arg_aspectRatioStrategyIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_resolutionStrategyIdentifier, arg_aspectRatioStrategyIdentifier]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_resolutionStrategyIdentifier, + arg_aspectRatioStrategyIdentifier + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1889,12 +1929,16 @@ class AspectRatioStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_preferredAspectRatio, int arg_fallbackRule) async { + Future create(int arg_identifier, int arg_preferredAspectRatio, + int arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_preferredAspectRatio, arg_fallbackRule]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_preferredAspectRatio, + arg_fallbackRule + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1927,7 +1971,7 @@ class _CameraStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraStateTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1940,7 +1984,8 @@ abstract class CameraStateFlutterApi { void create(int identifier, CameraStateTypeData type, int? errorIdentifier); - static void setup(CameraStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateFlutterApi.create', codec, @@ -1950,12 +1995,13 @@ abstract class CameraStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null int.'); - final CameraStateTypeData? arg_type = (args[1] as CameraStateTypeData?); + final CameraStateTypeData? arg_type = + (args[1] as CameraStateTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null CameraStateTypeData.'); final int? arg_errorIdentifier = (args[2] as int?); @@ -1982,7 +2028,7 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ExposureCompensationRange.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1993,9 +2039,13 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { abstract class ExposureStateFlutterApi { static const MessageCodec codec = _ExposureStateFlutterApiCodec(); - void create(int identifier, ExposureCompensationRange exposureCompensationRange, double exposureCompensationStep); + void create( + int identifier, + ExposureCompensationRange exposureCompensationRange, + double exposureCompensationStep); - static void setup(ExposureStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ExposureStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ExposureStateFlutterApi.create', codec, @@ -2005,18 +2055,20 @@ abstract class ExposureStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null int.'); - final ExposureCompensationRange? arg_exposureCompensationRange = (args[1] as ExposureCompensationRange?); + final ExposureCompensationRange? arg_exposureCompensationRange = + (args[1] as ExposureCompensationRange?); assert(arg_exposureCompensationRange != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null ExposureCompensationRange.'); final double? arg_exposureCompensationStep = (args[2] as double?); assert(arg_exposureCompensationStep != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null double.'); - api.create(arg_identifier!, arg_exposureCompensationRange!, arg_exposureCompensationStep!); + api.create(arg_identifier!, arg_exposureCompensationRange!, + arg_exposureCompensationStep!); return; }); } @@ -2029,7 +2081,8 @@ abstract class ZoomStateFlutterApi { void create(int identifier, double minZoomRatio, double maxZoomRatio); - static void setup(ZoomStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ZoomStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ZoomStateFlutterApi.create', codec, @@ -2039,7 +2092,7 @@ abstract class ZoomStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2068,12 +2121,16 @@ class ImageAnalysisHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, + int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_targetRotation, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_targetRotation, + arg_resolutionSelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2090,12 +2147,14 @@ class ImageAnalysisHostApi { } } - Future setAnalyzer(int arg_identifier, int arg_analyzerIdentifier) async { + Future setAnalyzer( + int arg_identifier, int arg_analyzerIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_analyzerIdentifier]) as List?; + await channel.send([arg_identifier, arg_analyzerIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2138,8 +2197,8 @@ class ImageAnalysisHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2228,7 +2287,8 @@ abstract class ObserverFlutterApi { void onChanged(int identifier, int valueIdentifier); - static void setup(ObserverFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ObserverFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverFlutterApi.onChanged', codec, @@ -2238,7 +2298,7 @@ abstract class ObserverFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); + 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2259,7 +2319,8 @@ abstract class CameraStateErrorFlutterApi { void create(int identifier, int code); - static void setup(CameraStateErrorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateErrorFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateErrorFlutterApi.create', codec, @@ -2269,7 +2330,7 @@ abstract class CameraStateErrorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2300,7 +2361,7 @@ class _LiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2323,7 +2384,8 @@ class LiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_observerIdentifier]) as List?; + await channel.send([arg_identifier, arg_observerIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2362,12 +2424,13 @@ class LiveDataHostApi { } } - Future getValue(int arg_identifier, LiveDataSupportedTypeData arg_type) async { + Future getValue( + int arg_identifier, LiveDataSupportedTypeData arg_type) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_type]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_type]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2400,7 +2463,7 @@ class _LiveDataFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2413,7 +2476,8 @@ abstract class LiveDataFlutterApi { void create(int identifier, LiveDataSupportedTypeData type); - static void setup(LiveDataFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(LiveDataFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataFlutterApi.create', codec, @@ -2423,12 +2487,13 @@ abstract class LiveDataFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = + (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null LiveDataSupportedTypeData.'); api.create(arg_identifier!, arg_type!); @@ -2446,7 +2511,8 @@ abstract class AnalyzerFlutterApi { void analyze(int identifier, int imageProxyIdentifier); - static void setup(AnalyzerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(AnalyzerFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerFlutterApi.create', codec, @@ -2456,7 +2522,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2475,7 +2541,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2556,7 +2622,8 @@ abstract class ImageProxyFlutterApi { void create(int identifier, int format, int height, int width); - static void setup(ImageProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ImageProxyFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyFlutterApi.create', codec, @@ -2566,7 +2633,7 @@ abstract class ImageProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2593,7 +2660,8 @@ abstract class PlaneProxyFlutterApi { void create(int identifier, Uint8List buffer, int pixelStride, int rowStride); - static void setup(PlaneProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(PlaneProxyFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PlaneProxyFlutterApi.create', codec, @@ -2603,7 +2671,7 @@ abstract class PlaneProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2617,7 +2685,8 @@ abstract class PlaneProxyFlutterApi { final int? arg_rowStride = (args[3] as int?); assert(arg_rowStride != null, 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); + api.create( + arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); return; }); } @@ -2643,9 +2712,9 @@ class _QualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2663,12 +2732,18 @@ class QualitySelectorHostApi { static const MessageCodec codec = _QualitySelectorHostApiCodec(); - Future create(int arg_identifier, List arg_videoQualityDataList, int? arg_fallbackStrategyId) async { + Future create( + int arg_identifier, + List arg_videoQualityDataList, + int? arg_fallbackStrategyId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_videoQualityDataList, arg_fallbackStrategyId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_videoQualityDataList, + arg_fallbackStrategyId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2685,12 +2760,13 @@ class QualitySelectorHostApi { } } - Future getResolution(int arg_cameraInfoId, VideoQuality arg_quality) async { + Future getResolution( + int arg_cameraInfoId, VideoQuality arg_quality) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_cameraInfoId, arg_quality.index]) as List?; + final List? replyList = await channel + .send([arg_cameraInfoId, arg_quality.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2723,12 +2799,16 @@ class FallbackStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, VideoQuality arg_quality, VideoResolutionFallbackRule arg_fallbackRule) async { + Future create(int arg_identifier, VideoQuality arg_quality, + VideoResolutionFallbackRule arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_quality.index, arg_fallbackRule.index]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_quality.index, + arg_fallbackRule.index + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2760,8 +2840,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_torch]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_torch]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2782,8 +2862,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_ratio]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_ratio]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2800,12 +2880,14 @@ class CameraControlHostApi { } } - Future startFocusAndMetering(int arg_identifier, int arg_focusMeteringActionId) async { + Future startFocusAndMetering( + int arg_identifier, int arg_focusMeteringActionId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_focusMeteringActionId]) as List?; + await channel.send([arg_identifier, arg_focusMeteringActionId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2844,12 +2926,14 @@ class CameraControlHostApi { } } - Future setExposureCompensationIndex(int arg_identifier, int arg_index) async { + Future setExposureCompensationIndex( + int arg_identifier, int arg_index) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_index]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2872,7 +2956,8 @@ abstract class CameraControlFlutterApi { void create(int identifier); - static void setup(CameraControlFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraControlFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlFlutterApi.create', codec, @@ -2882,7 +2967,7 @@ abstract class CameraControlFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2910,7 +2995,7 @@ class _FocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2928,12 +3013,14 @@ class FocusMeteringActionHostApi { static const MessageCodec codec = _FocusMeteringActionHostApiCodec(); - Future create(int arg_identifier, List arg_meteringPointInfos) async { + Future create(int arg_identifier, + List arg_meteringPointInfos) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_meteringPointInfos]) as List?; + await channel.send([arg_identifier, arg_meteringPointInfos]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2963,7 +3050,8 @@ class FocusMeteringResultHostApi { Future isFocusSuccessful(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -2994,7 +3082,8 @@ abstract class FocusMeteringResultFlutterApi { void create(int identifier); - static void setup(FocusMeteringResultFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(FocusMeteringResultFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringResultFlutterApi.create', codec, @@ -3004,7 +3093,7 @@ abstract class FocusMeteringResultFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3027,12 +3116,14 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size) async { + Future create( + int arg_identifier, double arg_x, double arg_y, double? arg_size) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_x, arg_y, arg_size]) as List?; + await channel.send([arg_identifier, arg_x, arg_y, arg_size]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3053,8 +3144,7 @@ class MeteringPointHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', diff --git a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index 2694c8a1548..f3062797cd5 100644 --- a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart @@ -14,7 +14,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; abstract class TestInstanceManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); /// Clear the native `InstanceManager`. @@ -22,15 +23,19 @@ abstract class TestInstanceManagerHostApi { /// This is typically only used after a hot restart. void clear(); - static void setup(TestInstanceManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestInstanceManagerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.clear(); return []; @@ -41,22 +46,27 @@ abstract class TestInstanceManagerHostApi { } abstract class TestJavaObjectHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void dispose(int identifier); - static void setup(TestJavaObjectHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestJavaObjectHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -70,7 +80,8 @@ abstract class TestJavaObjectHostApi { } abstract class TestCameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getSensorRotationDegrees(int identifier); @@ -81,17 +92,22 @@ abstract class TestCameraInfoHostApi { int getZoomState(int identifier); - static void setup(TestCameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraInfoHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec, + 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -106,11 +122,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getCameraState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -125,11 +144,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getExposureState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -144,11 +166,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getZoomState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -162,24 +187,29 @@ abstract class TestCameraInfoHostApi { } abstract class TestCameraSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? lensFacing); List filter(int identifier, List cameraInfoIds); - static void setup(TestCameraSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraSelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -195,19 +225,24 @@ abstract class TestCameraSelectorHostApi { 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null int.'); - final List? arg_cameraInfoIds = (args[1] as List?)?.cast(); + final List? arg_cameraInfoIds = + (args[1] as List?)?.cast(); assert(arg_cameraInfoIds != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List.'); - final List output = api.filter(arg_identifier!, arg_cameraInfoIds!); + final List output = + api.filter(arg_identifier!, arg_cameraInfoIds!); return [output]; }); } @@ -216,14 +251,16 @@ abstract class TestCameraSelectorHostApi { } abstract class TestProcessCameraProviderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future getInstance(); List getAvailableCameraInfos(int identifier); - int bindToLifecycle(int identifier, int cameraSelectorIdentifier, List useCaseIds); + int bindToLifecycle( + int identifier, int cameraSelectorIdentifier, List useCaseIds); bool isBound(int identifier, int useCaseIdentifier); @@ -231,15 +268,19 @@ abstract class TestProcessCameraProviderHostApi { void unbindAll(int identifier); - static void setup(TestProcessCameraProviderHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestProcessCameraProviderHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final int output = await api.getInstance(); return [output]; @@ -248,33 +289,42 @@ abstract class TestProcessCameraProviderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.'); - final List output = api.getAvailableCameraInfos(arg_identifier!); + final List output = + api.getAvailableCameraInfos(arg_identifier!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -282,10 +332,12 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_cameraSelectorIdentifier = (args[1] as int?); assert(arg_cameraSelectorIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null int.'); - final List? arg_useCaseIds = (args[2] as List?)?.cast(); + final List? arg_useCaseIds = + (args[2] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List.'); - final int output = api.bindToLifecycle(arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); + final int output = api.bindToLifecycle( + arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); return [output]; }); } @@ -295,11 +347,14 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -307,7 +362,8 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_useCaseIdentifier = (args[1] as int?); assert(arg_useCaseIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.'); - final bool output = api.isBound(arg_identifier!, arg_useCaseIdentifier!); + final bool output = + api.isBound(arg_identifier!, arg_useCaseIdentifier!); return [output]; }); } @@ -317,16 +373,20 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null int.'); - final List? arg_useCaseIds = (args[1] as List?)?.cast(); + final List? arg_useCaseIds = + (args[1] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List.'); api.unbind(arg_identifier!, arg_useCaseIds!); @@ -339,11 +399,14 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -357,24 +420,29 @@ abstract class TestProcessCameraProviderHostApi { } abstract class TestCameraHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getCameraInfo(int identifier); int getCameraControl(int identifier); - static void setup(TestCameraHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraHostApi.getCameraInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -389,11 +457,14 @@ abstract class TestCameraHostApi { 'dev.flutter.pigeon.CameraHostApi.getCameraControl', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -421,7 +492,7 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -430,29 +501,37 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { } abstract class TestSystemServicesHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestSystemServicesHostApiCodec(); - Future requestCameraPermissions(bool enableAudio); + Future requestCameraPermissions( + bool enableAudio); String getTempFilePath(String prefix, String suffix); - static void setup(TestSystemServicesHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestSystemServicesHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); final List args = (message as List?)!; final bool? arg_enableAudio = (args[0] as bool?); assert(arg_enableAudio != null, 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.'); - final CameraPermissionsErrorData? output = await api.requestCameraPermissions(arg_enableAudio!); + final CameraPermissionsErrorData? output = + await api.requestCameraPermissions(arg_enableAudio!); return [output]; }); } @@ -462,11 +541,14 @@ abstract class TestSystemServicesHostApi { 'dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); final List args = (message as List?)!; final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, @@ -483,26 +565,33 @@ abstract class TestSystemServicesHostApi { } abstract class TestDeviceOrientationManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void startListeningForDeviceOrientationChange(bool isFrontFacing, int sensorOrientation); + void startListeningForDeviceOrientationChange( + bool isFrontFacing, int sensorOrientation); void stopListeningForDeviceOrientationChange(); int getDefaultDisplayRotation(); - static void setup(TestDeviceOrientationManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestDeviceOrientationManagerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); final List args = (message as List?)!; final bool? arg_isFrontFacing = (args[0] as bool?); assert(arg_isFrontFacing != null, @@ -510,19 +599,24 @@ abstract class TestDeviceOrientationManagerHostApi { final int? arg_sensorOrientation = (args[1] as int?); assert(arg_sensorOrientation != null, 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.'); - api.startListeningForDeviceOrientationChange(arg_isFrontFacing!, arg_sensorOrientation!); + api.startListeningForDeviceOrientationChange( + arg_isFrontFacing!, arg_sensorOrientation!); return []; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.stopListeningForDeviceOrientationChange(); return []; @@ -531,12 +625,16 @@ abstract class TestDeviceOrientationManagerHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final int output = api.getDefaultDisplayRotation(); return [output]; @@ -561,7 +659,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -570,7 +668,8 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { } abstract class TestPreviewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestPreviewHostApiCodec(); void create(int identifier, int? rotation, int? resolutionSelectorId); @@ -583,17 +682,21 @@ abstract class TestPreviewHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestPreviewHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPreviewHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -610,11 +713,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -626,12 +732,16 @@ abstract class TestPreviewHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, + 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.releaseFlutterSurfaceTexture(); return []; @@ -643,11 +753,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -662,11 +775,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -683,7 +799,8 @@ abstract class TestPreviewHostApi { } abstract class TestVideoCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int withOutput(int videoOutputId); @@ -692,17 +809,21 @@ abstract class TestVideoCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestVideoCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestVideoCaptureHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.withOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); final List args = (message as List?)!; final int? arg_videoOutputId = (args[0] as int?); assert(arg_videoOutputId != null, @@ -717,11 +838,14 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.getOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -736,11 +860,14 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -757,10 +884,12 @@ abstract class TestVideoCaptureHostApi { } abstract class TestRecorderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); + void create( + int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); int getAspectRatio(int identifier); @@ -768,17 +897,21 @@ abstract class TestRecorderHostApi { int prepareRecording(int identifier, String path); - static void setup(TestRecorderHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecorderHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -786,7 +919,8 @@ abstract class TestRecorderHostApi { final int? arg_aspectRatio = (args[1] as int?); final int? arg_bitRate = (args[2] as int?); final int? arg_qualitySelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId); + api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, + arg_qualitySelectorId); return []; }); } @@ -796,11 +930,14 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.getAspectRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -812,14 +949,18 @@ abstract class TestRecorderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -834,11 +975,14 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -855,22 +999,27 @@ abstract class TestRecorderHostApi { } abstract class TestPendingRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int start(int identifier); - static void setup(TestPendingRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPendingRecordingHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingHostApi.start', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -884,7 +1033,8 @@ abstract class TestPendingRecordingHostApi { } abstract class TestRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void close(int identifier); @@ -895,17 +1045,21 @@ abstract class TestRecordingHostApi { void stop(int identifier); - static void setup(TestRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecordingHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -920,11 +1074,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.pause', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -939,11 +1096,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.resume', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -958,11 +1118,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.stop', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -976,10 +1139,12 @@ abstract class TestRecordingHostApi { } abstract class TestImageCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? targetRotation, int? flashMode, int? resolutionSelectorId); + void create(int identifier, int? targetRotation, int? flashMode, + int? resolutionSelectorId); void setFlashMode(int identifier, int flashMode); @@ -987,17 +1152,21 @@ abstract class TestImageCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageCaptureHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1005,7 +1174,8 @@ abstract class TestImageCaptureHostApi { final int? arg_targetRotation = (args[1] as int?); final int? arg_flashMode = (args[2] as int?); final int? arg_resolutionSelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_flashMode, + arg_resolutionSelectorId); return []; }); } @@ -1015,11 +1185,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1037,11 +1210,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1056,11 +1232,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1091,7 +1270,7 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1100,22 +1279,28 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestResolutionStrategyHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestResolutionStrategyHostApiCodec(); void create(int identifier, ResolutionInfo? boundSize, int? fallbackRule); - static void setup(TestResolutionStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1131,29 +1316,36 @@ abstract class TestResolutionStrategyHostApi { } abstract class TestResolutionSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? resolutionStrategyIdentifier, int? aspectRatioStrategyIdentifier); + void create(int identifier, int? resolutionStrategyIdentifier, + int? aspectRatioStrategyIdentifier); - static void setup(TestResolutionSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionSelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null, expected non-null int.'); final int? arg_resolutionStrategyIdentifier = (args[1] as int?); final int? arg_aspectRatioStrategyIdentifier = (args[2] as int?); - api.create(arg_identifier!, arg_resolutionStrategyIdentifier, arg_aspectRatioStrategyIdentifier); + api.create(arg_identifier!, arg_resolutionStrategyIdentifier, + arg_aspectRatioStrategyIdentifier); return []; }); } @@ -1162,22 +1354,27 @@ abstract class TestResolutionSelectorHostApi { } abstract class TestAspectRatioStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int preferredAspectRatio, int fallbackRule); - static void setup(TestAspectRatioStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestAspectRatioStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1188,7 +1385,8 @@ abstract class TestAspectRatioStrategyHostApi { final int? arg_fallbackRule = (args[2] as int?); assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); + api.create( + arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); return []; }); } @@ -1197,7 +1395,8 @@ abstract class TestAspectRatioStrategyHostApi { } abstract class TestImageAnalysisHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? targetRotation, int? resolutionSelectorId); @@ -1208,24 +1407,29 @@ abstract class TestImageAnalysisHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageAnalysisHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageAnalysisHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null, expected non-null int.'); final int? arg_targetRotation = (args[1] as int?); final int? arg_resolutionSelectorId = (args[2] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); + api.create( + arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); return []; }); } @@ -1235,11 +1439,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1257,11 +1464,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1276,11 +1486,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1297,22 +1510,27 @@ abstract class TestImageAnalysisHostApi { } abstract class TestAnalyzerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestAnalyzerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestAnalyzerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1326,22 +1544,27 @@ abstract class TestAnalyzerHostApi { } abstract class TestObserverHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestObserverHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestObserverHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1369,7 +1592,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1378,7 +1601,8 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { } abstract class TestLiveDataHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestLiveDataHostApiCodec(); void observe(int identifier, int observerIdentifier); @@ -1387,17 +1611,21 @@ abstract class TestLiveDataHostApi { int? getValue(int identifier, LiveDataSupportedTypeData type); - static void setup(TestLiveDataHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestLiveDataHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1415,11 +1643,14 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.removeObservers', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1434,16 +1665,20 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = + (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null LiveDataSupportedTypeData.'); final int? output = api.getValue(arg_identifier!, arg_type!); @@ -1455,24 +1690,29 @@ abstract class TestLiveDataHostApi { } abstract class TestImageProxyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); List getPlanes(int identifier); void close(int identifier); - static void setup(TestImageProxyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageProxyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyHostApi.getPlanes', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1487,11 +1727,14 @@ abstract class TestImageProxyHostApi { 'dev.flutter.pigeon.ImageProxyHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1522,9 +1765,9 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1533,33 +1776,41 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { } abstract class TestQualitySelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestQualitySelectorHostApiCodec(); - void create(int identifier, List videoQualityDataList, int? fallbackStrategyId); + void create(int identifier, List videoQualityDataList, + int? fallbackStrategyId); ResolutionInfo getResolution(int cameraInfoId, VideoQuality quality); - static void setup(TestQualitySelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestQualitySelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null int.'); - final List? arg_videoQualityDataList = (args[1] as List?)?.cast(); + final List? arg_videoQualityDataList = + (args[1] as List?)?.cast(); assert(arg_videoQualityDataList != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null List.'); final int? arg_fallbackStrategyId = (args[2] as int?); - api.create(arg_identifier!, arg_videoQualityDataList!, arg_fallbackStrategyId); + api.create(arg_identifier!, arg_videoQualityDataList!, + arg_fallbackStrategyId); return []; }); } @@ -1569,19 +1820,24 @@ abstract class TestQualitySelectorHostApi { 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); final List args = (message as List?)!; final int? arg_cameraInfoId = (args[0] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null int.'); - final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = + args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null VideoQuality.'); - final ResolutionInfo output = api.getResolution(arg_cameraInfoId!, arg_quality!); + final ResolutionInfo output = + api.getResolution(arg_cameraInfoId!, arg_quality!); return [output]; }); } @@ -1590,30 +1846,39 @@ abstract class TestQualitySelectorHostApi { } abstract class TestFallbackStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, VideoQuality quality, VideoResolutionFallbackRule fallbackRule); + void create(int identifier, VideoQuality quality, + VideoResolutionFallbackRule fallbackRule); - static void setup(TestFallbackStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFallbackStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null int.'); - final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = + args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoQuality.'); - final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null ? null : VideoResolutionFallbackRule.values[args[2] as int]; + final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null + ? null + : VideoResolutionFallbackRule.values[args[2] as int]; assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoResolutionFallbackRule.'); api.create(arg_identifier!, arg_quality!, arg_fallbackRule!); @@ -1625,7 +1890,8 @@ abstract class TestFallbackStrategyHostApi { } abstract class TestCameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future enableTorch(int identifier, bool torch); @@ -1638,17 +1904,21 @@ abstract class TestCameraControlHostApi { Future setExposureCompensationIndex(int identifier, int index); - static void setup(TestCameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraControlHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1666,11 +1936,14 @@ abstract class TestCameraControlHostApi { 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1685,14 +1958,18 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, + 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1700,21 +1977,26 @@ abstract class TestCameraControlHostApi { final int? arg_focusMeteringActionId = (args[1] as int?); assert(arg_focusMeteringActionId != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null, expected non-null int.'); - final int? output = await api.startFocusAndMetering(arg_identifier!, arg_focusMeteringActionId!); + final int? output = await api.startFocusAndMetering( + arg_identifier!, arg_focusMeteringActionId!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', codec, + 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1726,14 +2008,18 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1741,7 +2027,8 @@ abstract class TestCameraControlHostApi { final int? arg_index = (args[1] as int?); assert(arg_index != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null, expected non-null int.'); - final int? output = await api.setExposureCompensationIndex(arg_identifier!, arg_index!); + final int? output = await api.setExposureCompensationIndex( + arg_identifier!, arg_index!); return [output]; }); } @@ -1764,7 +2051,7 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1773,27 +2060,34 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { } abstract class TestFocusMeteringActionHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestFocusMeteringActionHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestFocusMeteringActionHostApiCodec(); void create(int identifier, List meteringPointInfos); - static void setup(TestFocusMeteringActionHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringActionHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null int.'); - final List? arg_meteringPointInfos = (args[1] as List?)?.cast(); + final List? arg_meteringPointInfos = + (args[1] as List?)?.cast(); assert(arg_meteringPointInfos != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null List.'); api.create(arg_identifier!, arg_meteringPointInfos!); @@ -1805,22 +2099,28 @@ abstract class TestFocusMeteringActionHostApi { } abstract class TestFocusMeteringResultHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); bool isFocusSuccessful(int identifier); - static void setup(TestFocusMeteringResultHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringResultHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1834,24 +2134,29 @@ abstract class TestFocusMeteringResultHostApi { } abstract class TestMeteringPointHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, double x, double y, double? size); double getDefaultPointSize(); - static void setup(TestMeteringPointHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestMeteringPointHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1873,9 +2178,12 @@ abstract class TestMeteringPointHostApi { 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final double output = api.getDefaultPointSize(); return [output]; From 5fe2976ed07b6619852714419803f0614f6c8fca Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Feb 2024 13:39:54 -0800 Subject: [PATCH 06/23] Self review --- .../lib/src/android_camera_camerax.dart | 12 ++++++------ .../lib/src/focus_metering_action.dart | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index c08762faa8d..6557203deef 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -753,7 +753,7 @@ class AndroidCameraCameraX extends CameraPlatform { if (videoOutputPath == null) { // Stop the current active recording as we will be unable to complete it // in this error case. - await recording!.close(); + unawaited(recording!.close()); recording = null; pendingRecording = null; throw CameraException( @@ -762,7 +762,7 @@ class AndroidCameraCameraX extends CameraPlatform { 'while reporting success. The platform should always ' 'return a valid path or report an error.'); } - await recording!.close(); + unawaited(recording!.close()); recording = null; pendingRecording = null; return XFile(videoOutputPath!); @@ -1088,8 +1088,8 @@ class AndroidCameraCameraX extends CameraPlatform { .where(((MeteringPoint, int?) meteringPointInfo) => // meteringPointInfo may technically include points without a // mode specified, but this logic is safe because this plugin - // only explicitly uses FocusMeteringAction.flagAe or - // FocusMeteringAction.flagAf. + // only uses points that explicitly have mode + // FocusMeteringAction.flagAe or FocusMeteringAction.flagAf. meteringPointInfo.$2 != meteringMode) .toList(); @@ -1119,8 +1119,8 @@ class AndroidCameraCameraX extends CameraPlatform { .where(((MeteringPoint, int?) meteringPointInfo) => // meteringPointInfo may technically include points without a // mode specified, but this logic is safe because this plugin - // only explicitly uses FocusMeteringAction.flagAe or - // FocusMeteringAction.flagAf. + // only uses points that explicitly have mode + // FocusMeteringAction.flagAe or FocusMeteringAction.flagAf. meteringPointInfo.$2 != meteringMode) .toList(); } diff --git a/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart index bd2847f1ec2..fe09ebc0443 100644 --- a/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart +++ b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart @@ -45,7 +45,8 @@ class FocusMeteringAction extends JavaObject { late final _FocusMeteringActionHostApiImpl _api; - /// The requested [MeteringPoint]s and modes those points are relevant to. + /// The requested [MeteringPoint]s and modes that are relevant to each of those + /// points. final List<(MeteringPoint meteringPoint, int? meteringMode)> meteringPointInfos; From e41a825b8942b910f4225e742dec89be6b75a78c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Feb 2024 16:14:57 -0800 Subject: [PATCH 07/23] Add tests --- .../camerax/CameraControlHostApiImpl.java | 6 + .../plugins/camerax/CameraControlTest.java | 53 +- .../lib/src/android_camera_camerax.dart | 8 +- .../lib/src/camera_control.dart | 2 + .../lib/src/camerax_proxy.dart | 21 + .../test/android_camera_camerax_test.dart | 466 +++++++++++++++++- .../test/camera_control_test.dart | 114 ++++- .../test/camera_control_test.mocks.dart | 31 +- .../test/focus_metering_action_test.dart | 3 + .../focus_metering_action_test.mocks.dart | 2 +- .../focus_metering_result_test.mocks.dart | 2 +- .../test/metering_point_test.mocks.dart | 2 +- 12 files changed, 669 insertions(+), 41 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java index 8f7794f898f..fdc80d3b628 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java @@ -100,6 +100,9 @@ public void onFailure(Throwable t) { * *

Will trigger an auto focus action and enable auto focus/auto exposure/auto white balance * metering regions. + * + *

Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was + * canceled. */ public void startFocusAndMetering( @NonNull CameraControl cameraControl, @@ -160,6 +163,9 @@ public void onFailure(Throwable t) { *

The exposure compensation value set on the camera must be within the range of {@code * ExposureState#getExposureCompensationRange()} for the current {@code ExposureState} for the * call to succeed. + * + *

Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was + * canceled. */ public void setExposureCompensationIndex( @NonNull CameraControl cameraControl, @NonNull Long index, @NonNull Result result) { diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java index 42ace7a51fb..fa956d387e1 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java @@ -133,7 +133,7 @@ public void setZoomRatio_setsZoomAsExpected() { FutureCallback successfulSetZoomRatioCallback = futureCallbackCaptor.getValue(); successfulSetZoomRatioCallback.onSuccess(mock(Void.class)); - verify(successfulMockResult).success(null); + verify(successfulMockResult).success(null); // Test failed behavior. @SuppressWarnings("unchecked") @@ -149,6 +149,21 @@ public void setZoomRatio_setsZoomAsExpected() { failedSetZoomRatioCallback.onFailure(testThrowable); verify(failedMockResult).error(testThrowable); + + // Test response to canceled operation. + @SuppressWarnings("unchecked") + final GeneratedCameraXLibrary.Result canceledOpResult = + mock(GeneratedCameraXLibrary.Result.class); + final CameraControl.OperationCanceledException canceledOpThrowable = mock(CameraControl.OperationCanceledException.class); + cameraControlHostApiImpl.setZoomRatio(cameraControlIdentifier, zoomRatio, canceledOpResult); + mockedFutures.verify( + () -> Futures.addCallback(eq(setZoomRatioFuture), futureCallbackCaptor.capture(), any())); + mockedFutures.clearInvocations(); + + FutureCallback canceledOpCallback = futureCallbackCaptor.getValue(); + + canceledOpCallback.onFailure(canceledOpThrowable); + verify(canceledOpResult).success(null); } } @@ -212,6 +227,24 @@ public void startFocusAndMetering_startsFocusAndMeteringAsExpected() { failedCallback.onFailure(testThrowable); verify(failedMockResult).error(testThrowable); + + // Test response to canceled operation. + @SuppressWarnings("unchecked") + final GeneratedCameraXLibrary.Result canceledOpResult = + mock(GeneratedCameraXLibrary.Result.class); + final CameraControl.OperationCanceledException canceledOpThrowable = mock(CameraControl.OperationCanceledException.class); + cameraControlHostApiImpl.startFocusAndMetering( + cameraControlIdentifier, mockActionId, canceledOpResult); + mockedFutures.verify( + () -> + Futures.addCallback( + eq(startFocusAndMeteringFuture), futureCallbackCaptor.capture(), any())); + mockedFutures.clearInvocations(); + + FutureCallback canceledOpCallback = futureCallbackCaptor.getValue(); + + canceledOpCallback.onFailure(canceledOpThrowable); + verify(canceledOpResult).success(null); } } @@ -326,6 +359,24 @@ public void setExposureCompensationIndex_setsExposureCompensationIndexAsExpected failedCallback.onFailure(testThrowable); verify(failedMockResult).error(testThrowable); + + // Test response to canceled operation. + @SuppressWarnings("unchecked") + final GeneratedCameraXLibrary.Result canceledOpResult = + mock(GeneratedCameraXLibrary.Result.class); + final CameraControl.OperationCanceledException canceledOpThrowable = mock(CameraControl.OperationCanceledException.class); + cameraControlHostApiImpl.setExposureCompensationIndex( + cameraControlIdentifier, index, canceledOpResult); + mockedFutures.verify( + () -> + Futures.addCallback( + eq(setExposureCompensationIndexFuture), futureCallbackCaptor.capture(), any())); + mockedFutures.clearInvocations(); + + FutureCallback canceledOpCallback = futureCallbackCaptor.getValue(); + + canceledOpCallback.onFailure(canceledOpThrowable); + verify(canceledOpResult).success(null); } } diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 6557203deef..28b3f9a41e4 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -189,6 +189,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// The currently set [FocusMeteringAction] used to enable auto-focus and /// auto-exposure. + @visibleForTesting FocusMeteringAction? currentFocusMeteringAction; /// Error code indicating that exposure compensation is not supported by @@ -661,7 +662,6 @@ class AndroidCameraCameraX extends CameraPlatform { /// respectively. @override Future setFlashMode(int cameraId, FlashMode mode) async { - CameraControl? cameraControl; // Turn off torch mode if it is enabled and not being redundantly set. if (mode != FlashMode.torch && torchEnabled) { await cameraControl!.enableTorch(false); @@ -1101,7 +1101,7 @@ class AndroidCameraCameraX extends CameraPlatform { } currentFocusMeteringAction = - FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); + proxy.createFocusMeteringAction(newMeteringPointInfos); } else if (meteringPoint.x < 0 || meteringPoint.x > 1 || meteringPoint.y < 0 && meteringPoint.y > 1) { @@ -1125,10 +1125,10 @@ class AndroidCameraCameraX extends CameraPlatform { .toList(); } final MeteringPoint newMeteringPoint = - MeteringPoint(x: meteringPoint.x, y: meteringPoint.y); + proxy.createMeteringPoint(meteringPoint.x, meteringPoint.y); newMeteringPointInfos.add((newMeteringPoint, meteringMode)); currentFocusMeteringAction = - FocusMeteringAction(meteringPointInfos: newMeteringPointInfos); + proxy.createFocusMeteringAction(newMeteringPointInfos); } await cameraControl!.startFocusAndMetering(currentFocusMeteringAction!); diff --git a/packages/camera/camera_android_camerax/lib/src/camera_control.dart b/packages/camera/camera_android_camerax/lib/src/camera_control.dart index 89a5118cc7b..a233011975f 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -182,6 +182,8 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { } on PlatformException catch (e) { SystemServices.cameraErrorStreamController.add(e.message ?? 'Setting the camera exposure compensation index failed.'); + // Surfacing error to plugin layer to maintain consistency of + // setExposureOffset implementation across platform implementations. rethrow; } } diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart index 87d3680ff2c..5cfb216a774 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart @@ -10,9 +10,11 @@ import 'camera_state.dart'; import 'camerax_library.g.dart'; import 'device_orientation_manager.dart'; import 'fallback_strategy.dart'; +import 'focus_metering_action.dart'; import 'image_analysis.dart'; import 'image_capture.dart'; import 'image_proxy.dart'; +import 'metering_point.dart'; import 'observer.dart'; import 'preview.dart'; import 'process_camera_provider.dart'; @@ -49,6 +51,8 @@ class CameraXProxy { _startListeningForDeviceOrientationChange, this.setPreviewSurfaceProvider = _setPreviewSurfaceProvider, this.getDefaultDisplayRotation = _getDefaultDisplayRotation, + this.createMeteringPoint = _createMeteringPoint, + this.createFocusMeteringAction = _createFocusMeteringAction, }); /// Returns a [ProcessCameraProvider] instance. @@ -137,6 +141,14 @@ class CameraXProxy { /// rotation constants. Future Function() getDefaultDisplayRotation; + /// Returns a [MeteringPoint] with the specified coordinates. + MeteringPoint Function(double x, double y) createMeteringPoint; + + /// Returns a [FocusMeteringAction] based on the specified metering points + /// and their modes. + FocusMeteringAction Function(List<(MeteringPoint, int?)> meteringPointInfos) + createFocusMeteringAction; + static Future _getProcessCameraProvider() { return ProcessCameraProvider.getInstance(); } @@ -239,4 +251,13 @@ class CameraXProxy { static Future _getDefaultDisplayRotation() async { return DeviceOrientationManager.getDefaultDisplayRotation(); } + + static MeteringPoint _createMeteringPoint(double x, double y) { + return MeteringPoint(x: x, y: y); + } + + static FocusMeteringAction _createFocusMeteringAction( + List<(MeteringPoint, int?)> meteringPointInfos) { + return FocusMeteringAction(meteringPointInfos: meteringPointInfos); + } } diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 415c5ee6448..02c1a643bbb 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:math' show Point; import 'package:async/async.dart'; import 'package:camera_android_camerax/camera_android_camerax.dart'; @@ -18,10 +19,12 @@ import 'package:camera_android_camerax/src/camerax_proxy.dart'; import 'package:camera_android_camerax/src/device_orientation_manager.dart'; import 'package:camera_android_camerax/src/exposure_state.dart'; import 'package:camera_android_camerax/src/fallback_strategy.dart'; +import 'package:camera_android_camerax/src/focus_metering_action.dart'; import 'package:camera_android_camerax/src/image_analysis.dart'; import 'package:camera_android_camerax/src/image_capture.dart'; import 'package:camera_android_camerax/src/image_proxy.dart'; import 'package:camera_android_camerax/src/live_data.dart'; +import 'package:camera_android_camerax/src/metering_point.dart'; import 'package:camera_android_camerax/src/observer.dart'; import 'package:camera_android_camerax/src/pending_recording.dart'; import 'package:camera_android_camerax/src/plane_proxy.dart'; @@ -38,7 +41,8 @@ import 'package:camera_android_camerax/src/use_case.dart'; import 'package:camera_android_camerax/src/video_capture.dart'; import 'package:camera_android_camerax/src/zoom_state.dart'; import 'package:camera_platform_interface/camera_platform_interface.dart'; -import 'package:flutter/services.dart' show DeviceOrientation, Uint8List; +import 'package:flutter/services.dart' + show DeviceOrientation, PlatformException, Uint8List; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; @@ -113,6 +117,14 @@ void main() { return cameraClosingEventSent && cameraErrorSent; } + /// [CameraXProxy] for testing exposure and focus related controls. + CameraXProxy getProxyForExposureAndFocus() => CameraXProxy( + createMeteringPoint: (double x, double y) => + MeteringPoint.detached(x: x, y: y), + createFocusMeteringAction: (List<(MeteringPoint, int?)> + meteringPointInfos) => + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos)); + test('Should fetch CameraDescription instances for available cameras', () async { // Arrange @@ -331,6 +343,7 @@ void main() { final MockVideoCapture mockVideoCapture = MockVideoCapture(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final MockCameraControl mockCameraControl = MockCameraControl(); // Tell plugin to create mock/detached objects and stub method calls for the // testing of createCamera. @@ -377,6 +390,8 @@ void main() { when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => MockLiveCameraState()); + when(mockCamera.getCameraControl()) + .thenAnswer((_) async => mockCameraControl); camera.processCameraProvider = mockProcessCameraProvider; await camera.createCamera(testCameraDescription, testResolutionPreset, @@ -389,6 +404,9 @@ void main() { // Verify the camera's CameraInfo instance got updated. expect(camera.cameraInfo, equals(mockCameraInfo)); + // Verify camera's CameraControl instance gotu pdated. + expect(camera.cameraControl, equals(mockCameraControl)); + // Verify preview has been marked as bound to the camera lifecycle by // createCamera. expect(camera.previewInitiallyBound, isTrue); @@ -938,6 +956,7 @@ void main() { MockProcessCameraProvider(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final MockCameraControl mockCameraControl = MockCameraControl(); final MockLiveCameraState mockLiveCameraState = MockLiveCameraState(); // Set directly for test versus calling createCamera. @@ -959,6 +978,8 @@ void main() { when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => mockLiveCameraState); + when(mockCamera.getCameraControl()) + .thenAnswer((_) async => mockCameraControl); await camera.resumePreview(78); @@ -972,6 +993,7 @@ void main() { as Observer), isTrue); expect(camera.cameraInfo, equals(mockCameraInfo)); + expect(camera.cameraControl, equals(mockCameraControl)); }); test( @@ -1396,18 +1418,14 @@ void main() { () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 77; - final MockCameraControl mockCameraControl = MockCameraControl(); // Set directly for test versus calling createCamera. camera.imageCapture = MockImageCapture(); - camera.camera = MockCamera(); + camera.cameraControl = MockCameraControl(); // Ignore setting target rotation for this test; tested seprately. camera.captureOrientationLocked = true; - when(camera.camera!.getCameraControl()) - .thenAnswer((_) async => mockCameraControl); - await camera.setFlashMode(cameraId, FlashMode.torch); await camera.takePicture(cameraId); verify(camera.imageCapture!.setFlashMode(ImageCapture.flashModeOff)); @@ -1422,14 +1440,11 @@ void main() { // Set directly for test versus calling createCamera. camera.imageCapture = MockImageCapture(); - camera.camera = MockCamera(); + camera.cameraControl = mockCameraControl; // Ignore setting target rotation for this test; tested seprately. camera.captureOrientationLocked = true; - when(camera.camera!.getCameraControl()) - .thenAnswer((_) async => mockCameraControl); - for (final FlashMode flashMode in FlashMode.values) { await camera.setFlashMode(cameraId, flashMode); @@ -1463,10 +1478,7 @@ void main() { final MockCameraControl mockCameraControl = MockCameraControl(); // Set directly for test versus calling createCamera. - camera.camera = MockCamera(); - - when(camera.camera!.getCameraControl()) - .thenAnswer((_) async => mockCameraControl); + camera.cameraControl = mockCameraControl; await camera.setFlashMode(cameraId, FlashMode.torch); @@ -1481,10 +1493,7 @@ void main() { final MockCameraControl mockCameraControl = MockCameraControl(); // Set directly for test versus calling createCamera. - camera.camera = MockCamera(); - - when(camera.camera!.getCameraControl()) - .thenAnswer((_) async => mockCameraControl); + camera.cameraControl = mockCameraControl; for (final FlashMode flashMode in FlashMode.values) { camera.torchEnabled = true; @@ -1557,6 +1566,26 @@ void main() { expect(await camera.getExposureOffsetStepSize(55), 0.2); }); + test( + 'getExposureOffsetStepSize throws exception when exposure compensation not supported on device', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final ExposureState exposureState = ExposureState.detached( + exposureCompensationRange: + ExposureCompensationRange(minCompensation: 0, maxCompensation: 0), + exposureCompensationStep: 0); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = mockCameraInfo; + + when(mockCameraInfo.getExposureState()) + .thenAnswer((_) async => exposureState); + + expect(() => camera.getExposureOffsetStepSize(25), + throwsA(isA())); + }); + test('getMaxZoomLevel returns expected exposure offset', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); @@ -1600,10 +1629,7 @@ void main() { final MockCameraControl mockCameraControl = MockCameraControl(); // Set directly for test versus calling createCamera. - camera.camera = MockCamera(); - - when(camera.camera!.getCameraControl()) - .thenAnswer((_) async => mockCameraControl); + camera.cameraControl = mockCameraControl; await camera.setZoomLevel(cameraId, zoomRatio); @@ -1924,4 +1950,400 @@ void main() { await camera.unlockCaptureOrientation(cameraId); expect(camera.captureOrientationLocked, isFalse); }); + + test( + 'setExposurePoint clears current auto-exposure metering point as expected', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 93; + final MockCameraControl mockCameraControl = MockCameraControl(); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + + // Verify nothing happens if no current focus and metering action has been + // enabled. + await camera.setExposurePoint(cameraId, null); + verifyNever(mockCameraControl.startFocusAndMetering(any)); + verifyNever(mockCameraControl.cancelFocusAndMetering()); + + // Verify current auto-exposure metering point is removed if previously set. + final (MeteringPoint, int?) autofocusMeteringPointInfo = + (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAf); + List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ + (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAe), + autofocusMeteringPointInfo + ]; + + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setExposurePoint(cameraId, null); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(1)); + expect( + capturedMeteringPointInfos.first, equals(autofocusMeteringPointInfo)); + + // Verify current focus and metering action is cleared if only previously + // set metering point was for auto-exposure. + meteringPointInfos = <(MeteringPoint, int?)>[ + (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAe) + ]; + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setExposurePoint(cameraId, null); + + verify(mockCameraControl.cancelFocusAndMetering()); + }); + + test('setExposurePoint throws CameraException if invalid point specified', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 23; + final MockCameraControl mockCameraControl = MockCameraControl(); + const Point invalidExposurePoint = Point(3, -1); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + + expect(() => camera.setExposurePoint(cameraId, invalidExposurePoint), + throwsA(isA())); + }); + + test( + 'setExposurePoint adds new exposure point to focus metering action to start as expected when previous metering points have been set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 9; + final MockCameraControl mockCameraControl = MockCameraControl(); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + + // Verify current auto-exposure metering point is removed if previously set. + double exposurePointX = 0.8; + double exposurePointY = 0.1; + Point exposurePoint = Point(exposurePointX, exposurePointY); + final (MeteringPoint, int?) autofocusMeteringPointInfo = + (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAf); + List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ + (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAe), + autofocusMeteringPointInfo + ]; + + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setExposurePoint(cameraId, exposurePoint); + + VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(2)); + expect( + capturedMeteringPointInfos.first, equals(autofocusMeteringPointInfo)); + expect(capturedMeteringPointInfos[1].$1.x, equals(exposurePointX)); + expect(capturedMeteringPointInfos[1].$1.y, equals(exposurePointY)); + expect( + capturedMeteringPointInfos[1].$2, equals(FocusMeteringAction.flagAe)); + + // Verify exposure point is set when no auto-exposure metering point + // previously set, but an auto-focus point metering point has been. + exposurePointX = 0.2; + exposurePointY = 0.9; + exposurePoint = Point(exposurePointX, exposurePointY); + meteringPointInfos = <(MeteringPoint, int?)>[autofocusMeteringPointInfo]; + + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setExposurePoint(cameraId, exposurePoint); + + verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + capturedAction = verificationResult.captured.single as FocusMeteringAction; + capturedMeteringPointInfos = capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(2)); + expect( + capturedMeteringPointInfos.first, equals(autofocusMeteringPointInfo)); + expect(capturedMeteringPointInfos[1].$1.x, equals(exposurePointX)); + expect(capturedMeteringPointInfos[1].$1.y, equals(exposurePointY)); + expect( + capturedMeteringPointInfos[1].$2, equals(FocusMeteringAction.flagAe)); + }); + + test( + 'setExposurePoint adds new exposure point to focus metering action to start as expected when no previous metering points have been set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 19; + final MockCameraControl mockCameraControl = MockCameraControl(); + const double exposurePointX = 0.8; + const double exposurePointY = 0.1; + const Point exposurePoint = + Point(exposurePointX, exposurePointY); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + camera.currentFocusMeteringAction = null; + + await camera.setExposurePoint(cameraId, exposurePoint); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.first.$1.x, equals(exposurePointX)); + expect(capturedMeteringPointInfos.first.$1.y, equals(exposurePointY)); + expect(capturedMeteringPointInfos.first.$2, + equals(FocusMeteringAction.flagAe)); + }); + + test( + 'setExposureOffset throws exception if exposure compensation not supported', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 6; + const double offset = 2; + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final ExposureState exposureState = ExposureState.detached( + exposureCompensationRange: + ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), + exposureCompensationStep: 0); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = mockCameraInfo; + + when(mockCameraInfo.getExposureState()) + .thenAnswer((_) async => exposureState); + + expect(() => camera.setExposureOffset(cameraId, offset), + throwsA(isA())); + }); + + test( + 'setExposureOffset throws exception if exposure compensation could not be set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 11; + const double offset = 3; + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final CameraControl mockCameraControl = MockCameraControl(); + final ExposureState exposureState = ExposureState.detached( + exposureCompensationRange: + ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), + exposureCompensationStep: 0.2); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = mockCameraInfo; + camera.cameraControl = mockCameraControl; + + when(mockCameraInfo.getExposureState()) + .thenAnswer((_) async => exposureState); + when(mockCameraControl.setExposureCompensationIndex(15)).thenThrow( + PlatformException( + code: 'TEST_ERROR', + message: + 'This is a test error message indicating exposure offset could not be set.')); + + expect(() => camera.setExposureOffset(cameraId, offset), + throwsA(isA())); + }); + + test( + 'setExposureOffset behaves as expected to successful attempt to set exposure compensation index', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 11; + const double offset = 3; + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final CameraControl mockCameraControl = MockCameraControl(); + final ExposureState exposureState = ExposureState.detached( + exposureCompensationRange: + ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), + exposureCompensationStep: 0.2); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = mockCameraInfo; + camera.cameraControl = mockCameraControl; + + when(mockCameraInfo.getExposureState()) + .thenAnswer((_) async => exposureState); + + // Exposure index * exposure offset step size = exposure offset, i.e. + // 15 * 0.2 = 3. + expect(await camera.setExposureOffset(cameraId, offset), equals(3)); + }); + + test('setFocusPoint clears current auto-exposure metering point as expected', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 93; + final MockCameraControl mockCameraControl = MockCameraControl(); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + + // Verify nothing happens if no current focus and metering action has been + // enabled. + await camera.setFocusPoint(cameraId, null); + verifyNever(mockCameraControl.startFocusAndMetering(any)); + verifyNever(mockCameraControl.cancelFocusAndMetering()); + + // Verify current auto-exposure metering point is removed if previously set. + final (MeteringPoint, int?) autoexposureMeteringPointInfo = + (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAe); + List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ + (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAf), + autoexposureMeteringPointInfo + ]; + + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setFocusPoint(cameraId, null); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.first, + equals(autoexposureMeteringPointInfo)); + + // Verify current focus and metering action is cleared if only previously + // set metering point was for auto-exposure. + meteringPointInfos = <(MeteringPoint, int?)>[ + (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAf) + ]; + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setFocusPoint(cameraId, null); + + verify(mockCameraControl.cancelFocusAndMetering()); + }); + + test('setFocusPoint throws CameraException if invalid point specified', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 23; + final MockCameraControl mockCameraControl = MockCameraControl(); + const Point invalidFocusPoint = Point(-3, 1); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + + expect(() => camera.setFocusPoint(cameraId, invalidFocusPoint), + throwsA(isA())); + }); + + test( + 'setFocusPoint adds new exposure point to focus metering action to start as expected when previous metering points have been set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 9; + final MockCameraControl mockCameraControl = MockCameraControl(); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + + // Verify current auto-exposure metering point is removed if previously set. + double focusPointX = 0.8; + double focusPointY = 0.1; + Point exposurePoint = Point(focusPointX, focusPointY); + final (MeteringPoint, int?) autoExposureMeteringPointInfo = + (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAe); + List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ + (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAf), + autoExposureMeteringPointInfo + ]; + + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setFocusPoint(cameraId, exposurePoint); + + VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(2)); + expect(capturedMeteringPointInfos.first, + equals(autoExposureMeteringPointInfo)); + expect(capturedMeteringPointInfos[1].$1.x, equals(focusPointX)); + expect(capturedMeteringPointInfos[1].$1.y, equals(focusPointY)); + expect( + capturedMeteringPointInfos[1].$2, equals(FocusMeteringAction.flagAf)); + + // Verify exposure point is set when no auto-exposure metering point + // previously set, but an auto-focus point metering point has been. + focusPointX = 0.2; + focusPointY = 0.9; + exposurePoint = Point(focusPointX, focusPointY); + meteringPointInfos = <(MeteringPoint, int?)>[autoExposureMeteringPointInfo]; + + camera.currentFocusMeteringAction = + FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); + + await camera.setFocusPoint(cameraId, exposurePoint); + + verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + capturedAction = verificationResult.captured.single as FocusMeteringAction; + capturedMeteringPointInfos = capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(2)); + expect(capturedMeteringPointInfos.first, + equals(autoExposureMeteringPointInfo)); + expect(capturedMeteringPointInfos[1].$1.x, equals(focusPointX)); + expect(capturedMeteringPointInfos[1].$1.y, equals(focusPointY)); + expect( + capturedMeteringPointInfos[1].$2, equals(FocusMeteringAction.flagAf)); + }); + + test( + 'setFocusPoint adds new exposure point to focus metering action to start as expected when no previous metering points have been set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 19; + final MockCameraControl mockCameraControl = MockCameraControl(); + const double focusPointX = 0.8; + const double focusPointY = 0.1; + const Point exposurePoint = Point(focusPointX, focusPointY); + + camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); + camera.currentFocusMeteringAction = null; + + await camera.setFocusPoint(cameraId, exposurePoint); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.first.$1.x, equals(focusPointX)); + expect(capturedMeteringPointInfos.first.$1.y, equals(focusPointY)); + expect(capturedMeteringPointInfos.first.$2, + equals(FocusMeteringAction.flagAf)); + }); } diff --git a/packages/camera/camera_android_camerax/test/camera_control_test.dart b/packages/camera/camera_android_camerax/test/camera_control_test.dart index 63c7a7d9aa9..22ba8aaf247 100644 --- a/packages/camera/camera_android_camerax/test/camera_control_test.dart +++ b/packages/camera/camera_android_camerax/test/camera_control_test.dart @@ -6,6 +6,7 @@ import 'package:camera_android_camerax/src/camera_control.dart'; import 'package:camera_android_camerax/src/focus_metering_action.dart'; import 'package:camera_android_camerax/src/focus_metering_result.dart'; import 'package:camera_android_camerax/src/instance_manager.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; @@ -13,7 +14,11 @@ import 'package:mockito/mockito.dart'; import 'camera_control_test.mocks.dart'; import 'test_camerax_library.g.dart'; -@GenerateMocks([TestCameraControlHostApi, TestInstanceManagerHostApi]) +@GenerateMocks([ + TestCameraControlHostApi, + TestInstanceManagerHostApi, + FocusMeteringAction +]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -90,8 +95,7 @@ void main() { instanceManager: instanceManager, ); const int cameraControlIdentifier = 75; - final FocusMeteringAction action = - FocusMeteringAction.detached(instanceManager: instanceManager); + final FocusMeteringAction action = MockFocusMeteringAction(); const int actionId = 5; final FocusMeteringResult result = FocusMeteringResult.detached(instanceManager: instanceManager); @@ -105,8 +109,7 @@ void main() { instanceManager.addHostCreatedInstance( action, actionId, - onCopy: (_) => - FocusMeteringAction.detached(instanceManager: instanceManager), + onCopy: (_) => MockFocusMeteringAction(), ); instanceManager.addHostCreatedInstance( result, @@ -122,6 +125,41 @@ void main() { verify(mockApi.startFocusAndMetering(cameraControlIdentifier, actionId)); }); + test('startFocusAndMetering returns null result if operation was canceled', + () async { + final MockTestCameraControlHostApi mockApi = + MockTestCameraControlHostApi(); + TestCameraControlHostApi.setup(mockApi); + + final InstanceManager instanceManager = InstanceManager( + onWeakReferenceRemoved: (_) {}, + ); + + final CameraControl cameraControl = CameraControl.detached( + instanceManager: instanceManager, + ); + const int cameraControlIdentifier = 75; + final FocusMeteringAction action = MockFocusMeteringAction(); + const int actionId = 5; + + instanceManager.addHostCreatedInstance( + cameraControl, + cameraControlIdentifier, + onCopy: (_) => CameraControl.detached(instanceManager: instanceManager), + ); + instanceManager.addHostCreatedInstance( + action, + actionId, + onCopy: (_) => MockFocusMeteringAction(), + ); + + when(mockApi.startFocusAndMetering(cameraControlIdentifier, actionId)) + .thenAnswer((_) => Future.value()); + + expect(await cameraControl.startFocusAndMetering(action), isNull); + verify(mockApi.startFocusAndMetering(cameraControlIdentifier, actionId)); + }); + test( 'cancelFocusAndMetering makes call on Java side to cancel focus and metering', () async { @@ -182,6 +220,72 @@ void main() { mockApi.setExposureCompensationIndex(cameraControlIdentifier, index)); }); + test( + 'setExposureCompensationIndex returns null when operation was canceled', + () async { + final MockTestCameraControlHostApi mockApi = + MockTestCameraControlHostApi(); + TestCameraControlHostApi.setup(mockApi); + + final InstanceManager instanceManager = InstanceManager( + onWeakReferenceRemoved: (_) {}, + ); + + final CameraControl cameraControl = CameraControl.detached( + instanceManager: instanceManager, + ); + const int cameraControlIdentifier = 40; + + instanceManager.addHostCreatedInstance( + cameraControl, + cameraControlIdentifier, + onCopy: (_) => CameraControl.detached(instanceManager: instanceManager), + ); + + const int index = 2; + when(mockApi.setExposureCompensationIndex(cameraControlIdentifier, index)) + .thenAnswer((_) => Future.value()); + + expect(await cameraControl.setExposureCompensationIndex(index), isNull); + verify( + mockApi.setExposureCompensationIndex(cameraControlIdentifier, index)); + }); + + test( + 'setExposureCompensationIndex throws PlatformException when one is thrown from native side', + () async { + final MockTestCameraControlHostApi mockApi = + MockTestCameraControlHostApi(); + TestCameraControlHostApi.setup(mockApi); + + final InstanceManager instanceManager = InstanceManager( + onWeakReferenceRemoved: (_) {}, + ); + + final CameraControl cameraControl = CameraControl.detached( + instanceManager: instanceManager, + ); + const int cameraControlIdentifier = 40; + + instanceManager.addHostCreatedInstance( + cameraControl, + cameraControlIdentifier, + onCopy: (_) => CameraControl.detached(instanceManager: instanceManager), + ); + + const int index = 1; + when(mockApi.setExposureCompensationIndex(cameraControlIdentifier, index)) + .thenThrow(PlatformException( + code: 'TEST_ERROR', + details: 'Platform exception thrown from Java side.')); + + expect(() => cameraControl.setExposureCompensationIndex(index), + throwsA(isA())); + + verify( + mockApi.setExposureCompensationIndex(cameraControlIdentifier, index)); + }); + test('flutterApiCreate makes call to add instance to instance manager', () { final InstanceManager instanceManager = InstanceManager( onWeakReferenceRemoved: (_) {}, diff --git a/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart index a11525af986..57040bcac62 100644 --- a/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart @@ -5,6 +5,8 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; +import 'package:camera_android_camerax/src/focus_metering_action.dart' as _i4; +import 'package:camera_android_camerax/src/metering_point.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; import 'test_camerax_library.g.dart' as _i2; @@ -66,7 +68,7 @@ class MockTestCameraControlHostApi extends _i1.Mock ) as _i3.Future); @override - _i3.Future startFocusAndMetering( + _i3.Future startFocusAndMetering( int? identifier, int? focusMeteringActionId, ) => @@ -78,8 +80,8 @@ class MockTestCameraControlHostApi extends _i1.Mock focusMeteringActionId, ], ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); + returnValue: _i3.Future.value(), + ) as _i3.Future); @override _i3.Future cancelFocusAndMetering(int? identifier) => @@ -93,7 +95,7 @@ class MockTestCameraControlHostApi extends _i1.Mock ) as _i3.Future); @override - _i3.Future setExposureCompensationIndex( + _i3.Future setExposureCompensationIndex( int? identifier, int? index, ) => @@ -105,8 +107,8 @@ class MockTestCameraControlHostApi extends _i1.Mock index, ], ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); + returnValue: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [TestInstanceManagerHostApi]. @@ -127,3 +129,20 @@ class MockTestInstanceManagerHostApi extends _i1.Mock returnValueForMissingStub: null, ); } + +/// A class which mocks [FocusMeteringAction]. +/// +/// See the documentation for Mockito's code generation for more information. +// ignore: must_be_immutable +class MockFocusMeteringAction extends _i1.Mock + implements _i4.FocusMeteringAction { + MockFocusMeteringAction() { + _i1.throwOnMissingStub(this); + } + + @override + List<(_i5.MeteringPoint, int?)> get meteringPointInfos => (super.noSuchMethod( + Invocation.getter(#meteringPointInfos), + returnValue: <(_i5.MeteringPoint, int?)>[], + ) as List<(_i5.MeteringPoint, int?)>); +} diff --git a/packages/camera/camera_android_camerax/test/focus_metering_action_test.dart b/packages/camera/camera_android_camerax/test/focus_metering_action_test.dart index 657fb1aa3da..a74338e2735 100644 --- a/packages/camera/camera_android_camerax/test/focus_metering_action_test.dart +++ b/packages/camera/camera_android_camerax/test/focus_metering_action_test.dart @@ -37,6 +37,9 @@ void main() { ); FocusMeteringAction.detached( + meteringPointInfos: <(MeteringPoint, int?)>[ + (MockMeteringPoint(), FocusMeteringAction.flagAwb) + ], instanceManager: instanceManager, ); diff --git a/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart b/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart index 717215ca228..4fcab1cef21 100644 --- a/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.4 from annotations // in camera_android_camerax/test/focus_metering_action_test.dart. // Do not manually edit this file. diff --git a/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart b/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart index d35cdc15efb..5be2875f6d4 100644 --- a/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.4 from annotations // in camera_android_camerax/test/focus_metering_result_test.dart. // Do not manually edit this file. diff --git a/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart b/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart index ba199f66c63..18ec9b0a1e4 100644 --- a/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.4 from annotations // in camera_android_camerax/test/metering_point_test.dart. // Do not manually edit this file. From 38e88a8059a1d5bb50b79197a41f50a1740256c7 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Feb 2024 16:17:12 -0800 Subject: [PATCH 08/23] Format --- .../camerax/CameraControlHostApiImpl.java | 8 +- .../camerax/GeneratedCameraXLibrary.java | 1154 +++++++++++------ .../plugins/camerax/CameraControlTest.java | 11 +- .../lib/src/camerax_library.g.dart | 447 ++++--- .../test/test_camerax_library.g.dart | 992 +++++++++----- 5 files changed, 1704 insertions(+), 908 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java index 77bbf274467..ba4318a8927 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java @@ -100,8 +100,8 @@ public void onFailure(Throwable t) { * *

Will trigger an auto focus action and enable auto focus/auto exposure/auto white balance * metering regions. - * - *

Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was + * + *

Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was * canceled. */ public void startFocusAndMetering( @@ -167,8 +167,8 @@ public void onFailure(Throwable t) { *

The exposure compensation value set on the camera must be within the range of {@code * ExposureState#getExposureCompensationRange()} for the current {@code ExposureState} for the * call to succeed. - * - *

Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was + * + *

Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was * canceled. */ public void setExposureCompensationIndex( 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 b34ee2cf0f8..e448f311ab4 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 @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,8 +34,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -55,7 +53,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -63,7 +61,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /** * The states the camera can be in. * - * See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. + *

See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. */ public enum CameraStateType { CLOSED(0), @@ -82,20 +80,19 @@ private CameraStateType(final int index) { /** * The types (T) properly wrapped to be used as a LiveData. * - * If you need to add another type to support a type S to use a LiveData in - * this plugin, ensure the following is done on the Dart side: + *

If you need to add another type to support a type S to use a LiveData in this plugin, + * ensure the following is done on the Dart side: * - * * In `../lib/src/live_data.dart`, add new cases for S in - * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of - * type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` - * to create the expected type of LiveData when requested. + *

* In `../lib/src/live_data.dart`, add new cases for S in + * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a + * LiveData instance and in `LiveDataFlutterApiImpl#create` to create the expected type of + * LiveData when requested. * - * On the native side, ensure the following is done: + *

On the native side, ensure the following is done: * - * * Make sure `LiveDataHostApiImpl#getValue` is updated to properly return - * identifiers for instances of type S. - * * Update `ObserverFlutterApiWrapper#onChanged` to properly handle receiving - * calls with instances of type S if a LiveData instance is observed. + *

* Make sure `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for + * instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle + * receiving calls with instances of type S if a LiveData instance is observed. */ public enum LiveDataSupportedType { CAMERA_STATE(0), @@ -109,12 +106,12 @@ private LiveDataSupportedType(final int index) { } /** - * Video quality constraints that will be used by a QualitySelector to choose - * an appropriate video resolution. + * 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. + *

These are pre-defined quality constants that are universally used for video. * - * See https://developer.android.com/reference/androidx/camera/video/Quality. + *

See https://developer.android.com/reference/androidx/camera/video/Quality. */ public enum VideoQuality { SD(0), @@ -134,7 +131,7 @@ private VideoQuality(final int index) { /** * Fallback rules for selecting video resolution. * - * See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. + *

See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. */ public enum VideoResolutionFallbackRule { HIGHER_QUALITY_OR_LOWER_THAN(0), @@ -152,22 +149,20 @@ private VideoResolutionFallbackRule(final int index) { /** * The types of capture request options this plugin currently supports. * - * If you need to add another option to support, ensure the following is done - * on the Dart side: + *

If you need to add another option to support, ensure the following is done on the Dart side: * - * * In `../lib/src/capture_request_options.dart`, add new cases for this - * option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` - * to create the expected Map entry of option key index and value to send to - * the native side. + *

* In `../lib/src/capture_request_options.dart`, add new cases for this option in + * `_CaptureRequestOptionsHostApiImpl#createFromInstances` to create the expected Map entry of + * option key index and value to send to the native side. * - * On the native side, ensure the following is done: + *

On the native side, ensure the following is done: * - * * Update `CaptureRequestOptionsHostApiImpl#create` to set the correct - * `CaptureRequest` key with a valid value type for this option. + *

* Update `CaptureRequestOptionsHostApiImpl#create` to set the correct `CaptureRequest` key + * with a valid value type for this option. * - * See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest - * for the sorts of capture request options that can be supported via CameraX's - * interoperability with Camera2. + *

See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest for the + * sorts of capture request options that can be supported via CameraX's interoperability with + * Camera2. */ public enum CaptureRequestKeySupportedType { CONTROL_AE_LOCK(0); @@ -245,9 +240,13 @@ ArrayList toList() { static @NonNull ResolutionInfo fromList(@NonNull ArrayList list) { ResolutionInfo pigeonResult = new ResolutionInfo(); Object width = list.get(0); - pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth( + (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = list.get(1); - pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight( + (height == null) + ? null + : ((height instanceof Integer) ? (Integer) height : (Long) height)); return pigeonResult; } } @@ -489,9 +488,19 @@ ArrayList toList() { static @NonNull ExposureCompensationRange fromList(@NonNull ArrayList list) { ExposureCompensationRange pigeonResult = new ExposureCompensationRange(); Object minCompensation = list.get(0); - pigeonResult.setMinCompensation((minCompensation == null) ? null : ((minCompensation instanceof Integer) ? (Integer) minCompensation : (Long) minCompensation)); + pigeonResult.setMinCompensation( + (minCompensation == null) + ? null + : ((minCompensation instanceof Integer) + ? (Integer) minCompensation + : (Long) minCompensation)); Object maxCompensation = list.get(1); - pigeonResult.setMaxCompensation((maxCompensation == null) ? null : ((maxCompensation instanceof Integer) ? (Integer) maxCompensation : (Long) maxCompensation)); + pigeonResult.setMaxCompensation( + (maxCompensation == null) + ? null + : ((maxCompensation instanceof Integer) + ? (Integer) maxCompensation + : (Long) maxCompensation)); return pigeonResult; } } @@ -499,7 +508,7 @@ ArrayList toList() { /** * Convenience class for sending lists of [Quality]s. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class VideoQualityData { private @NonNull VideoQuality quality; @@ -550,10 +559,9 @@ ArrayList toList() { } /** - * Convenience class for building [FocusMeteringAction]s with multiple metering - * points. + * Convenience class for building [FocusMeteringAction]s with multiple metering points. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class MeteringPointInfo { /** InstanceManager ID for a [MeteringPoint]. */ @@ -573,7 +581,7 @@ public void setMeteringPointId(@NonNull Long setterArg) { /** * The metering mode of the [MeteringPoint] whose ID is [meteringPointId]. * - * Metering mode should be one of the [FocusMeteringAction] constants. + *

Metering mode should be one of the [FocusMeteringAction] constants. */ private @Nullable Long meteringMode; @@ -623,9 +631,17 @@ ArrayList toList() { static @NonNull MeteringPointInfo fromList(@NonNull ArrayList list) { MeteringPointInfo pigeonResult = new MeteringPointInfo(); Object meteringPointId = list.get(0); - pigeonResult.setMeteringPointId((meteringPointId == null) ? null : ((meteringPointId instanceof Integer) ? (Integer) meteringPointId : (Long) meteringPointId)); + pigeonResult.setMeteringPointId( + (meteringPointId == null) + ? null + : ((meteringPointId instanceof Integer) + ? (Integer) meteringPointId + : (Long) meteringPointId)); Object meteringMode = list.get(1); - pigeonResult.setMeteringMode((meteringMode == null) ? null : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); + pigeonResult.setMeteringMode( + (meteringMode == null) + ? null + : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); return pigeonResult; } } @@ -641,7 +657,7 @@ public interface InstanceManagerHostApi { /** * Clear the native `InstanceManager`. * - * This is typically only used after a hot restart. + *

This is typically only used after a hot restart. */ void clear(); @@ -649,8 +665,12 @@ public interface InstanceManagerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `InstanceManagerHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { + /** + * Sets up an instance of `InstanceManagerHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -662,8 +682,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceMa try { api.clear(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -684,7 +703,9 @@ public interface JavaObjectHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObjectHostApi api) { { BasicMessageChannel channel = @@ -699,8 +720,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObject try { api.dispose((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -720,7 +740,7 @@ public JavaObjectFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -729,6 +749,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -741,28 +762,32 @@ public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraInfoHostApi { - @NonNull + @NonNull Long getSensorRotationDegrees(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraState(@NonNull Long identifier); - @NonNull + @NonNull Long getExposureState(@NonNull Long identifier); - @NonNull + @NonNull Long getZoomState(@NonNull Long identifier); /** The codec used by CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -770,10 +795,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getSensorRotationDegrees((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getSensorRotationDegrees( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -794,10 +820,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraState( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -810,7 +837,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -818,10 +847,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getExposureState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getExposureState( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -842,10 +872,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -865,7 +895,7 @@ public CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -874,6 +904,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -888,15 +919,19 @@ public interface CameraSelectorHostApi { void create(@NonNull Long identifier, @Nullable Long lensFacing); - @NonNull + @NonNull List filter(@NonNull Long identifier, @NonNull List cameraInfoIds); /** The codec used by CameraSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraSelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { + /** + * Sets up an instance of `CameraSelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -909,10 +944,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSele Number identifierArg = (Number) args.get(0); Number lensFacingArg = (Number) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (lensFacingArg == null) ? null : lensFacingArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (lensFacingArg == null) ? null : lensFacingArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -934,10 +970,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSele Number identifierArg = (Number) args.get(0); List cameraInfoIdsArg = (List) args.get(1); try { - List output = api.filter((identifierArg == null) ? null : identifierArg.longValue(), cameraInfoIdsArg); + List output = + api.filter( + (identifierArg == null) ? null : identifierArg.longValue(), + cameraInfoIdsArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -957,7 +995,7 @@ public CameraSelectorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -966,7 +1004,9 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraSelectorFlutterApi.create", getCodec()); @@ -980,13 +1020,16 @@ public interface ProcessCameraProviderHostApi { void getInstance(@NonNull Result result); - @NonNull + @NonNull List getAvailableCameraInfos(@NonNull Long identifier); - @NonNull - Long bindToLifecycle(@NonNull Long identifier, @NonNull Long cameraSelectorIdentifier, @NonNull List useCaseIds); + @NonNull + Long bindToLifecycle( + @NonNull Long identifier, + @NonNull Long cameraSelectorIdentifier, + @NonNull List useCaseIds); - @NonNull + @NonNull Boolean isBound(@NonNull Long identifier, @NonNull Long useCaseIdentifier); void unbind(@NonNull Long identifier, @NonNull List useCaseIds); @@ -997,12 +1040,18 @@ public interface ProcessCameraProviderHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { + /** + * Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1029,7 +1078,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1037,10 +1088,11 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = api.getAvailableCameraInfos((identifierArg == null) ? null : identifierArg.longValue()); + List output = + api.getAvailableCameraInfos( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1053,7 +1105,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1063,10 +1117,15 @@ public void error(Throwable error) { Number cameraSelectorIdentifierArg = (Number) args.get(1); List useCaseIdsArg = (List) args.get(2); try { - Long output = api.bindToLifecycle((identifierArg == null) ? null : identifierArg.longValue(), (cameraSelectorIdentifierArg == null) ? null : cameraSelectorIdentifierArg.longValue(), useCaseIdsArg); + Long output = + api.bindToLifecycle( + (identifierArg == null) ? null : identifierArg.longValue(), + (cameraSelectorIdentifierArg == null) + ? null + : cameraSelectorIdentifierArg.longValue(), + useCaseIdsArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1079,7 +1138,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1088,10 +1149,12 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number useCaseIdentifierArg = (Number) args.get(1); try { - Boolean output = api.isBound((identifierArg == null) ? null : identifierArg.longValue(), (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); + Boolean output = + api.isBound( + (identifierArg == null) ? null : identifierArg.longValue(), + (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1104,7 +1167,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1113,10 +1178,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); List useCaseIdsArg = (List) args.get(1); try { - api.unbind((identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); + api.unbind( + (identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1129,7 +1194,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1139,8 +1206,7 @@ public void error(Throwable error) { try { api.unbindAll((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1160,7 +1226,7 @@ public ProcessCameraProviderFlutterApi(@NonNull BinaryMessenger argBinaryMesseng this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1169,10 +1235,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", + getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -1181,17 +1250,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraHostApi { - @NonNull + @NonNull Long getCameraInfo(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraControl(@NonNull Long identifier); /** The codec used by CameraHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHostApi api) { { BasicMessageChannel channel = @@ -1204,10 +1273,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1228,10 +1297,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraControl((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraControl( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1251,7 +1321,7 @@ public CameraFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1260,6 +1330,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1299,21 +1370,28 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface SystemServicesHostApi { - void requestCameraPermissions(@NonNull Boolean enableAudio, @NonNull Result result); + void requestCameraPermissions( + @NonNull Boolean enableAudio, @NonNull Result result); - @NonNull + @NonNull String getTempFilePath(@NonNull String prefix, @NonNull String suffix); /** The codec used by SystemServicesHostApi. */ static @NonNull MessageCodec getCodec() { return SystemServicesHostApiCodec.INSTANCE; } - /**Sets up an instance of `SystemServicesHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { + /** + * Sets up an instance of `SystemServicesHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1342,7 +1420,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1353,8 +1433,7 @@ public void error(Throwable error) { try { String output = api.getTempFilePath(prefixArg, suffixArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1374,7 +1453,7 @@ public SystemServicesFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1383,10 +1462,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", + getCodec()); channel.send( new ArrayList(Collections.singletonList(errorDescriptionArg)), channelReply -> callback.reply(null)); @@ -1395,23 +1477,30 @@ public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { + /** + * Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1420,10 +1509,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie Boolean isFrontFacingArg = (Boolean) args.get(0); Number sensorOrientationArg = (Number) args.get(1); try { - api.startListeningForDeviceOrientationChange(isFrontFacingArg, (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); + api.startListeningForDeviceOrientationChange( + isFrontFacingArg, + (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1436,7 +1526,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1444,8 +1536,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1458,7 +1549,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1466,8 +1559,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie try { Long output = api.getDefaultDisplayRotation(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1487,7 +1579,7 @@ public DeviceOrientationManagerFlutterApi(@NonNull BinaryMessenger argBinaryMess this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1496,10 +1588,14 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onDeviceOrientationChanged(@NonNull String orientationArg, @NonNull Reply callback) { + + public void onDeviceOrientationChanged( + @NonNull String orientationArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", + getCodec()); channel.send( new ArrayList(Collections.singletonList(orientationArg)), channelReply -> callback.reply(null)); @@ -1535,14 +1631,15 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PreviewHostApi { - void create(@NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); - @NonNull + @NonNull Long setSurfaceProvider(@NonNull Long identifier); void releaseFlutterSurfaceTexture(); - @NonNull + @NonNull ResolutionInfo getResolutionInfo(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1551,7 +1648,7 @@ public interface PreviewHostApi { static @NonNull MessageCodec getCodec() { return PreviewHostApiCodec.INSTANCE; } - /**Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHostApi api) { { BasicMessageChannel channel = @@ -1566,10 +1663,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number rotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1582,7 +1683,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1590,10 +1693,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.setSurfaceProvider((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.setSurfaceProvider( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1606,7 +1710,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1614,8 +1720,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos try { api.releaseFlutterSurfaceTexture(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1636,10 +1741,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - ResolutionInfo output = api.getResolutionInfo((identifierArg == null) ? null : identifierArg.longValue()); + ResolutionInfo output = + api.getResolutionInfo( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1661,10 +1767,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1679,10 +1786,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoCaptureHostApi { - @NonNull + @NonNull Long withOutput(@NonNull Long videoOutputId); - @NonNull + @NonNull Long getOutput(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1691,7 +1798,10 @@ public interface VideoCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `VideoCaptureHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `VideoCaptureHostApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptureHostApi api) { { BasicMessageChannel channel = @@ -1704,10 +1814,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number videoOutputIdArg = (Number) args.get(0); try { - Long output = api.withOutput((videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); + Long output = + api.withOutput( + (videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1728,10 +1839,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1744,7 +1855,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1753,10 +1866,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1776,7 +1890,7 @@ public VideoCaptureFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1785,6 +1899,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1797,22 +1912,28 @@ 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, + @Nullable Long qualitySelectorId); - @NonNull + @NonNull Long getAspectRatio(@NonNull Long identifier); - @NonNull + @NonNull Long getTargetVideoEncodingBitRate(@NonNull Long identifier); - @NonNull + @NonNull Long prepareRecording(@NonNull Long identifier, @NonNull String path); /** The codec used by RecorderHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHostApi api) { { BasicMessageChannel channel = @@ -1828,10 +1949,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo 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()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), + (bitRateArg == null) ? null : bitRateArg.longValue(), + (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1852,10 +1976,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getAspectRatio((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getAspectRatio( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1868,7 +1993,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1876,10 +2003,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getTargetVideoEncodingBitRate((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getTargetVideoEncodingBitRate( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1901,10 +2029,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number identifierArg = (Number) args.get(0); String pathArg = (String) args.get(1); try { - Long output = api.prepareRecording((identifierArg == null) ? null : identifierArg.longValue(), pathArg); + Long output = + api.prepareRecording( + (identifierArg == null) ? null : identifierArg.longValue(), pathArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1924,7 +2053,7 @@ public RecorderFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1933,7 +2062,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @Nullable Long bitRateArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @Nullable Long aspectRatioArg, + @Nullable Long bitRateArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.RecorderFlutterApi.create", getCodec()); @@ -1945,15 +2079,19 @@ public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @ /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PendingRecordingHostApi { - @NonNull + @NonNull Long start(@NonNull Long identifier); /** The codec used by PendingRecordingHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `PendingRecordingHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { + /** + * Sets up an instance of `PendingRecordingHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1965,10 +2103,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRec ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.start((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.start((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1988,7 +2126,7 @@ public PendingRecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1997,6 +2135,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2021,7 +2160,9 @@ public interface RecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingHostApi api) { { BasicMessageChannel channel = @@ -2036,8 +2177,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2060,8 +2200,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.pause((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2084,8 +2223,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.resume((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2108,8 +2246,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.stop((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2129,7 +2266,7 @@ public RecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2138,6 +2275,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2150,7 +2288,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageCaptureHostApi { - void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long flashMode, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, + @Nullable Long targetRotation, + @Nullable Long flashMode, + @Nullable Long resolutionSelectorId); void setFlashMode(@NonNull Long identifier, @NonNull Long flashMode); @@ -2162,7 +2304,10 @@ public interface ImageCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageCaptureHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ImageCaptureHostApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptureHostApi api) { { BasicMessageChannel channel = @@ -2178,10 +2323,15 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number flashModeArg = (Number) args.get(2); Number resolutionSelectorIdArg = (Number) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (targetRotationArg == null) ? null : targetRotationArg.longValue(), + (flashModeArg == null) ? null : flashModeArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2203,10 +2353,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number identifierArg = (Number) args.get(0); Number flashModeArg = (Number) args.get(1); try { - api.setFlashMode((identifierArg == null) ? null : identifierArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue()); + api.setFlashMode( + (identifierArg == null) ? null : identifierArg.longValue(), + (flashModeArg == null) ? null : flashModeArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2239,7 +2390,8 @@ public void error(Throwable error) { } }; - api.takePicture((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.takePicture( + (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -2248,7 +2400,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2257,10 +2411,11 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2274,7 +2429,8 @@ public void error(Throwable error) { } private static class ResolutionStrategyHostApiCodec extends StandardMessageCodec { - public static final ResolutionStrategyHostApiCodec INSTANCE = new ResolutionStrategyHostApiCodec(); + public static final ResolutionStrategyHostApiCodec INSTANCE = + new ResolutionStrategyHostApiCodec(); private ResolutionStrategyHostApiCodec() {} @@ -2302,14 +2458,19 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionStrategyHostApi { - void create(@NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); + void create( + @NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); /** The codec used by ResolutionStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionStrategyHostApiCodec.INSTANCE; } - /**Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { + /** + * Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2323,10 +2484,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution ResolutionInfo boundSizeArg = (ResolutionInfo) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), boundSizeArg, (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + boundSizeArg, + (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2341,14 +2504,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionSelectorHostApi { - void create(@NonNull Long identifier, @Nullable Long resolutionStrategyIdentifier, @Nullable Long aspectRatioStrategyIdentifier); + void create( + @NonNull Long identifier, + @Nullable Long resolutionStrategyIdentifier, + @Nullable Long aspectRatioStrategyIdentifier); /** The codec used by ResolutionSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { + /** + * Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2362,10 +2532,16 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution Number resolutionStrategyIdentifierArg = (Number) args.get(1); Number aspectRatioStrategyIdentifierArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (resolutionStrategyIdentifierArg == null) ? null : resolutionStrategyIdentifierArg.longValue(), (aspectRatioStrategyIdentifierArg == null) ? null : aspectRatioStrategyIdentifierArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (resolutionStrategyIdentifierArg == null) + ? null + : resolutionStrategyIdentifierArg.longValue(), + (aspectRatioStrategyIdentifierArg == null) + ? null + : aspectRatioStrategyIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2380,18 +2556,25 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AspectRatioStrategyHostApi { - void create(@NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); + void create( + @NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); /** The codec used by AspectRatioStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { + /** + * Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2401,10 +2584,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRati Number preferredAspectRatioArg = (Number) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (preferredAspectRatioArg == null) ? null : preferredAspectRatioArg.longValue(), (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (preferredAspectRatioArg == null) + ? null + : preferredAspectRatioArg.longValue(), + (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2451,7 +2638,7 @@ public CameraStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2460,7 +2647,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return CameraStateFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull CameraStateTypeData typeArg, @Nullable Long errorIdentifierArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull CameraStateTypeData typeArg, + @Nullable Long errorIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateFlutterApi.create", getCodec()); @@ -2504,7 +2696,7 @@ public ExposureStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2513,12 +2705,19 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return ExposureStateFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull ExposureCompensationRange exposureCompensationRangeArg, @NonNull Double exposureCompensationStepArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull ExposureCompensationRange exposureCompensationRangeArg, + @NonNull Double exposureCompensationStepArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ExposureStateFlutterApi.create", getCodec()); channel.send( - new ArrayList(Arrays.asList(identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), + new ArrayList( + Arrays.asList( + identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), channelReply -> callback.reply(null)); } } @@ -2530,7 +2729,7 @@ public ZoomStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2539,7 +2738,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, @NonNull Double maxZoomRatioArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull Double minZoomRatioArg, + @NonNull Double maxZoomRatioArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ZoomStateFlutterApi.create", getCodec()); @@ -2551,7 +2755,10 @@ public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageAnalysisHostApi { - void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, + @Nullable Long targetRotation, + @Nullable Long resolutionSelectorId); void setAnalyzer(@NonNull Long identifier, @NonNull Long analyzerIdentifier); @@ -2563,8 +2770,12 @@ public interface ImageAnalysisHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageAnalysisHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { + /** + * Sets up an instance of `ImageAnalysisHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2578,10 +2789,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number targetRotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (targetRotationArg == null) ? null : targetRotationArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2603,10 +2818,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number identifierArg = (Number) args.get(0); Number analyzerIdentifierArg = (Number) args.get(1); try { - api.setAnalyzer((identifierArg == null) ? null : identifierArg.longValue(), (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); + api.setAnalyzer( + (identifierArg == null) ? null : identifierArg.longValue(), + (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2619,7 +2835,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2629,8 +2847,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly try { api.clearAnalyzer((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2643,7 +2860,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2652,10 +2871,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2676,7 +2896,9 @@ public interface AnalyzerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHostApi api) { { BasicMessageChannel channel = @@ -2691,8 +2913,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2713,7 +2934,9 @@ public interface ObserverHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHostApi api) { { BasicMessageChannel channel = @@ -2728,8 +2951,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2749,7 +2971,7 @@ public ObserverFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2758,7 +2980,11 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onChanged(@NonNull Long identifierArg, @NonNull Long valueIdentifierArg, @NonNull Reply callback) { + + public void onChanged( + @NonNull Long identifierArg, + @NonNull Long valueIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ObserverFlutterApi.onChanged", getCodec()); @@ -2775,7 +3001,7 @@ public CameraStateErrorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2784,7 +3010,9 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateErrorFlutterApi.create", getCodec()); @@ -2827,14 +3055,16 @@ public interface LiveDataHostApi { void removeObservers(@NonNull Long identifier); - @Nullable + @Nullable Long getValue(@NonNull Long identifier, @NonNull LiveDataSupportedTypeData type); /** The codec used by LiveDataHostApi. */ static @NonNull MessageCodec getCodec() { return LiveDataHostApiCodec.INSTANCE; } - /**Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHostApi api) { { BasicMessageChannel channel = @@ -2848,10 +3078,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); Number observerIdentifierArg = (Number) args.get(1); try { - api.observe((identifierArg == null) ? null : identifierArg.longValue(), (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); + api.observe( + (identifierArg == null) ? null : identifierArg.longValue(), + (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2874,8 +3105,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo try { api.removeObservers((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2897,10 +3127,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); LiveDataSupportedTypeData typeArg = (LiveDataSupportedTypeData) args.get(1); try { - Long output = api.getValue((identifierArg == null) ? null : identifierArg.longValue(), typeArg); + Long output = + api.getValue( + (identifierArg == null) ? null : identifierArg.longValue(), typeArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2947,7 +3178,7 @@ public LiveDataFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2956,7 +3187,11 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return LiveDataFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull LiveDataSupportedTypeData typeArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull LiveDataSupportedTypeData typeArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.LiveDataFlutterApi.create", getCodec()); @@ -2973,7 +3208,7 @@ public AnalyzerFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2982,6 +3217,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2990,7 +3226,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } - public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentifierArg, @NonNull Reply callback) { + + public void analyze( + @NonNull Long identifierArg, + @NonNull Long imageProxyIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.AnalyzerFlutterApi.analyze", getCodec()); @@ -3002,7 +3242,7 @@ public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentif /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageProxyHostApi { - @NonNull + @NonNull List getPlanes(@NonNull Long identifier); void close(@NonNull Long identifier); @@ -3011,7 +3251,9 @@ public interface ImageProxyHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxyHostApi api) { { BasicMessageChannel channel = @@ -3024,10 +3266,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); + List output = + api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3050,8 +3292,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3071,7 +3312,7 @@ public ImageProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3080,7 +3321,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Long formatArg, @NonNull Long heightArg, @NonNull Long widthArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull Long formatArg, + @NonNull Long heightArg, + @NonNull Long widthArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ImageProxyFlutterApi.create", getCodec()); @@ -3097,7 +3344,7 @@ public PlaneProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3106,12 +3353,19 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull byte[] bufferArg, @NonNull Long pixelStrideArg, @NonNull Long rowStrideArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull byte[] bufferArg, + @NonNull Long pixelStrideArg, + @NonNull Long rowStrideArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.PlaneProxyFlutterApi.create", getCodec()); channel.send( - new ArrayList(Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), + new ArrayList( + Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), channelReply -> callback.reply(null)); } } @@ -3150,17 +3404,24 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface QualitySelectorHostApi { - void create(@NonNull Long identifier, @NonNull List videoQualityDataList, @Nullable Long fallbackStrategyId); + void create( + @NonNull Long identifier, + @NonNull List videoQualityDataList, + @Nullable Long fallbackStrategyId); - @NonNull + @NonNull ResolutionInfo getResolution(@NonNull Long cameraInfoId, @NonNull VideoQuality quality); /** The codec used by QualitySelectorHostApi. */ static @NonNull MessageCodec getCodec() { return QualitySelectorHostApiCodec.INSTANCE; } - /**Sets up an instance of `QualitySelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { + /** + * Sets up an instance of `QualitySelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3171,13 +3432,16 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List videoQualityDataListArg = (List) args.get(1); + List videoQualityDataListArg = + (List) args.get(1); Number fallbackStrategyIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), videoQualityDataListArg, (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + videoQualityDataListArg, + (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3190,19 +3454,24 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number cameraInfoIdArg = (Number) args.get(0); - VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoQuality qualityArg = + args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; try { - ResolutionInfo output = api.getResolution((cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), qualityArg); + ResolutionInfo output = + api.getResolution( + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), + qualityArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3217,14 +3486,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FallbackStrategyHostApi { - void create(@NonNull Long identifier, @NonNull VideoQuality quality, @NonNull VideoResolutionFallbackRule fallbackRule); + void create( + @NonNull Long identifier, + @NonNull VideoQuality quality, + @NonNull VideoResolutionFallbackRule fallbackRule); /** The codec used by FallbackStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `FallbackStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { + /** + * Sets up an instance of `FallbackStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3235,13 +3511,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackSt ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; - VideoResolutionFallbackRule fallbackRuleArg = args.get(2) == null ? null : VideoResolutionFallbackRule.values()[(int) args.get(2)]; + VideoQuality qualityArg = + args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoResolutionFallbackRule fallbackRuleArg = + args.get(2) == null + ? null + : VideoResolutionFallbackRule.values()[(int) args.get(2)]; try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), qualityArg, fallbackRuleArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + qualityArg, + fallbackRuleArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3256,22 +3538,32 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackSt /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraControlHostApi { - void enableTorch(@NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); + void enableTorch( + @NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); - void setZoomRatio(@NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); + void setZoomRatio( + @NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); - void startFocusAndMetering(@NonNull Long identifier, @NonNull Long focusMeteringActionId, @NonNull Result result); + void startFocusAndMetering( + @NonNull Long identifier, + @NonNull Long focusMeteringActionId, + @NonNull Result result); void cancelFocusAndMetering(@NonNull Long identifier, @NonNull Result result); - void setExposureCompensationIndex(@NonNull Long identifier, @NonNull Long index, @NonNull Result result); + void setExposureCompensationIndex( + @NonNull Long identifier, @NonNull Long index, @NonNull Result result); /** The codec used by CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraControlHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { + /** + * Sets up an instance of `CameraControlHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3296,7 +3588,10 @@ public void error(Throwable error) { } }; - api.enableTorch((identifierArg == null) ? null : identifierArg.longValue(), torchArg, resultCallback); + api.enableTorch( + (identifierArg == null) ? null : identifierArg.longValue(), + torchArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3305,7 +3600,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3326,7 +3623,10 @@ public void error(Throwable error) { } }; - api.setZoomRatio((identifierArg == null) ? null : identifierArg.longValue(), ratioArg, resultCallback); + api.setZoomRatio( + (identifierArg == null) ? null : identifierArg.longValue(), + ratioArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3335,7 +3635,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3356,7 +3658,12 @@ public void error(Throwable error) { } }; - api.startFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), (focusMeteringActionIdArg == null) ? null : focusMeteringActionIdArg.longValue(), resultCallback); + api.startFocusAndMetering( + (identifierArg == null) ? null : identifierArg.longValue(), + (focusMeteringActionIdArg == null) + ? null + : focusMeteringActionIdArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3365,7 +3672,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3385,7 +3694,8 @@ public void error(Throwable error) { } }; - api.cancelFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.cancelFocusAndMetering( + (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3394,7 +3704,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3415,7 +3727,10 @@ public void error(Throwable error) { } }; - api.setExposureCompensationIndex((identifierArg == null) ? null : identifierArg.longValue(), (indexArg == null) ? null : indexArg.longValue(), resultCallback); + api.setExposureCompensationIndex( + (identifierArg == null) ? null : identifierArg.longValue(), + (indexArg == null) ? null : indexArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3431,7 +3746,7 @@ public CameraControlFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3440,6 +3755,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3451,7 +3767,8 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { } private static class FocusMeteringActionHostApiCodec extends StandardMessageCodec { - public static final FocusMeteringActionHostApiCodec INSTANCE = new FocusMeteringActionHostApiCodec(); + public static final FocusMeteringActionHostApiCodec INSTANCE = + new FocusMeteringActionHostApiCodec(); private FocusMeteringActionHostApiCodec() {} @@ -3485,24 +3802,32 @@ public interface FocusMeteringActionHostApi { static @NonNull MessageCodec getCodec() { return FocusMeteringActionHostApiCodec.INSTANCE; } - /**Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { + /** + * Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringActionHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringActionHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List meteringPointInfosArg = (List) args.get(1); + List meteringPointInfosArg = + (List) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + meteringPointInfosArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3517,19 +3842,25 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeter /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringResultHostApi { - @NonNull + @NonNull Boolean isFocusSuccessful(@NonNull Long identifier); /** The codec used by FocusMeteringResultHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { + /** + * Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3537,10 +3868,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeter ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Boolean output = api.isFocusSuccessful((identifierArg == null) ? null : identifierArg.longValue()); + Boolean output = + api.isFocusSuccessful( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3560,7 +3892,7 @@ public FocusMeteringResultFlutterApi(@NonNull BinaryMessenger argBinaryMessenger this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3569,10 +3901,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", + getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -3581,17 +3916,22 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MeteringPointHostApi { - void create(@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); + void create( + @NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); - @NonNull + @NonNull Double getDefaultPointSize(); /** The codec used by MeteringPointHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `MeteringPointHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { + /** + * Sets up an instance of `MeteringPointHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3606,10 +3946,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo Double yArg = (Double) args.get(2); Double sizeArg = (Double) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + xArg, + yArg, + sizeArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3622,7 +3965,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3630,8 +3975,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo try { Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3645,7 +3989,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo } private static class CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { - public static final CaptureRequestOptionsHostApiCodec INSTANCE = new CaptureRequestOptionsHostApiCodec(); + public static final CaptureRequestOptionsHostApiCodec INSTANCE = + new CaptureRequestOptionsHostApiCodec(); private CaptureRequestOptionsHostApiCodec() {} @@ -3709,12 +4054,18 @@ public interface CaptureRequestOptionsHostApi { static @NonNull MessageCodec getCodec() { return CaptureRequestOptionsHostApiCodec.INSTANCE; } - /**Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CaptureRequestOptionsHostApi api) { + /** + * Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CaptureRequestOptionsHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CaptureRequestOptionsHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CaptureRequestOptionsHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3723,10 +4074,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CaptureReq Number identifierArg = (Number) args.get(0); Map optionsArg = (Map) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), optionsArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), optionsArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3743,18 +4094,27 @@ public interface Camera2CameraControlHostApi { void create(@NonNull Long identifier, @NonNull Long cameraControlIdentifier); - void addCaptureRequestOptions(@NonNull Long identifier, @NonNull Long captureRequestOptionsIdentifier, @NonNull Result result); + void addCaptureRequestOptions( + @NonNull Long identifier, + @NonNull Long captureRequestOptionsIdentifier, + @NonNull Result result); /** The codec used by Camera2CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraControlHostApi api) { + /** + * Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraControlHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraControlHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3763,10 +4123,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam Number identifierArg = (Number) args.get(0); Number cameraControlIdentifierArg = (Number) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (cameraControlIdentifierArg == null) ? null : cameraControlIdentifierArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (cameraControlIdentifierArg == null) + ? null + : cameraControlIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3779,7 +4142,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3800,7 +4165,12 @@ public void error(Throwable error) { } }; - api.addCaptureRequestOptions((identifierArg == null) ? null : identifierArg.longValue(), (captureRequestOptionsIdentifierArg == null) ? null : captureRequestOptionsIdentifierArg.longValue(), resultCallback); + api.addCaptureRequestOptions( + (identifierArg == null) ? null : identifierArg.longValue(), + (captureRequestOptionsIdentifierArg == null) + ? null + : captureRequestOptionsIdentifierArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java index fa956d387e1..a0fe8f977ee 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraControlTest.java @@ -133,7 +133,7 @@ public void setZoomRatio_setsZoomAsExpected() { FutureCallback successfulSetZoomRatioCallback = futureCallbackCaptor.getValue(); successfulSetZoomRatioCallback.onSuccess(mock(Void.class)); - verify(successfulMockResult).success(null); + verify(successfulMockResult).success(null); // Test failed behavior. @SuppressWarnings("unchecked") @@ -154,7 +154,8 @@ public void setZoomRatio_setsZoomAsExpected() { @SuppressWarnings("unchecked") final GeneratedCameraXLibrary.Result canceledOpResult = mock(GeneratedCameraXLibrary.Result.class); - final CameraControl.OperationCanceledException canceledOpThrowable = mock(CameraControl.OperationCanceledException.class); + final CameraControl.OperationCanceledException canceledOpThrowable = + mock(CameraControl.OperationCanceledException.class); cameraControlHostApiImpl.setZoomRatio(cameraControlIdentifier, zoomRatio, canceledOpResult); mockedFutures.verify( () -> Futures.addCallback(eq(setZoomRatioFuture), futureCallbackCaptor.capture(), any())); @@ -232,7 +233,8 @@ public void startFocusAndMetering_startsFocusAndMeteringAsExpected() { @SuppressWarnings("unchecked") final GeneratedCameraXLibrary.Result canceledOpResult = mock(GeneratedCameraXLibrary.Result.class); - final CameraControl.OperationCanceledException canceledOpThrowable = mock(CameraControl.OperationCanceledException.class); + final CameraControl.OperationCanceledException canceledOpThrowable = + mock(CameraControl.OperationCanceledException.class); cameraControlHostApiImpl.startFocusAndMetering( cameraControlIdentifier, mockActionId, canceledOpResult); mockedFutures.verify( @@ -364,7 +366,8 @@ public void setExposureCompensationIndex_setsExposureCompensationIndexAsExpected @SuppressWarnings("unchecked") final GeneratedCameraXLibrary.Result canceledOpResult = mock(GeneratedCameraXLibrary.Result.class); - final CameraControl.OperationCanceledException canceledOpThrowable = mock(CameraControl.OperationCanceledException.class); + final CameraControl.OperationCanceledException canceledOpThrowable = + mock(CameraControl.OperationCanceledException.class); cameraControlHostApiImpl.setExposureCompensationIndex( cameraControlIdentifier, index, canceledOpResult); mockedFutures.verify( diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index d1ae0a578a9..892729f0672 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -281,8 +281,7 @@ class InstanceManagerHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -338,7 +337,8 @@ abstract class JavaObjectFlutterApi { void dispose(int identifier); - static void setup(JavaObjectFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(JavaObjectFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectFlutterApi.dispose', codec, @@ -348,7 +348,7 @@ abstract class JavaObjectFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -485,7 +485,8 @@ abstract class CameraInfoFlutterApi { void create(int identifier); - static void setup(CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraInfoFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraInfoFlutterApi.create', codec, @@ -495,7 +496,7 @@ abstract class CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -522,8 +523,8 @@ class CameraSelectorHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_lensFacing]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_lensFacing]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -540,12 +541,13 @@ class CameraSelectorHostApi { } } - Future> filter(int arg_identifier, List arg_cameraInfoIds) async { + Future> filter( + int arg_identifier, List arg_cameraInfoIds) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraInfoIds]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_cameraInfoIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -573,7 +575,8 @@ abstract class CameraSelectorFlutterApi { void create(int identifier, int? lensFacing); - static void setup(CameraSelectorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraSelectorFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorFlutterApi.create', codec, @@ -583,7 +586,7 @@ abstract class CameraSelectorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -611,8 +614,7 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -636,7 +638,8 @@ class ProcessCameraProviderHostApi { Future> getAvailableCameraInfos(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -661,12 +664,17 @@ class ProcessCameraProviderHostApi { } } - Future bindToLifecycle(int arg_identifier, int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { + Future bindToLifecycle(int arg_identifier, + int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraSelectorIdentifier, arg_useCaseIds]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_cameraSelectorIdentifier, + arg_useCaseIds + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -693,7 +701,8 @@ class ProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_useCaseIdentifier]) as List?; + await channel.send([arg_identifier, arg_useCaseIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -719,8 +728,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_useCaseIds]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -765,7 +774,8 @@ abstract class ProcessCameraProviderFlutterApi { void create(int identifier); - static void setup(ProcessCameraProviderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ProcessCameraProviderFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create', codec, @@ -775,7 +785,7 @@ abstract class ProcessCameraProviderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -868,7 +878,7 @@ abstract class CameraFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -896,7 +906,7 @@ class _SystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -914,9 +924,11 @@ class SystemServicesHostApi { static const MessageCodec codec = _SystemServicesHostApiCodec(); - Future requestCameraPermissions(bool arg_enableAudio) async { + Future requestCameraPermissions( + bool arg_enableAudio) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_enableAudio]) as List?; @@ -969,7 +981,8 @@ abstract class SystemServicesFlutterApi { void onCameraError(String errorDescription); - static void setup(SystemServicesFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(SystemServicesFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError', codec, @@ -979,7 +992,7 @@ abstract class SystemServicesFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); final List args = (message as List?)!; final String? arg_errorDescription = (args[0] as String?); assert(arg_errorDescription != null, @@ -1002,12 +1015,15 @@ class DeviceOrientationManagerHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future startListeningForDeviceOrientationChange(bool arg_isFrontFacing, int arg_sensorOrientation) async { + Future startListeningForDeviceOrientationChange( + bool arg_isFrontFacing, int arg_sensorOrientation) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', + codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_isFrontFacing, arg_sensorOrientation]) as List?; + await channel.send([arg_isFrontFacing, arg_sensorOrientation]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1026,10 +1042,10 @@ class DeviceOrientationManagerHostApi { Future stopListeningForDeviceOrientationChange() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1048,10 +1064,10 @@ class DeviceOrientationManagerHostApi { Future getDefaultDisplayRotation() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1079,17 +1095,19 @@ abstract class DeviceOrientationManagerFlutterApi { void onDeviceOrientationChanged(String orientation); - static void setup(DeviceOrientationManagerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(DeviceOrientationManagerFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); final List args = (message as List?)!; final String? arg_orientation = (args[0] as String?); assert(arg_orientation != null, @@ -1117,7 +1135,7 @@ class _PreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1135,12 +1153,14 @@ class PreviewHostApi { static const MessageCodec codec = _PreviewHostApiCodec(); - Future create(int arg_identifier, int? arg_rotation, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_rotation, + int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_rotation, arg_resolutionSelectorId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1188,8 +1208,7 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1237,8 +1256,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1324,8 +1343,8 @@ class VideoCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1348,7 +1367,8 @@ abstract class VideoCaptureFlutterApi { void create(int identifier); - static void setup(VideoCaptureFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(VideoCaptureFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureFlutterApi.create', codec, @@ -1358,7 +1378,7 @@ abstract class VideoCaptureFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1381,12 +1401,17 @@ class RecorderHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_aspectRatio, int? arg_bitRate, int? arg_qualitySelectorId) async { + Future create(int arg_identifier, int? arg_aspectRatio, + int? arg_bitRate, int? arg_qualitySelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_aspectRatio, + arg_bitRate, + arg_qualitySelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1432,7 +1457,8 @@ class RecorderHostApi { Future getTargetVideoEncodingBitRate(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -1461,8 +1487,8 @@ class RecorderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_path]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_path]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1490,7 +1516,8 @@ abstract class RecorderFlutterApi { void create(int identifier, int? aspectRatio, int? bitRate); - static void setup(RecorderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(RecorderFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderFlutterApi.create', codec, @@ -1500,7 +1527,7 @@ abstract class RecorderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1558,7 +1585,8 @@ abstract class PendingRecordingFlutterApi { void create(int identifier); - static void setup(PendingRecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(PendingRecordingFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingFlutterApi.create', codec, @@ -1568,7 +1596,7 @@ abstract class PendingRecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1685,7 +1713,8 @@ abstract class RecordingFlutterApi { void create(int identifier); - static void setup(RecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(RecordingFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingFlutterApi.create', codec, @@ -1695,7 +1724,7 @@ abstract class RecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1718,12 +1747,17 @@ class ImageCaptureHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, int? arg_flashMode, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, + int? arg_flashMode, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_targetRotation, + arg_flashMode, + arg_resolutionSelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1744,8 +1778,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_flashMode]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_flashMode]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1793,8 +1827,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1827,7 +1861,7 @@ class _ResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1845,12 +1879,14 @@ class ResolutionStrategyHostApi { static const MessageCodec codec = _ResolutionStrategyHostApiCodec(); - Future create(int arg_identifier, ResolutionInfo? arg_boundSize, int? arg_fallbackRule) async { + Future create(int arg_identifier, ResolutionInfo? arg_boundSize, + int? arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_boundSize, arg_fallbackRule]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_boundSize, arg_fallbackRule]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1878,12 +1914,16 @@ class ResolutionSelectorHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, int? arg_aspectRatioStrategyIdentifier) async { + Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, + int? arg_aspectRatioStrategyIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_resolutionStrategyIdentifier, arg_aspectRatioStrategyIdentifier]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_resolutionStrategyIdentifier, + arg_aspectRatioStrategyIdentifier + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1911,12 +1951,16 @@ class AspectRatioStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_preferredAspectRatio, int arg_fallbackRule) async { + Future create(int arg_identifier, int arg_preferredAspectRatio, + int arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_preferredAspectRatio, arg_fallbackRule]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_preferredAspectRatio, + arg_fallbackRule + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1949,7 +1993,7 @@ class _CameraStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraStateTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1962,7 +2006,8 @@ abstract class CameraStateFlutterApi { void create(int identifier, CameraStateTypeData type, int? errorIdentifier); - static void setup(CameraStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateFlutterApi.create', codec, @@ -1972,12 +2017,13 @@ abstract class CameraStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null int.'); - final CameraStateTypeData? arg_type = (args[1] as CameraStateTypeData?); + final CameraStateTypeData? arg_type = + (args[1] as CameraStateTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null CameraStateTypeData.'); final int? arg_errorIdentifier = (args[2] as int?); @@ -2004,7 +2050,7 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ExposureCompensationRange.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2015,9 +2061,13 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { abstract class ExposureStateFlutterApi { static const MessageCodec codec = _ExposureStateFlutterApiCodec(); - void create(int identifier, ExposureCompensationRange exposureCompensationRange, double exposureCompensationStep); + void create( + int identifier, + ExposureCompensationRange exposureCompensationRange, + double exposureCompensationStep); - static void setup(ExposureStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ExposureStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ExposureStateFlutterApi.create', codec, @@ -2027,18 +2077,20 @@ abstract class ExposureStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null int.'); - final ExposureCompensationRange? arg_exposureCompensationRange = (args[1] as ExposureCompensationRange?); + final ExposureCompensationRange? arg_exposureCompensationRange = + (args[1] as ExposureCompensationRange?); assert(arg_exposureCompensationRange != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null ExposureCompensationRange.'); final double? arg_exposureCompensationStep = (args[2] as double?); assert(arg_exposureCompensationStep != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null double.'); - api.create(arg_identifier!, arg_exposureCompensationRange!, arg_exposureCompensationStep!); + api.create(arg_identifier!, arg_exposureCompensationRange!, + arg_exposureCompensationStep!); return; }); } @@ -2051,7 +2103,8 @@ abstract class ZoomStateFlutterApi { void create(int identifier, double minZoomRatio, double maxZoomRatio); - static void setup(ZoomStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ZoomStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ZoomStateFlutterApi.create', codec, @@ -2061,7 +2114,7 @@ abstract class ZoomStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2090,12 +2143,16 @@ class ImageAnalysisHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, + int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_targetRotation, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_targetRotation, + arg_resolutionSelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2112,12 +2169,14 @@ class ImageAnalysisHostApi { } } - Future setAnalyzer(int arg_identifier, int arg_analyzerIdentifier) async { + Future setAnalyzer( + int arg_identifier, int arg_analyzerIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_analyzerIdentifier]) as List?; + await channel.send([arg_identifier, arg_analyzerIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2160,8 +2219,8 @@ class ImageAnalysisHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2250,7 +2309,8 @@ abstract class ObserverFlutterApi { void onChanged(int identifier, int valueIdentifier); - static void setup(ObserverFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ObserverFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverFlutterApi.onChanged', codec, @@ -2260,7 +2320,7 @@ abstract class ObserverFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); + 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2281,7 +2341,8 @@ abstract class CameraStateErrorFlutterApi { void create(int identifier, int code); - static void setup(CameraStateErrorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateErrorFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateErrorFlutterApi.create', codec, @@ -2291,7 +2352,7 @@ abstract class CameraStateErrorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2322,7 +2383,7 @@ class _LiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2345,7 +2406,8 @@ class LiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_observerIdentifier]) as List?; + await channel.send([arg_identifier, arg_observerIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2384,12 +2446,13 @@ class LiveDataHostApi { } } - Future getValue(int arg_identifier, LiveDataSupportedTypeData arg_type) async { + Future getValue( + int arg_identifier, LiveDataSupportedTypeData arg_type) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_type]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_type]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2422,7 +2485,7 @@ class _LiveDataFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2435,7 +2498,8 @@ abstract class LiveDataFlutterApi { void create(int identifier, LiveDataSupportedTypeData type); - static void setup(LiveDataFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(LiveDataFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataFlutterApi.create', codec, @@ -2445,12 +2509,13 @@ abstract class LiveDataFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = + (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null LiveDataSupportedTypeData.'); api.create(arg_identifier!, arg_type!); @@ -2468,7 +2533,8 @@ abstract class AnalyzerFlutterApi { void analyze(int identifier, int imageProxyIdentifier); - static void setup(AnalyzerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(AnalyzerFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerFlutterApi.create', codec, @@ -2478,7 +2544,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2497,7 +2563,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2578,7 +2644,8 @@ abstract class ImageProxyFlutterApi { void create(int identifier, int format, int height, int width); - static void setup(ImageProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ImageProxyFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyFlutterApi.create', codec, @@ -2588,7 +2655,7 @@ abstract class ImageProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2615,7 +2682,8 @@ abstract class PlaneProxyFlutterApi { void create(int identifier, Uint8List buffer, int pixelStride, int rowStride); - static void setup(PlaneProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(PlaneProxyFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PlaneProxyFlutterApi.create', codec, @@ -2625,7 +2693,7 @@ abstract class PlaneProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2639,7 +2707,8 @@ abstract class PlaneProxyFlutterApi { final int? arg_rowStride = (args[3] as int?); assert(arg_rowStride != null, 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); + api.create( + arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); return; }); } @@ -2665,9 +2734,9 @@ class _QualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2685,12 +2754,18 @@ class QualitySelectorHostApi { static const MessageCodec codec = _QualitySelectorHostApiCodec(); - Future create(int arg_identifier, List arg_videoQualityDataList, int? arg_fallbackStrategyId) async { + Future create( + int arg_identifier, + List arg_videoQualityDataList, + int? arg_fallbackStrategyId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_videoQualityDataList, arg_fallbackStrategyId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_videoQualityDataList, + arg_fallbackStrategyId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2707,12 +2782,13 @@ class QualitySelectorHostApi { } } - Future getResolution(int arg_cameraInfoId, VideoQuality arg_quality) async { + Future getResolution( + int arg_cameraInfoId, VideoQuality arg_quality) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_cameraInfoId, arg_quality.index]) as List?; + final List? replyList = await channel + .send([arg_cameraInfoId, arg_quality.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2745,12 +2821,16 @@ class FallbackStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, VideoQuality arg_quality, VideoResolutionFallbackRule arg_fallbackRule) async { + Future create(int arg_identifier, VideoQuality arg_quality, + VideoResolutionFallbackRule arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_quality.index, arg_fallbackRule.index]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_quality.index, + arg_fallbackRule.index + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2782,8 +2862,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_torch]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_torch]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2804,8 +2884,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_ratio]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_ratio]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2822,12 +2902,14 @@ class CameraControlHostApi { } } - Future startFocusAndMetering(int arg_identifier, int arg_focusMeteringActionId) async { + Future startFocusAndMetering( + int arg_identifier, int arg_focusMeteringActionId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_focusMeteringActionId]) as List?; + await channel.send([arg_identifier, arg_focusMeteringActionId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2866,12 +2948,14 @@ class CameraControlHostApi { } } - Future setExposureCompensationIndex(int arg_identifier, int arg_index) async { + Future setExposureCompensationIndex( + int arg_identifier, int arg_index) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_index]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2894,7 +2978,8 @@ abstract class CameraControlFlutterApi { void create(int identifier); - static void setup(CameraControlFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraControlFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlFlutterApi.create', codec, @@ -2904,7 +2989,7 @@ abstract class CameraControlFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2932,7 +3017,7 @@ class _FocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2950,12 +3035,14 @@ class FocusMeteringActionHostApi { static const MessageCodec codec = _FocusMeteringActionHostApiCodec(); - Future create(int arg_identifier, List arg_meteringPointInfos) async { + Future create(int arg_identifier, + List arg_meteringPointInfos) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_meteringPointInfos]) as List?; + await channel.send([arg_identifier, arg_meteringPointInfos]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2985,7 +3072,8 @@ class FocusMeteringResultHostApi { Future isFocusSuccessful(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -3016,7 +3104,8 @@ abstract class FocusMeteringResultFlutterApi { void create(int identifier); - static void setup(FocusMeteringResultFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(FocusMeteringResultFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringResultFlutterApi.create', codec, @@ -3026,7 +3115,7 @@ abstract class FocusMeteringResultFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3049,12 +3138,14 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size) async { + Future create( + int arg_identifier, double arg_x, double arg_y, double? arg_size) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_x, arg_y, arg_size]) as List?; + await channel.send([arg_identifier, arg_x, arg_y, arg_size]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3075,8 +3166,7 @@ class MeteringPointHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3132,19 +3222,19 @@ class _CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); - case 129: + case 129: return CameraStateTypeData.decode(readValue(buffer)!); - case 130: + case 130: return ExposureCompensationRange.decode(readValue(buffer)!); - case 131: + case 131: return LiveDataSupportedTypeData.decode(readValue(buffer)!); - case 132: + case 132: return MeteringPointInfo.decode(readValue(buffer)!); - case 133: + case 133: return ResolutionInfo.decode(readValue(buffer)!); - case 134: + case 134: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3160,14 +3250,16 @@ class CaptureRequestOptionsHostApi { : _binaryMessenger = binaryMessenger; final BinaryMessenger? _binaryMessenger; - static const MessageCodec codec = _CaptureRequestOptionsHostApiCodec(); + static const MessageCodec codec = + _CaptureRequestOptionsHostApiCodec(); - Future create(int arg_identifier, Map arg_options) async { + Future create( + int arg_identifier, Map arg_options) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CaptureRequestOptionsHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_options]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_options]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3195,12 +3287,14 @@ class Camera2CameraControlHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_cameraControlIdentifier) async { + Future create( + int arg_identifier, int arg_cameraControlIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraControlHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraControlIdentifier]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_cameraControlIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3217,12 +3311,15 @@ class Camera2CameraControlHostApi { } } - Future addCaptureRequestOptions(int arg_identifier, int arg_captureRequestOptionsIdentifier) async { + Future addCaptureRequestOptions( + int arg_identifier, int arg_captureRequestOptionsIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', codec, + 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_captureRequestOptionsIdentifier]) as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_captureRequestOptionsIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', diff --git a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index dfb43433650..3fe7e23c586 100644 --- a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart @@ -14,7 +14,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; abstract class TestInstanceManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); /// Clear the native `InstanceManager`. @@ -22,15 +23,19 @@ abstract class TestInstanceManagerHostApi { /// This is typically only used after a hot restart. void clear(); - static void setup(TestInstanceManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestInstanceManagerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.clear(); return []; @@ -41,22 +46,27 @@ abstract class TestInstanceManagerHostApi { } abstract class TestJavaObjectHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void dispose(int identifier); - static void setup(TestJavaObjectHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestJavaObjectHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -70,7 +80,8 @@ abstract class TestJavaObjectHostApi { } abstract class TestCameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getSensorRotationDegrees(int identifier); @@ -81,17 +92,22 @@ abstract class TestCameraInfoHostApi { int getZoomState(int identifier); - static void setup(TestCameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraInfoHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec, + 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -106,11 +122,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getCameraState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -125,11 +144,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getExposureState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -144,11 +166,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getZoomState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -162,24 +187,29 @@ abstract class TestCameraInfoHostApi { } abstract class TestCameraSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? lensFacing); List filter(int identifier, List cameraInfoIds); - static void setup(TestCameraSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraSelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -195,19 +225,24 @@ abstract class TestCameraSelectorHostApi { 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null int.'); - final List? arg_cameraInfoIds = (args[1] as List?)?.cast(); + final List? arg_cameraInfoIds = + (args[1] as List?)?.cast(); assert(arg_cameraInfoIds != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List.'); - final List output = api.filter(arg_identifier!, arg_cameraInfoIds!); + final List output = + api.filter(arg_identifier!, arg_cameraInfoIds!); return [output]; }); } @@ -216,14 +251,16 @@ abstract class TestCameraSelectorHostApi { } abstract class TestProcessCameraProviderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future getInstance(); List getAvailableCameraInfos(int identifier); - int bindToLifecycle(int identifier, int cameraSelectorIdentifier, List useCaseIds); + int bindToLifecycle( + int identifier, int cameraSelectorIdentifier, List useCaseIds); bool isBound(int identifier, int useCaseIdentifier); @@ -231,15 +268,19 @@ abstract class TestProcessCameraProviderHostApi { void unbindAll(int identifier); - static void setup(TestProcessCameraProviderHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestProcessCameraProviderHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final int output = await api.getInstance(); return [output]; @@ -248,33 +289,42 @@ abstract class TestProcessCameraProviderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.'); - final List output = api.getAvailableCameraInfos(arg_identifier!); + final List output = + api.getAvailableCameraInfos(arg_identifier!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -282,10 +332,12 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_cameraSelectorIdentifier = (args[1] as int?); assert(arg_cameraSelectorIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null int.'); - final List? arg_useCaseIds = (args[2] as List?)?.cast(); + final List? arg_useCaseIds = + (args[2] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List.'); - final int output = api.bindToLifecycle(arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); + final int output = api.bindToLifecycle( + arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); return [output]; }); } @@ -295,11 +347,14 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -307,7 +362,8 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_useCaseIdentifier = (args[1] as int?); assert(arg_useCaseIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.'); - final bool output = api.isBound(arg_identifier!, arg_useCaseIdentifier!); + final bool output = + api.isBound(arg_identifier!, arg_useCaseIdentifier!); return [output]; }); } @@ -317,16 +373,20 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null int.'); - final List? arg_useCaseIds = (args[1] as List?)?.cast(); + final List? arg_useCaseIds = + (args[1] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List.'); api.unbind(arg_identifier!, arg_useCaseIds!); @@ -339,11 +399,14 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -357,24 +420,29 @@ abstract class TestProcessCameraProviderHostApi { } abstract class TestCameraHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getCameraInfo(int identifier); int getCameraControl(int identifier); - static void setup(TestCameraHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraHostApi.getCameraInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -389,11 +457,14 @@ abstract class TestCameraHostApi { 'dev.flutter.pigeon.CameraHostApi.getCameraControl', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -421,7 +492,7 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -430,29 +501,37 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { } abstract class TestSystemServicesHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestSystemServicesHostApiCodec(); - Future requestCameraPermissions(bool enableAudio); + Future requestCameraPermissions( + bool enableAudio); String getTempFilePath(String prefix, String suffix); - static void setup(TestSystemServicesHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestSystemServicesHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); final List args = (message as List?)!; final bool? arg_enableAudio = (args[0] as bool?); assert(arg_enableAudio != null, 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.'); - final CameraPermissionsErrorData? output = await api.requestCameraPermissions(arg_enableAudio!); + final CameraPermissionsErrorData? output = + await api.requestCameraPermissions(arg_enableAudio!); return [output]; }); } @@ -462,11 +541,14 @@ abstract class TestSystemServicesHostApi { 'dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); final List args = (message as List?)!; final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, @@ -483,26 +565,33 @@ abstract class TestSystemServicesHostApi { } abstract class TestDeviceOrientationManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void startListeningForDeviceOrientationChange(bool isFrontFacing, int sensorOrientation); + void startListeningForDeviceOrientationChange( + bool isFrontFacing, int sensorOrientation); void stopListeningForDeviceOrientationChange(); int getDefaultDisplayRotation(); - static void setup(TestDeviceOrientationManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestDeviceOrientationManagerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); final List args = (message as List?)!; final bool? arg_isFrontFacing = (args[0] as bool?); assert(arg_isFrontFacing != null, @@ -510,19 +599,24 @@ abstract class TestDeviceOrientationManagerHostApi { final int? arg_sensorOrientation = (args[1] as int?); assert(arg_sensorOrientation != null, 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.'); - api.startListeningForDeviceOrientationChange(arg_isFrontFacing!, arg_sensorOrientation!); + api.startListeningForDeviceOrientationChange( + arg_isFrontFacing!, arg_sensorOrientation!); return []; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.stopListeningForDeviceOrientationChange(); return []; @@ -531,12 +625,16 @@ abstract class TestDeviceOrientationManagerHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final int output = api.getDefaultDisplayRotation(); return [output]; @@ -561,7 +659,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -570,7 +668,8 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { } abstract class TestPreviewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestPreviewHostApiCodec(); void create(int identifier, int? rotation, int? resolutionSelectorId); @@ -583,17 +682,21 @@ abstract class TestPreviewHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestPreviewHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPreviewHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -610,11 +713,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -626,12 +732,16 @@ abstract class TestPreviewHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, + 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.releaseFlutterSurfaceTexture(); return []; @@ -643,11 +753,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -662,11 +775,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -683,7 +799,8 @@ abstract class TestPreviewHostApi { } abstract class TestVideoCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int withOutput(int videoOutputId); @@ -692,17 +809,21 @@ abstract class TestVideoCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestVideoCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestVideoCaptureHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.withOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); final List args = (message as List?)!; final int? arg_videoOutputId = (args[0] as int?); assert(arg_videoOutputId != null, @@ -717,11 +838,14 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.getOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -736,11 +860,14 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -757,10 +884,12 @@ abstract class TestVideoCaptureHostApi { } abstract class TestRecorderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); + void create( + int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); int getAspectRatio(int identifier); @@ -768,17 +897,21 @@ abstract class TestRecorderHostApi { int prepareRecording(int identifier, String path); - static void setup(TestRecorderHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecorderHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -786,7 +919,8 @@ abstract class TestRecorderHostApi { final int? arg_aspectRatio = (args[1] as int?); final int? arg_bitRate = (args[2] as int?); final int? arg_qualitySelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId); + api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, + arg_qualitySelectorId); return []; }); } @@ -796,11 +930,14 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.getAspectRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -812,14 +949,18 @@ abstract class TestRecorderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -834,11 +975,14 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -855,22 +999,27 @@ abstract class TestRecorderHostApi { } abstract class TestPendingRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int start(int identifier); - static void setup(TestPendingRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPendingRecordingHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingHostApi.start', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -884,7 +1033,8 @@ abstract class TestPendingRecordingHostApi { } abstract class TestRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void close(int identifier); @@ -895,17 +1045,21 @@ abstract class TestRecordingHostApi { void stop(int identifier); - static void setup(TestRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecordingHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -920,11 +1074,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.pause', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -939,11 +1096,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.resume', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -958,11 +1118,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.stop', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -976,10 +1139,12 @@ abstract class TestRecordingHostApi { } abstract class TestImageCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? targetRotation, int? flashMode, int? resolutionSelectorId); + void create(int identifier, int? targetRotation, int? flashMode, + int? resolutionSelectorId); void setFlashMode(int identifier, int flashMode); @@ -987,17 +1152,21 @@ abstract class TestImageCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageCaptureHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1005,7 +1174,8 @@ abstract class TestImageCaptureHostApi { final int? arg_targetRotation = (args[1] as int?); final int? arg_flashMode = (args[2] as int?); final int? arg_resolutionSelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_flashMode, + arg_resolutionSelectorId); return []; }); } @@ -1015,11 +1185,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1037,11 +1210,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1056,11 +1232,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1091,7 +1270,7 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1100,22 +1279,28 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestResolutionStrategyHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestResolutionStrategyHostApiCodec(); void create(int identifier, ResolutionInfo? boundSize, int? fallbackRule); - static void setup(TestResolutionStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1131,29 +1316,36 @@ abstract class TestResolutionStrategyHostApi { } abstract class TestResolutionSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? resolutionStrategyIdentifier, int? aspectRatioStrategyIdentifier); + void create(int identifier, int? resolutionStrategyIdentifier, + int? aspectRatioStrategyIdentifier); - static void setup(TestResolutionSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionSelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null, expected non-null int.'); final int? arg_resolutionStrategyIdentifier = (args[1] as int?); final int? arg_aspectRatioStrategyIdentifier = (args[2] as int?); - api.create(arg_identifier!, arg_resolutionStrategyIdentifier, arg_aspectRatioStrategyIdentifier); + api.create(arg_identifier!, arg_resolutionStrategyIdentifier, + arg_aspectRatioStrategyIdentifier); return []; }); } @@ -1162,22 +1354,27 @@ abstract class TestResolutionSelectorHostApi { } abstract class TestAspectRatioStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int preferredAspectRatio, int fallbackRule); - static void setup(TestAspectRatioStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestAspectRatioStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1188,7 +1385,8 @@ abstract class TestAspectRatioStrategyHostApi { final int? arg_fallbackRule = (args[2] as int?); assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); + api.create( + arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); return []; }); } @@ -1197,7 +1395,8 @@ abstract class TestAspectRatioStrategyHostApi { } abstract class TestImageAnalysisHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? targetRotation, int? resolutionSelectorId); @@ -1208,24 +1407,29 @@ abstract class TestImageAnalysisHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageAnalysisHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageAnalysisHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null, expected non-null int.'); final int? arg_targetRotation = (args[1] as int?); final int? arg_resolutionSelectorId = (args[2] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); + api.create( + arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); return []; }); } @@ -1235,11 +1439,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1257,11 +1464,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1276,11 +1486,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1297,22 +1510,27 @@ abstract class TestImageAnalysisHostApi { } abstract class TestAnalyzerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestAnalyzerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestAnalyzerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1326,22 +1544,27 @@ abstract class TestAnalyzerHostApi { } abstract class TestObserverHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestObserverHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestObserverHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1369,7 +1592,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1378,7 +1601,8 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { } abstract class TestLiveDataHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestLiveDataHostApiCodec(); void observe(int identifier, int observerIdentifier); @@ -1387,17 +1611,21 @@ abstract class TestLiveDataHostApi { int? getValue(int identifier, LiveDataSupportedTypeData type); - static void setup(TestLiveDataHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestLiveDataHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1415,11 +1643,14 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.removeObservers', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1434,16 +1665,20 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = + (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null LiveDataSupportedTypeData.'); final int? output = api.getValue(arg_identifier!, arg_type!); @@ -1455,24 +1690,29 @@ abstract class TestLiveDataHostApi { } abstract class TestImageProxyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); List getPlanes(int identifier); void close(int identifier); - static void setup(TestImageProxyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageProxyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyHostApi.getPlanes', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1487,11 +1727,14 @@ abstract class TestImageProxyHostApi { 'dev.flutter.pigeon.ImageProxyHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1522,9 +1765,9 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1533,33 +1776,41 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { } abstract class TestQualitySelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestQualitySelectorHostApiCodec(); - void create(int identifier, List videoQualityDataList, int? fallbackStrategyId); + void create(int identifier, List videoQualityDataList, + int? fallbackStrategyId); ResolutionInfo getResolution(int cameraInfoId, VideoQuality quality); - static void setup(TestQualitySelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestQualitySelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null int.'); - final List? arg_videoQualityDataList = (args[1] as List?)?.cast(); + final List? arg_videoQualityDataList = + (args[1] as List?)?.cast(); assert(arg_videoQualityDataList != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null List.'); final int? arg_fallbackStrategyId = (args[2] as int?); - api.create(arg_identifier!, arg_videoQualityDataList!, arg_fallbackStrategyId); + api.create(arg_identifier!, arg_videoQualityDataList!, + arg_fallbackStrategyId); return []; }); } @@ -1569,19 +1820,24 @@ abstract class TestQualitySelectorHostApi { 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); final List args = (message as List?)!; final int? arg_cameraInfoId = (args[0] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null int.'); - final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = + args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null VideoQuality.'); - final ResolutionInfo output = api.getResolution(arg_cameraInfoId!, arg_quality!); + final ResolutionInfo output = + api.getResolution(arg_cameraInfoId!, arg_quality!); return [output]; }); } @@ -1590,30 +1846,39 @@ abstract class TestQualitySelectorHostApi { } abstract class TestFallbackStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, VideoQuality quality, VideoResolutionFallbackRule fallbackRule); + void create(int identifier, VideoQuality quality, + VideoResolutionFallbackRule fallbackRule); - static void setup(TestFallbackStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFallbackStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null int.'); - final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = + args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoQuality.'); - final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null ? null : VideoResolutionFallbackRule.values[args[2] as int]; + final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null + ? null + : VideoResolutionFallbackRule.values[args[2] as int]; assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoResolutionFallbackRule.'); api.create(arg_identifier!, arg_quality!, arg_fallbackRule!); @@ -1625,7 +1890,8 @@ abstract class TestFallbackStrategyHostApi { } abstract class TestCameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future enableTorch(int identifier, bool torch); @@ -1638,17 +1904,21 @@ abstract class TestCameraControlHostApi { Future setExposureCompensationIndex(int identifier, int index); - static void setup(TestCameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraControlHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1666,11 +1936,14 @@ abstract class TestCameraControlHostApi { 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1685,14 +1958,18 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, + 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1700,21 +1977,26 @@ abstract class TestCameraControlHostApi { final int? arg_focusMeteringActionId = (args[1] as int?); assert(arg_focusMeteringActionId != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null, expected non-null int.'); - final int? output = await api.startFocusAndMetering(arg_identifier!, arg_focusMeteringActionId!); + final int? output = await api.startFocusAndMetering( + arg_identifier!, arg_focusMeteringActionId!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', codec, + 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1726,14 +2008,18 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1741,7 +2027,8 @@ abstract class TestCameraControlHostApi { final int? arg_index = (args[1] as int?); assert(arg_index != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null, expected non-null int.'); - final int? output = await api.setExposureCompensationIndex(arg_identifier!, arg_index!); + final int? output = await api.setExposureCompensationIndex( + arg_identifier!, arg_index!); return [output]; }); } @@ -1764,7 +2051,7 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1773,27 +2060,34 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { } abstract class TestFocusMeteringActionHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestFocusMeteringActionHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestFocusMeteringActionHostApiCodec(); void create(int identifier, List meteringPointInfos); - static void setup(TestFocusMeteringActionHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringActionHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null int.'); - final List? arg_meteringPointInfos = (args[1] as List?)?.cast(); + final List? arg_meteringPointInfos = + (args[1] as List?)?.cast(); assert(arg_meteringPointInfos != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null List.'); api.create(arg_identifier!, arg_meteringPointInfos!); @@ -1805,22 +2099,28 @@ abstract class TestFocusMeteringActionHostApi { } abstract class TestFocusMeteringResultHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); bool isFocusSuccessful(int identifier); - static void setup(TestFocusMeteringResultHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringResultHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1834,24 +2134,29 @@ abstract class TestFocusMeteringResultHostApi { } abstract class TestMeteringPointHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, double x, double y, double? size); double getDefaultPointSize(); - static void setup(TestMeteringPointHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestMeteringPointHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1873,9 +2178,12 @@ abstract class TestMeteringPointHostApi { 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final double output = api.getDefaultPointSize(); return [output]; @@ -1918,19 +2226,19 @@ class _TestCaptureRequestOptionsHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); - case 129: + case 129: return CameraStateTypeData.decode(readValue(buffer)!); - case 130: + case 130: return ExposureCompensationRange.decode(readValue(buffer)!); - case 131: + case 131: return LiveDataSupportedTypeData.decode(readValue(buffer)!); - case 132: + case 132: return MeteringPointInfo.decode(readValue(buffer)!); - case 133: + case 133: return ResolutionInfo.decode(readValue(buffer)!); - case 134: + case 134: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1939,27 +2247,34 @@ class _TestCaptureRequestOptionsHostApiCodec extends StandardMessageCodec { } abstract class TestCaptureRequestOptionsHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestCaptureRequestOptionsHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestCaptureRequestOptionsHostApiCodec(); void create(int identifier, Map options); - static void setup(TestCaptureRequestOptionsHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCaptureRequestOptionsHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CaptureRequestOptionsHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null, expected non-null int.'); - final Map? arg_options = (args[1] as Map?)?.cast(); + final Map? arg_options = + (args[1] as Map?)?.cast(); assert(arg_options != null, 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null, expected non-null Map.'); api.create(arg_identifier!, arg_options!); @@ -1971,24 +2286,30 @@ abstract class TestCaptureRequestOptionsHostApi { } abstract class TestCamera2CameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int cameraControlIdentifier); - Future addCaptureRequestOptions(int identifier, int captureRequestOptionsIdentifier); + Future addCaptureRequestOptions( + int identifier, int captureRequestOptionsIdentifier); - static void setup(TestCamera2CameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCamera2CameraControlHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraControlHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2003,14 +2324,18 @@ abstract class TestCamera2CameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', codec, + 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2018,7 +2343,8 @@ abstract class TestCamera2CameraControlHostApi { final int? arg_captureRequestOptionsIdentifier = (args[1] as int?); assert(arg_captureRequestOptionsIdentifier != null, 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null, expected non-null int.'); - await api.addCaptureRequestOptions(arg_identifier!, arg_captureRequestOptionsIdentifier!); + await api.addCaptureRequestOptions( + arg_identifier!, arg_captureRequestOptionsIdentifier!); return []; }); } From 2843626f0b70704a914bbe4ee031efc295612c89 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Feb 2024 16:21:48 -0800 Subject: [PATCH 09/23] Update readme + bump version --- packages/camera/camera_android_camerax/CHANGELOG.md | 4 ++++ packages/camera/camera_android_camerax/README.md | 9 ++++----- packages/camera/camera_android_camerax/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 9db3eadff53..851d4a084d6 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.0+32 + +* Implements `setFocusPoint`, `setExposurePoint`, and `setExposureOffset`. + ## 0.5.0+31 * Wraps CameraX classes needed to set capture request options, which is needed to implement setting the exposure mode. diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index 3a2e49d7e60..2dd405d7def 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -24,20 +24,19 @@ dependencies: ## Missing features and limitations - ### 240p resolution configuration for video recording 240p resolution configuration for video recording is unsupported by CameraX, and thus, the plugin will fall back to 480p if configured with a `ResolutionPreset`. -### Exposure mode, point, & offset configuration \[[Issue #120468][120468]\] +### Exposure mode configuration \[[Issue #120468][120468]\] -`setExposureMode`, `setExposurePoint`, & `setExposureOffset` are unimplemented. +`setExposureMode`is unimplemented. -### Focus mode & point configuration \[[Issue #120467][120467]\] +### Focus mode configuration \[[Issue #120467][120467]\] -`setFocusMode` & `setFocusPoint` are unimplemented. +`setFocusMode` is unimplemented. ### Setting maximum duration and stream options for video capture diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index f40f6a3d55d..c9da1786693 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.5.0+31 +version: 0.5.0+32 environment: sdk: ">=3.0.0 <4.0.0" From 35ebf1310612c43adc5487468e1f0b85866fd6a3 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 7 Feb 2024 09:46:40 -0800 Subject: [PATCH 10/23] Improve docs --- .../lib/src/android_camera_camerax.dart | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index a4df8b3b4f9..98d89e63c79 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -516,6 +516,8 @@ class AndroidCameraCameraX extends CameraPlatform { 'Exposure compensation not supported'); } + // (Exposure compensation index) * (exposure offset setep size) = + // (exposure offset). final int roundedExposureCompensationIndex = (offset / exposureOffsetStepSize).round(); @@ -1064,7 +1066,13 @@ class AndroidCameraCameraX extends CameraPlatform { /// Starts a foucs and metering action. /// - /// If [meteringPoint] is non-null, this action includes + /// This method will merge the current action's metering points with that + /// specified such that only one auto-exposure metering point and one + /// auto-focus metering point will be part of the action. This method would + /// also accommodatate at most on auto-white balance metering point, but that + /// mode is currently unused in this plugin. + /// + /// Thus, if [meteringPoint] is non-null, this action includes: /// * metering points and their modes previously added to /// [currentFocusMeteringAction] that do not share a metering mode with /// [meteringPoint] and @@ -1072,7 +1080,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// If [meteringPoint] is null, this action includes only metering points and /// their modes previously added to [currentFocusMeteringAction] that do not /// share a metering mode with [meteringPoint]. If there are no such metering - /// points, then any previously enabled focus and metering actions will be + /// points, then the previously enabled focus and metering actions will be /// canceled. Future _startFocusAndMeteringFor( {required Point? meteringPoint, @@ -1105,7 +1113,6 @@ class AndroidCameraCameraX extends CameraPlatform { await cameraControl!.cancelFocusAndMetering(); return; } - currentFocusMeteringAction = proxy.createFocusMeteringAction(newMeteringPointInfos); } else if (meteringPoint.x < 0 || @@ -1114,9 +1121,9 @@ class AndroidCameraCameraX extends CameraPlatform { throw CameraException('meteringPointInvalid', 'The coordinates of a metering point for an auto-focus or auto-exposure action must be within (0,0) and (1,1).'); } else { - // Add new metering point with specified meteringMode, which might - // involve replacing a metering point with the same specified meteringMode - // from the current focus and metering action. + // Add new metering point with specified meteringMode, which may involve + // replacing a metering point with the same specified meteringMode from + // the current focus and metering action. List<(MeteringPoint, int?)> newMeteringPointInfos = <(MeteringPoint, int?)>[]; From c2f75ecf2672d64ae42411438aab8ece1de3a84a Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 8 Feb 2024 10:20:20 -0800 Subject: [PATCH 11/23] Change metering point factory --- .../camerax/CameraAndroidCameraxPlugin.java | 8 +- .../camerax/GeneratedCameraXLibrary.java | 10 +- .../camerax/MeteringPointHostApiImpl.java | 59 ++++-- .../CameraAndroidCameraxPluginTest.java | 16 ++ .../plugins/camerax/MeteringPointTest.java | 174 +++++++++++++++--- .../lib/src/android_camera_camerax.dart | 4 +- .../lib/src/camerax_library.g.dart | 10 +- .../lib/src/camerax_proxy.dart | 12 +- .../lib/src/metering_point.dart | 17 +- .../pigeons/camerax_library.dart | 3 +- .../test/android_camera_camerax_test.dart | 93 ++++++++-- .../camera2_camera_control_test.mocks.dart | 63 ++++--- .../focus_metering_action_test.mocks.dart | 34 +++- .../focus_metering_result_test.mocks.dart | 30 ++- .../test/metering_point_test.dart | 22 ++- .../test/metering_point_test.mocks.dart | 103 ++++++++++- .../test/test_camerax_library.g.dart | 9 +- 17 files changed, 548 insertions(+), 119 deletions(-) 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 fdca88b4f3c..ea9f3ed4d06 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 @@ -27,6 +27,7 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting @Nullable public ImageCaptureHostApiImpl imageCaptureHostApiImpl; @VisibleForTesting @Nullable public CameraControlHostApiImpl cameraControlHostApiImpl; @VisibleForTesting @Nullable public SystemServicesHostApiImpl systemServicesHostApiImpl; + @VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl; @VisibleForTesting public @Nullable DeviceOrientationManagerHostApiImpl deviceOrientationManagerHostApiImpl; @@ -123,8 +124,8 @@ public void setUp( binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager)); GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup( binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); - GeneratedCameraXLibrary.MeteringPointHostApi.setup( - binaryMessenger, new MeteringPointHostApiImpl(instanceManager)); + meteringPointHostApiImpl = new MeteringPointHostApiImpl(instanceManager); + GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, meteringPointHostApiImpl); } @Override @@ -244,5 +245,8 @@ public void updateActivity(@Nullable Activity activity) { if (deviceOrientationManagerHostApiImpl != null) { deviceOrientationManagerHostApiImpl.setActivity(activity); } + if (meteringPointHostApiImpl != null) { + meteringPointHostApiImpl.setActivity(activity); + } } } 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 e448f311ab4..0dcf169c69e 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 @@ -3917,7 +3917,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { public interface MeteringPointHostApi { void create( - @NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size); + @NonNull Long identifier, + @NonNull Double x, + @NonNull Double y, + @Nullable Double size, + @NonNull Long cameraInfoId); @NonNull Double getDefaultPointSize(); @@ -3945,12 +3949,14 @@ static void setup( Double xArg = (Double) args.get(1); Double yArg = (Double) args.get(2); Double sizeArg = (Double) args.get(3); + Number cameraInfoIdArg = (Number) args.get(4); try { api.create( (identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, - sizeArg); + sizeArg, + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java index 56ffcfb2e39..676d0035666 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java @@ -4,13 +4,20 @@ package io.flutter.plugins.camerax; +import android.app.Activity; +import android.content.Context; +import android.os.Build; +import android.view.Display; +import android.view.WindowManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import androidx.camera.core.CameraInfo; +import androidx.camera.core.DisplayOrientedMeteringPointFactory; import androidx.camera.core.MeteringPoint; import androidx.camera.core.MeteringPointFactory; -import androidx.camera.core.SurfaceOrientedMeteringPointFactory; import io.flutter.plugins.camerax.GeneratedCameraXLibrary.MeteringPointHostApi; +import java.util.Objects; /** * Host API implementation for {@link MeteringPoint}. @@ -25,17 +32,34 @@ public class MeteringPointHostApiImpl implements MeteringPointHostApi { /** Proxy for constructor and static methods of {@link MeteringPoint}. */ @VisibleForTesting public static class MeteringPointProxy { + Activity activity; /** * Creates a surface oriented {@link MeteringPoint} with the specified x, y, and size. * - *

A {@link SurfaceOrientedMeteringPointFactory} is used to construct the {@link - * MeteringPoint} because underlying the camera preview that this plugin uses is a Flutter - * texture that is backed by a {@link Surface} created by the Flutter Android embedding. + *

A {@link DisplayOrientedMeteringPointFactory} is used to construct the {@link + * MeteringPoint} because this factory handles the transformation of specified coordinates based + * on camera information and the device orientation automatically. */ @NonNull - public MeteringPoint create(@NonNull Double x, @NonNull Double y, @Nullable Double size) { - SurfaceOrientedMeteringPointFactory factory = getSurfaceOrientedMeteringPointFactory(1f, 1f); + @SuppressWarnings("deprecation") + public MeteringPoint create( + @NonNull Double x, + @NonNull Double y, + @Nullable Double size, + @NonNull CameraInfo cameraInfo) { + Display display = null; + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + display = activity.getDisplay(); + } else { + display = + ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); + } + + DisplayOrientedMeteringPointFactory factory = + getDisplayOrientedMeteringPointFactory(display, 1f, 1f, cameraInfo); + if (size == null) { return factory.createPoint(x.floatValue(), y.floatValue()); } else { @@ -45,9 +69,9 @@ public MeteringPoint create(@NonNull Double x, @NonNull Double y, @Nullable Doub @VisibleForTesting @NonNull - public SurfaceOrientedMeteringPointFactory getSurfaceOrientedMeteringPointFactory( - float width, float height) { - return new SurfaceOrientedMeteringPointFactory(width, height); + public DisplayOrientedMeteringPointFactory getDisplayOrientedMeteringPointFactory( + Display display, float width, float height, CameraInfo cameraInfo) { + return new DisplayOrientedMeteringPointFactory(display, cameraInfo, width, height); } /** @@ -81,10 +105,23 @@ public MeteringPointHostApiImpl(@NonNull InstanceManager instanceManager) { this.proxy = proxy; } + public void setActivity(@NonNull Activity activity) { + this.proxy.activity = activity; + } + @Override public void create( - @NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size) { - MeteringPoint meteringPoint = proxy.create(x, y, size); + @NonNull Long identifier, + @NonNull Double x, + @NonNull Double y, + @Nullable Double size, + @NonNull Long cameraInfoId) { + MeteringPoint meteringPoint = + proxy.create( + x, + y, + size, + (CameraInfo) Objects.requireNonNull(instanceManager.getInstance(cameraInfoId))); instanceManager.addDartCreatedInstance(meteringPoint, identifier); } diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraAndroidCameraxPluginTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraAndroidCameraxPluginTest.java index 8c9daf8e014..f9f4be6db6e 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraAndroidCameraxPluginTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/CameraAndroidCameraxPluginTest.java @@ -92,6 +92,8 @@ public void onAttachedToActivity_setsActivityAsNeededAndPermissionsRegistry() { mock(SystemServicesHostApiImpl.class); final DeviceOrientationManagerHostApiImpl mockDeviceOrientationManagerHostApiImpl = mock(DeviceOrientationManagerHostApiImpl.class); + final MeteringPointHostApiImpl mockMeteringPointHostApiImpl = + mock(MeteringPointHostApiImpl.class); final ArgumentCaptor permissionsRegistryCaptor = ArgumentCaptor.forClass(PermissionsRegistry.class); @@ -103,6 +105,7 @@ public void onAttachedToActivity_setsActivityAsNeededAndPermissionsRegistry() { plugin.liveDataHostApiImpl = mock(LiveDataHostApiImpl.class); plugin.systemServicesHostApiImpl = mockSystemServicesHostApiImpl; plugin.deviceOrientationManagerHostApiImpl = mockDeviceOrientationManagerHostApiImpl; + plugin.meteringPointHostApiImpl = mockMeteringPointHostApiImpl; plugin.onAttachedToEngine(flutterPluginBinding); plugin.onAttachedToActivity(activityPluginBinding); @@ -110,6 +113,7 @@ public void onAttachedToActivity_setsActivityAsNeededAndPermissionsRegistry() { // Check Activity references are set. verify(mockSystemServicesHostApiImpl).setActivity(mockActivity); verify(mockDeviceOrientationManagerHostApiImpl).setActivity(mockActivity); + verify(mockMeteringPointHostApiImpl).setActivity(mockActivity); // Check permissions registry reference is set. verify(mockSystemServicesHostApiImpl) @@ -129,11 +133,14 @@ public void onAttachedToActivity_setsActivityAsNeededAndPermissionsRegistry() { mock(SystemServicesHostApiImpl.class); final DeviceOrientationManagerHostApiImpl mockDeviceOrientationManagerHostApiImpl = mock(DeviceOrientationManagerHostApiImpl.class); + final MeteringPointHostApiImpl mockMeteringPointHostApiImpl = + mock(MeteringPointHostApiImpl.class); plugin.processCameraProviderHostApiImpl = mockProcessCameraProviderHostApiImpl; plugin.liveDataHostApiImpl = mockLiveDataHostApiImpl; plugin.systemServicesHostApiImpl = mockSystemServicesHostApiImpl; plugin.deviceOrientationManagerHostApiImpl = mockDeviceOrientationManagerHostApiImpl; + plugin.meteringPointHostApiImpl = mockMeteringPointHostApiImpl; plugin.onAttachedToEngine(flutterPluginBinding); plugin.onDetachedFromActivityForConfigChanges(); @@ -142,6 +149,7 @@ public void onAttachedToActivity_setsActivityAsNeededAndPermissionsRegistry() { verify(mockLiveDataHostApiImpl).setLifecycleOwner(null); verify(mockSystemServicesHostApiImpl).setActivity(null); verify(mockDeviceOrientationManagerHostApiImpl).setActivity(null); + verify(mockMeteringPointHostApiImpl).setActivity(null); } @Test @@ -251,6 +259,8 @@ public void onReattachedToActivityForConfigChanges_setsActivityAndPermissionsReg mock(CameraControlHostApiImpl.class); final DeviceOrientationManagerHostApiImpl mockDeviceOrientationManagerHostApiImpl = mock(DeviceOrientationManagerHostApiImpl.class); + final MeteringPointHostApiImpl mockMeteringPointHostApiImpl = + mock(MeteringPointHostApiImpl.class); final ArgumentCaptor permissionsRegistryCaptor = ArgumentCaptor.forClass(PermissionsRegistry.class); @@ -265,6 +275,7 @@ public void onReattachedToActivityForConfigChanges_setsActivityAndPermissionsReg plugin.imageAnalysisHostApiImpl = mockImageAnalysisHostApiImpl; plugin.cameraControlHostApiImpl = mockCameraControlHostApiImpl; plugin.deviceOrientationManagerHostApiImpl = mockDeviceOrientationManagerHostApiImpl; + plugin.meteringPointHostApiImpl = mockMeteringPointHostApiImpl; plugin.liveDataHostApiImpl = mock(LiveDataHostApiImpl.class); plugin.onAttachedToEngine(flutterPluginBinding); @@ -273,6 +284,7 @@ public void onReattachedToActivityForConfigChanges_setsActivityAndPermissionsReg // Check Activity references are set. verify(mockSystemServicesHostApiImpl).setActivity(mockActivity); verify(mockDeviceOrientationManagerHostApiImpl).setActivity(mockActivity); + verify(mockMeteringPointHostApiImpl).setActivity(mockActivity); // Check Activity as Context references are set. verify(mockProcessCameraProviderHostApiImpl).setContext(mockActivity); @@ -300,11 +312,14 @@ public void onDetachedFromActivity_removesReferencesToActivityPluginBindingAndAc final LiveDataHostApiImpl mockLiveDataHostApiImpl = mock(LiveDataHostApiImpl.class); final DeviceOrientationManagerHostApiImpl mockDeviceOrientationManagerHostApiImpl = mock(DeviceOrientationManagerHostApiImpl.class); + final MeteringPointHostApiImpl mockMeteringPointHostApiImpl = + mock(MeteringPointHostApiImpl.class); plugin.processCameraProviderHostApiImpl = mockProcessCameraProviderHostApiImpl; plugin.liveDataHostApiImpl = mockLiveDataHostApiImpl; plugin.systemServicesHostApiImpl = mockSystemServicesHostApiImpl; plugin.deviceOrientationManagerHostApiImpl = mockDeviceOrientationManagerHostApiImpl; + plugin.meteringPointHostApiImpl = mockMeteringPointHostApiImpl; plugin.onAttachedToEngine(flutterPluginBinding); plugin.onDetachedFromActivityForConfigChanges(); @@ -313,6 +328,7 @@ public void onDetachedFromActivity_removesReferencesToActivityPluginBindingAndAc verify(mockLiveDataHostApiImpl).setLifecycleOwner(null); verify(mockSystemServicesHostApiImpl).setActivity(null); verify(mockDeviceOrientationManagerHostApiImpl).setActivity(null); + verify(mockMeteringPointHostApiImpl).setActivity(null); } @Test diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java index f245eb53124..badefc5711a 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java @@ -10,21 +10,30 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import android.app.Activity; +import android.content.Context; +import android.view.Display; +import android.view.WindowManager; +import androidx.camera.core.CameraInfo; +import androidx.camera.core.DisplayOrientedMeteringPointFactory; import androidx.camera.core.MeteringPoint; import androidx.camera.core.MeteringPointFactory; -import androidx.camera.core.SurfaceOrientedMeteringPointFactory; import io.flutter.plugin.common.BinaryMessenger; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockedStatic; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import org.mockito.stubbing.Answer; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.annotation.Config; +@RunWith(RobolectricTestRunner.class) public class MeteringPointTest { @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); @@ -44,49 +53,158 @@ public void tearDown() { } @Test - public void hostApiCreate_createsExpectedMeteringPointWithSizeSpecified() { - MeteringPointHostApiImpl.MeteringPointProxy proxySpy = + @Config(sdk = 30) + public void hostApiCreate_createsExpectedMeteringPointWithSizeSpecified_AboveAndroid30() { + final MeteringPointHostApiImpl.MeteringPointProxy proxySpy = spy(new MeteringPointHostApiImpl.MeteringPointProxy()); - MeteringPointHostApiImpl hostApi = new MeteringPointHostApiImpl(testInstanceManager, proxySpy); + final MeteringPointHostApiImpl hostApi = + new MeteringPointHostApiImpl(testInstanceManager, proxySpy); final Long meteringPointIdentifier = 78L; - final Float x = 0.3f; - final Float y = 0.2f; - final Float size = 6f; + final Float x = 0.25f; + final Float y = 0.18f; + final Float size = 0.6f; final Float surfaceWidth = 1f; final Float surfaceHeight = 1f; - SurfaceOrientedMeteringPointFactory mockSurfaceOrientedMeteringPointFactory = - mock(SurfaceOrientedMeteringPointFactory.class); - - when(proxySpy.getSurfaceOrientedMeteringPointFactory(surfaceWidth, surfaceHeight)) - .thenReturn(mockSurfaceOrientedMeteringPointFactory); - when(mockSurfaceOrientedMeteringPointFactory.createPoint(x, y, size)).thenReturn(meteringPoint); - - hostApi.create(meteringPointIdentifier, x.doubleValue(), y.doubleValue(), size.doubleValue()); - - verify(mockSurfaceOrientedMeteringPointFactory).createPoint(x, y, size); + final DisplayOrientedMeteringPointFactory mockDisplayOrientedMeteringPointFactory = + mock(DisplayOrientedMeteringPointFactory.class); + final Activity mockActivity = mock(Activity.class); + final Display mockDisplay = mock(Display.class); + final CameraInfo mockCameraInfo = mock(CameraInfo.class); + final long mockCameraInfoId = 55L; + + hostApi.setActivity(mockActivity); + testInstanceManager.addDartCreatedInstance(mockCameraInfo, mockCameraInfoId); + + when(mockActivity.getDisplay()).thenReturn(mockDisplay); + when(proxySpy.getDisplayOrientedMeteringPointFactory( + mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + .thenReturn(mockDisplayOrientedMeteringPointFactory); + when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y, size)).thenReturn(meteringPoint); + + hostApi.create( + meteringPointIdentifier, + x.doubleValue(), + y.doubleValue(), + size.doubleValue(), + mockCameraInfoId); + + verify(mockDisplayOrientedMeteringPointFactory).createPoint(x, y, size); assertEquals(testInstanceManager.getInstance(meteringPointIdentifier), meteringPoint); } @Test - public void hostApiCreate_createsExpectedMeteringPointWithoutSizeSpecified() { - MeteringPointHostApiImpl.MeteringPointProxy proxySpy = + @Config(sdk = 29) + @SuppressWarnings("deprecation") + public void hostApiCreate_createsExpectedMeteringPointWithSizeSpecified_BelowAndroid30() { + final MeteringPointHostApiImpl.MeteringPointProxy proxySpy = spy(new MeteringPointHostApiImpl.MeteringPointProxy()); - MeteringPointHostApiImpl hostApi = new MeteringPointHostApiImpl(testInstanceManager, proxySpy); + final MeteringPointHostApiImpl hostApi = + new MeteringPointHostApiImpl(testInstanceManager, proxySpy); final Long meteringPointIdentifier = 78L; final Float x = 0.3f; final Float y = 0.2f; + final Float size = 6f; final Float surfaceWidth = 1f; final Float surfaceHeight = 1f; - SurfaceOrientedMeteringPointFactory mockSurfaceOrientedMeteringPointFactory = - mock(SurfaceOrientedMeteringPointFactory.class); - - when(proxySpy.getSurfaceOrientedMeteringPointFactory(surfaceWidth, surfaceHeight)) - .thenReturn(mockSurfaceOrientedMeteringPointFactory); - when(mockSurfaceOrientedMeteringPointFactory.createPoint(x, y)).thenReturn(meteringPoint); + final DisplayOrientedMeteringPointFactory mockDisplayOrientedMeteringPointFactory = + mock(DisplayOrientedMeteringPointFactory.class); + final Activity mockActivity = mock(Activity.class); + final WindowManager mockWindowManager = mock(WindowManager.class); + final Display mockDisplay = mock(Display.class); + final CameraInfo mockCameraInfo = mock(CameraInfo.class); + final long mockCameraInfoId = 5L; + + hostApi.setActivity(mockActivity); + testInstanceManager.addDartCreatedInstance(mockCameraInfo, mockCameraInfoId); + + when(mockActivity.getSystemService(Context.WINDOW_SERVICE)).thenReturn(mockWindowManager); + when(mockWindowManager.getDefaultDisplay()).thenReturn(mockDisplay); + when(proxySpy.getDisplayOrientedMeteringPointFactory( + mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + .thenReturn(mockDisplayOrientedMeteringPointFactory); + when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y, size)).thenReturn(meteringPoint); + + hostApi.create( + meteringPointIdentifier, + x.doubleValue(), + y.doubleValue(), + size.doubleValue(), + mockCameraInfoId); + + verify(mockDisplayOrientedMeteringPointFactory).createPoint(x, y, size); + assertEquals(testInstanceManager.getInstance(meteringPointIdentifier), meteringPoint); + } - hostApi.create(meteringPointIdentifier, x.doubleValue(), y.doubleValue(), null); + @Test + @Config(sdk = 30) + public void hostApiCreate_createsExpectedMeteringPointWithoutSizeSpecified_AboveAndroid30() { + final MeteringPointHostApiImpl.MeteringPointProxy proxySpy = + spy(new MeteringPointHostApiImpl.MeteringPointProxy()); + final MeteringPointHostApiImpl hostApi = + new MeteringPointHostApiImpl(testInstanceManager, proxySpy); + final Long meteringPointIdentifier = 78L; + final Float x = 0.23f; + final Float y = 0.32f; + final Float surfaceWidth = 1f; + final Float surfaceHeight = 1f; + final DisplayOrientedMeteringPointFactory mockDisplayOrientedMeteringPointFactory = + mock(DisplayOrientedMeteringPointFactory.class); + final Activity mockActivity = mock(Activity.class); + final Display mockDisplay = mock(Display.class); + final CameraInfo mockCameraInfo = mock(CameraInfo.class); + final long mockCameraInfoId = 6L; + + hostApi.setActivity(mockActivity); + testInstanceManager.addDartCreatedInstance(mockCameraInfo, mockCameraInfoId); + + when(mockActivity.getDisplay()).thenReturn(mockDisplay); + when(proxySpy.getDisplayOrientedMeteringPointFactory( + mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + .thenReturn(mockDisplayOrientedMeteringPointFactory); + when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y)).thenReturn(meteringPoint); + + hostApi.create( + meteringPointIdentifier, x.doubleValue(), y.doubleValue(), null, mockCameraInfoId); + + verify(mockDisplayOrientedMeteringPointFactory).createPoint(x, y); + assertEquals(testInstanceManager.getInstance(meteringPointIdentifier), meteringPoint); + } - verify(mockSurfaceOrientedMeteringPointFactory).createPoint(x, y); + @Test + @Config(sdk = 29) + @SuppressWarnings("deprecation") + public void hostApiCreate_createsExpectedMeteringPointWithoutSizeSpecified_BelowAndroid30() { + final MeteringPointHostApiImpl.MeteringPointProxy proxySpy = + spy(new MeteringPointHostApiImpl.MeteringPointProxy()); + final MeteringPointHostApiImpl hostApi = + new MeteringPointHostApiImpl(testInstanceManager, proxySpy); + final Long meteringPointIdentifier = 78L; + final Float x = 0.1f; + final Float y = 0.8f; + final Float surfaceWidth = 1f; + final Float surfaceHeight = 1f; + final DisplayOrientedMeteringPointFactory mockDisplayOrientedMeteringPointFactory = + mock(DisplayOrientedMeteringPointFactory.class); + final Activity mockActivity = mock(Activity.class); + final WindowManager mockWindowManager = mock(WindowManager.class); + final Display mockDisplay = mock(Display.class); + final CameraInfo mockCameraInfo = mock(CameraInfo.class); + final long mockCameraInfoId = 7L; + + hostApi.setActivity(mockActivity); + testInstanceManager.addDartCreatedInstance(mockCameraInfo, mockCameraInfoId); + + when(mockActivity.getSystemService(Context.WINDOW_SERVICE)).thenReturn(mockWindowManager); + when(mockWindowManager.getDefaultDisplay()).thenReturn(mockDisplay); + when(proxySpy.getDisplayOrientedMeteringPointFactory( + mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + .thenReturn(mockDisplayOrientedMeteringPointFactory); + when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y)).thenReturn(meteringPoint); + + hostApi.create( + meteringPointIdentifier, x.doubleValue(), y.doubleValue(), null, mockCameraInfoId); + + verify(mockDisplayOrientedMeteringPointFactory).createPoint(x, y); assertEquals(testInstanceManager.getInstance(meteringPointIdentifier), meteringPoint); } diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 98d89e63c79..3e3dbf4b1db 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -1137,8 +1137,8 @@ class AndroidCameraCameraX extends CameraPlatform { meteringPointInfo.$2 != meteringMode) .toList(); } - final MeteringPoint newMeteringPoint = - proxy.createMeteringPoint(meteringPoint.x, meteringPoint.y); + final MeteringPoint newMeteringPoint = proxy.createMeteringPoint( + meteringPoint.x, meteringPoint.y, cameraInfo!); newMeteringPointInfos.add((newMeteringPoint, meteringMode)); currentFocusMeteringAction = proxy.createFocusMeteringAction(newMeteringPointInfos); diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index 892729f0672..48fe02eb1e9 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -3138,14 +3138,14 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create( - int arg_identifier, double arg_x, double arg_y, double? arg_size) async { + Future create(int arg_identifier, double arg_x, double arg_y, + double? arg_size, int arg_cameraInfoId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_x, arg_y, arg_size]) - as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_x, arg_y, arg_size, arg_cameraInfoId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart index 5cfb216a774..072a753d8b4 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart @@ -5,6 +5,7 @@ import 'dart:ui' show Size; import 'analyzer.dart'; +import 'camera_info.dart'; import 'camera_selector.dart'; import 'camera_state.dart'; import 'camerax_library.g.dart'; @@ -141,8 +142,10 @@ class CameraXProxy { /// rotation constants. Future Function() getDefaultDisplayRotation; - /// Returns a [MeteringPoint] with the specified coordinates. - MeteringPoint Function(double x, double y) createMeteringPoint; + /// Returns a [MeteringPoint] with the specified coordinates based on + /// [cameraInfo]. + MeteringPoint Function(double x, double y, CameraInfo cameraInfo) + createMeteringPoint; /// Returns a [FocusMeteringAction] based on the specified metering points /// and their modes. @@ -252,8 +255,9 @@ class CameraXProxy { return DeviceOrientationManager.getDefaultDisplayRotation(); } - static MeteringPoint _createMeteringPoint(double x, double y) { - return MeteringPoint(x: x, y: y); + static MeteringPoint _createMeteringPoint( + double x, double y, CameraInfo cameraInfo) { + return MeteringPoint(x: x, y: y, cameraInfo: cameraInfo); } static FocusMeteringAction _createFocusMeteringAction( diff --git a/packages/camera/camera_android_camerax/lib/src/metering_point.dart b/packages/camera/camera_android_camerax/lib/src/metering_point.dart index d699993a893..5c4be0a69d6 100644 --- a/packages/camera/camera_android_camerax/lib/src/metering_point.dart +++ b/packages/camera/camera_android_camerax/lib/src/metering_point.dart @@ -6,6 +6,7 @@ import 'package:flutter/services.dart' show BinaryMessenger; import 'package:meta/meta.dart' show immutable; import 'android_camera_camerax_flutter_api_impls.dart'; +import 'camera_info.dart'; import 'camerax_library.g.dart'; import 'instance_manager.dart'; import 'java_object.dart'; @@ -22,6 +23,7 @@ class MeteringPoint extends JavaObject { InstanceManager? instanceManager, required this.x, required this.y, + required this.cameraInfo, this.size, }) : super.detached( binaryMessenger: binaryMessenger, @@ -29,7 +31,7 @@ class MeteringPoint extends JavaObject { ) { _api = _MeteringPointHostApiImpl( binaryMessenger: binaryMessenger, instanceManager: instanceManager); - _api.createFromInstance(this, x, y, size); + _api.createFromInstance(this, x, y, cameraInfo, size); AndroidCameraXCameraFlutterApis.instance.ensureSetUp(); } @@ -40,6 +42,7 @@ class MeteringPoint extends JavaObject { InstanceManager? instanceManager, required this.x, required this.y, + required this.cameraInfo, this.size, }) : super.detached( binaryMessenger: binaryMessenger, @@ -63,6 +66,10 @@ class MeteringPoint extends JavaObject { /// region width/height if crop region is set). final double? size; + /// The [CameraInfo] used to construct the metering point with a display- + /// oriented metering point factory. + final CameraInfo cameraInfo; + /// The default size of the [MeteringPoint] width and height (ranging from 0 /// to 1) which is a (normalized) percentage of the sensor width/height (or /// crop region width/height if crop region is set). @@ -100,8 +107,8 @@ class _MeteringPointHostApiImpl extends MeteringPointHostApi { /// Creates a [MeteringPoint] instance with the specified [x] and [y] /// coordinates as well as [size] if non-null. - Future createFromInstance( - MeteringPoint instance, double x, double y, double? size) { + Future createFromInstance(MeteringPoint instance, double x, double y, + CameraInfo cameraInfo, double? size) { int? identifier = instanceManager.getIdentifier(instance); identifier ??= instanceManager.addDartCreatedInstance(instance, onCopy: (MeteringPoint original) { @@ -110,9 +117,11 @@ class _MeteringPointHostApiImpl extends MeteringPointHostApi { instanceManager: instanceManager, x: original.x, y: original.y, + cameraInfo: original.cameraInfo, size: original.size); }); + final int? camInfoId = instanceManager.getIdentifier(cameraInfo); - return create(identifier, x, y, size); + return create(identifier, x, y, size, camInfoId!); } } diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index 583c3dd4d44..07e38b26a91 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -516,7 +516,8 @@ abstract class FocusMeteringResultFlutterApi { @HostApi(dartHostTestHandler: 'TestMeteringPointHostApi') abstract class MeteringPointHostApi { - void create(int identifier, double x, double y, double? size); + void create( + int identifier, double x, double y, double? size, int cameraInfoId); double getDefaultPointSize(); } diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 02c1a643bbb..fd2bdfc2c8d 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -117,10 +117,13 @@ void main() { return cameraClosingEventSent && cameraErrorSent; } - /// [CameraXProxy] for testing exposure and focus related controls. + /// CameraXProxy for testing exposure and focus related controls. + /// + /// Modifies the creation of MeteringPoints and FocusMeteringActions to return + /// objects detached from a native object. CameraXProxy getProxyForExposureAndFocus() => CameraXProxy( - createMeteringPoint: (double x, double y) => - MeteringPoint.detached(x: x, y: y), + createMeteringPoint: (double x, double y, CameraInfo cameraInfo) => + MeteringPoint.detached(x: x, y: y, cameraInfo: cameraInfo), createFocusMeteringAction: (List<(MeteringPoint, int?)> meteringPointInfos) => FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos)); @@ -1957,8 +1960,12 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 93; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.cameraInfo = mockCameraInfo; + camera.proxy = getProxyForExposureAndFocus(); // Verify nothing happens if no current focus and metering action has been @@ -1968,10 +1975,15 @@ void main() { verifyNever(mockCameraControl.cancelFocusAndMetering()); // Verify current auto-exposure metering point is removed if previously set. - final (MeteringPoint, int?) autofocusMeteringPointInfo = - (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAf); + final (MeteringPoint, int?) autofocusMeteringPointInfo = ( + MeteringPoint.detached(x: 0.3, y: 0.7, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAf + ); List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ - (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAe), + ( + MeteringPoint.detached(x: 0.2, y: 0.5, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAe + ), autofocusMeteringPointInfo ]; @@ -1993,7 +2005,10 @@ void main() { // Verify current focus and metering action is cleared if only previously // set metering point was for auto-exposure. meteringPointInfos = <(MeteringPoint, int?)>[ - (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAe) + ( + MeteringPoint.detached(x: 0.2, y: 0.5, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAe + ) ]; camera.currentFocusMeteringAction = FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); @@ -2010,7 +2025,9 @@ void main() { final MockCameraControl mockCameraControl = MockCameraControl(); const Point invalidExposurePoint = Point(3, -1); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); expect(() => camera.setExposurePoint(cameraId, invalidExposurePoint), @@ -2023,18 +2040,27 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 9; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.cameraInfo = mockCameraInfo; + camera.proxy = getProxyForExposureAndFocus(); // Verify current auto-exposure metering point is removed if previously set. double exposurePointX = 0.8; double exposurePointY = 0.1; Point exposurePoint = Point(exposurePointX, exposurePointY); - final (MeteringPoint, int?) autofocusMeteringPointInfo = - (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAf); + final (MeteringPoint, int?) autofocusMeteringPointInfo = ( + MeteringPoint.detached(x: 0.3, y: 0.7, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAf + ); List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ - (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAe), + ( + MeteringPoint.detached(x: 0.2, y: 0.5, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAe + ), autofocusMeteringPointInfo ]; @@ -2093,10 +2119,13 @@ void main() { const Point exposurePoint = Point(exposurePointX, exposurePointY); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; - camera.proxy = getProxyForExposureAndFocus(); + camera.cameraInfo = MockCameraInfo(); camera.currentFocusMeteringAction = null; + camera.proxy = getProxyForExposureAndFocus(); + await camera.setExposurePoint(cameraId, exposurePoint); final VerificationResult verificationResult = @@ -2193,8 +2222,12 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 93; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.cameraInfo = mockCameraInfo; + camera.proxy = getProxyForExposureAndFocus(); // Verify nothing happens if no current focus and metering action has been @@ -2204,10 +2237,15 @@ void main() { verifyNever(mockCameraControl.cancelFocusAndMetering()); // Verify current auto-exposure metering point is removed if previously set. - final (MeteringPoint, int?) autoexposureMeteringPointInfo = - (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAe); + final (MeteringPoint, int?) autoexposureMeteringPointInfo = ( + MeteringPoint.detached(x: 0.3, y: 0.7, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAe + ); List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ - (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAf), + ( + MeteringPoint.detached(x: 0.2, y: 0.5, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAf + ), autoexposureMeteringPointInfo ]; @@ -2229,7 +2267,10 @@ void main() { // Verify current focus and metering action is cleared if only previously // set metering point was for auto-exposure. meteringPointInfos = <(MeteringPoint, int?)>[ - (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAf) + ( + MeteringPoint.detached(x: 0.2, y: 0.5, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAf + ) ]; camera.currentFocusMeteringAction = FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos); @@ -2246,7 +2287,9 @@ void main() { final MockCameraControl mockCameraControl = MockCameraControl(); const Point invalidFocusPoint = Point(-3, 1); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.proxy = getProxyForExposureAndFocus(); expect(() => camera.setFocusPoint(cameraId, invalidFocusPoint), @@ -2259,18 +2302,27 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 9; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.cameraInfo = mockCameraInfo; + camera.proxy = getProxyForExposureAndFocus(); // Verify current auto-exposure metering point is removed if previously set. double focusPointX = 0.8; double focusPointY = 0.1; Point exposurePoint = Point(focusPointX, focusPointY); - final (MeteringPoint, int?) autoExposureMeteringPointInfo = - (MeteringPoint.detached(x: 0.3, y: 0.7), FocusMeteringAction.flagAe); + final (MeteringPoint, int?) autoExposureMeteringPointInfo = ( + MeteringPoint.detached(x: 0.3, y: 0.7, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAe + ); List<(MeteringPoint, int?)> meteringPointInfos = <(MeteringPoint, int?)>[ - (MeteringPoint.detached(x: 0.2, y: 0.5), FocusMeteringAction.flagAf), + ( + MeteringPoint.detached(x: 0.2, y: 0.5, cameraInfo: mockCameraInfo), + FocusMeteringAction.flagAf + ), autoExposureMeteringPointInfo ]; @@ -2328,10 +2380,13 @@ void main() { const double focusPointY = 0.1; const Point exposurePoint = Point(focusPointX, focusPointY); + // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; - camera.proxy = getProxyForExposureAndFocus(); + camera.cameraInfo = MockCameraInfo(); camera.currentFocusMeteringAction = null; + camera.proxy = getProxyForExposureAndFocus(); + await camera.setFocusPoint(cameraId, exposurePoint); final VerificationResult verificationResult = diff --git a/packages/camera/camera_android_camerax/test/camera2_camera_control_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera2_camera_control_test.mocks.dart index 09eb9436c7a..58d89c49b20 100644 --- a/packages/camera/camera_android_camerax/test/camera2_camera_control_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera2_camera_control_test.mocks.dart @@ -6,11 +6,13 @@ import 'dart:async' as _i3; import 'package:camera_android_camerax/src/camera_control.dart' as _i2; -import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i5; -import 'package:camera_android_camerax/src/capture_request_options.dart' as _i4; +import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i7; +import 'package:camera_android_camerax/src/capture_request_options.dart' as _i6; +import 'package:camera_android_camerax/src/focus_metering_action.dart' as _i5; +import 'package:camera_android_camerax/src/focus_metering_result.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'test_camerax_library.g.dart' as _i6; +import 'test_camerax_library.g.dart' as _i8; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -53,6 +55,37 @@ class MockCameraControl extends _i1.Mock implements _i2.CameraControl { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); + + @override + _i3.Future<_i4.FocusMeteringResult?> startFocusAndMetering( + _i5.FocusMeteringAction? action) => + (super.noSuchMethod( + Invocation.method( + #startFocusAndMetering, + [action], + ), + returnValue: _i3.Future<_i4.FocusMeteringResult?>.value(), + ) as _i3.Future<_i4.FocusMeteringResult?>); + + @override + _i3.Future cancelFocusAndMetering() => (super.noSuchMethod( + Invocation.method( + #cancelFocusAndMetering, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future setExposureCompensationIndex(int? index) => + (super.noSuchMethod( + Invocation.method( + #setExposureCompensationIndex, + [index], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [CaptureRequestOptions]. @@ -60,36 +93,24 @@ class MockCameraControl extends _i1.Mock implements _i2.CameraControl { /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockCaptureRequestOptions extends _i1.Mock - implements _i4.CaptureRequestOptions { + implements _i6.CaptureRequestOptions { MockCaptureRequestOptions() { _i1.throwOnMissingStub(this); } @override - List<(_i5.CaptureRequestKeySupportedType, dynamic)> get requestedOptions => + List<(_i7.CaptureRequestKeySupportedType, Object?)> get requestedOptions => (super.noSuchMethod( Invocation.getter(#requestedOptions), - returnValue: <(_i5.CaptureRequestKeySupportedType, dynamic)>[], - ) as List<(_i5.CaptureRequestKeySupportedType, dynamic)>); - - @override - set requestedOptions( - List<(_i5.CaptureRequestKeySupportedType, dynamic)>? - _requestedOptions) => - super.noSuchMethod( - Invocation.setter( - #requestedOptions, - _requestedOptions, - ), - returnValueForMissingStub: null, - ); + returnValue: <(_i7.CaptureRequestKeySupportedType, Object?)>[], + ) as List<(_i7.CaptureRequestKeySupportedType, Object?)>); } /// A class which mocks [TestCamera2CameraControlHostApi]. /// /// See the documentation for Mockito's code generation for more information. class MockTestCamera2CameraControlHostApi extends _i1.Mock - implements _i6.TestCamera2CameraControlHostApi { + implements _i8.TestCamera2CameraControlHostApi { MockTestCamera2CameraControlHostApi() { _i1.throwOnMissingStub(this); } @@ -132,7 +153,7 @@ class MockTestCamera2CameraControlHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i6.TestInstanceManagerHostApi { + implements _i8.TestInstanceManagerHostApi { MockTestInstanceManagerHostApi() { _i1.throwOnMissingStub(this); } diff --git a/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart b/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart index 4fcab1cef21..d1ceef9daad 100644 --- a/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/focus_metering_action_test.mocks.dart @@ -3,11 +3,12 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i4; -import 'package:camera_android_camerax/src/metering_point.dart' as _i2; +import 'package:camera_android_camerax/src/camera_info.dart' as _i2; +import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i5; +import 'package:camera_android_camerax/src/metering_point.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'test_camerax_library.g.dart' as _i3; +import 'test_camerax_library.g.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -22,11 +23,21 @@ import 'test_camerax_library.g.dart' as _i3; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +class _FakeCameraInfo_0 extends _i1.SmartFake implements _i2.CameraInfo { + _FakeCameraInfo_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [MeteringPoint]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockMeteringPoint extends _i1.Mock implements _i2.MeteringPoint { +class MockMeteringPoint extends _i1.Mock implements _i3.MeteringPoint { MockMeteringPoint() { _i1.throwOnMissingStub(this); } @@ -42,13 +53,22 @@ class MockMeteringPoint extends _i1.Mock implements _i2.MeteringPoint { Invocation.getter(#y), returnValue: 0.0, ) as double); + + @override + _i2.CameraInfo get cameraInfo => (super.noSuchMethod( + Invocation.getter(#cameraInfo), + returnValue: _FakeCameraInfo_0( + this, + Invocation.getter(#cameraInfo), + ), + ) as _i2.CameraInfo); } /// A class which mocks [TestFocusMeteringActionHostApi]. /// /// See the documentation for Mockito's code generation for more information. class MockTestFocusMeteringActionHostApi extends _i1.Mock - implements _i3.TestFocusMeteringActionHostApi { + implements _i4.TestFocusMeteringActionHostApi { MockTestFocusMeteringActionHostApi() { _i1.throwOnMissingStub(this); } @@ -56,7 +76,7 @@ class MockTestFocusMeteringActionHostApi extends _i1.Mock @override void create( int? identifier, - List<_i4.MeteringPointInfo?>? meteringPointInfos, + List<_i5.MeteringPointInfo?>? meteringPointInfos, ) => super.noSuchMethod( Invocation.method( @@ -74,7 +94,7 @@ class MockTestFocusMeteringActionHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i3.TestInstanceManagerHostApi { + implements _i4.TestInstanceManagerHostApi { MockTestInstanceManagerHostApi() { _i1.throwOnMissingStub(this); } diff --git a/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart b/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart index 5be2875f6d4..be52b17bda4 100644 --- a/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/focus_metering_result_test.mocks.dart @@ -3,10 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:camera_android_camerax/src/metering_point.dart' as _i2; +import 'package:camera_android_camerax/src/camera_info.dart' as _i2; +import 'package:camera_android_camerax/src/metering_point.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'test_camerax_library.g.dart' as _i3; +import 'test_camerax_library.g.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -21,11 +22,21 @@ import 'test_camerax_library.g.dart' as _i3; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +class _FakeCameraInfo_0 extends _i1.SmartFake implements _i2.CameraInfo { + _FakeCameraInfo_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [MeteringPoint]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockMeteringPoint extends _i1.Mock implements _i2.MeteringPoint { +class MockMeteringPoint extends _i1.Mock implements _i3.MeteringPoint { MockMeteringPoint() { _i1.throwOnMissingStub(this); } @@ -41,13 +52,22 @@ class MockMeteringPoint extends _i1.Mock implements _i2.MeteringPoint { Invocation.getter(#y), returnValue: 0.0, ) as double); + + @override + _i2.CameraInfo get cameraInfo => (super.noSuchMethod( + Invocation.getter(#cameraInfo), + returnValue: _FakeCameraInfo_0( + this, + Invocation.getter(#cameraInfo), + ), + ) as _i2.CameraInfo); } /// A class which mocks [TestFocusMeteringResultHostApi]. /// /// See the documentation for Mockito's code generation for more information. class MockTestFocusMeteringResultHostApi extends _i1.Mock - implements _i3.TestFocusMeteringResultHostApi { + implements _i4.TestFocusMeteringResultHostApi { MockTestFocusMeteringResultHostApi() { _i1.throwOnMissingStub(this); } @@ -66,7 +86,7 @@ class MockTestFocusMeteringResultHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i3.TestInstanceManagerHostApi { + implements _i4.TestInstanceManagerHostApi { MockTestInstanceManagerHostApi() { _i1.throwOnMissingStub(this); } diff --git a/packages/camera/camera_android_camerax/test/metering_point_test.dart b/packages/camera/camera_android_camerax/test/metering_point_test.dart index ba3daae96b1..5aa92164377 100644 --- a/packages/camera/camera_android_camerax/test/metering_point_test.dart +++ b/packages/camera/camera_android_camerax/test/metering_point_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:camera_android_camerax/src/camera_info.dart'; import 'package:camera_android_camerax/src/instance_manager.dart'; import 'package:camera_android_camerax/src/metering_point.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -11,7 +12,8 @@ import 'package:mockito/mockito.dart'; import 'metering_point_test.mocks.dart'; import 'test_camerax_library.g.dart'; -@GenerateMocks([TestInstanceManagerHostApi, TestMeteringPointHostApi]) +@GenerateMocks( + [TestInstanceManagerHostApi, TestMeteringPointHostApi, CameraInfo]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -33,11 +35,12 @@ void main() { x: 0, y: 0.3, size: 4, + cameraInfo: MockCameraInfo(), instanceManager: instanceManager, ); verifyNever(mockApi.create(argThat(isA()), argThat(isA()), - argThat(isA()), argThat(isA()))); + argThat(isA()), argThat(isA()), argThat(isA()))); }); test('create calls create on the Java side', () async { @@ -52,14 +55,27 @@ void main() { const double x = 0.5; const double y = 0.6; const double size = 3; + final CameraInfo mockCameraInfo = MockCameraInfo(); + const int mockCameraInfoId = 4; + + instanceManager.addHostCreatedInstance(mockCameraInfo, mockCameraInfoId, + onCopy: (CameraInfo original) => MockCameraInfo()); + MeteringPoint( x: x, y: y, size: size, + cameraInfo: mockCameraInfo, instanceManager: instanceManager, ); - verify(mockApi.create(argThat(isA()), x, y, size)); + verify(mockApi.create( + argThat(isA()), + x, + y, + size, + mockCameraInfoId, + )); }); test('getDefaultPointSize returns expected size', () async { diff --git a/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart b/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart index 18ec9b0a1e4..e7a3d9fadb1 100644 --- a/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/metering_point_test.mocks.dart @@ -3,9 +3,16 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i6; + +import 'package:camera_android_camerax/src/camera_info.dart' as _i5; +import 'package:camera_android_camerax/src/camera_state.dart' as _i7; +import 'package:camera_android_camerax/src/exposure_state.dart' as _i3; +import 'package:camera_android_camerax/src/live_data.dart' as _i2; +import 'package:camera_android_camerax/src/zoom_state.dart' as _i8; import 'package:mockito/mockito.dart' as _i1; -import 'test_camerax_library.g.dart' as _i2; +import 'test_camerax_library.g.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -20,11 +27,32 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class +class _FakeLiveData_0 extends _i1.SmartFake + implements _i2.LiveData { + _FakeLiveData_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeExposureState_1 extends _i1.SmartFake implements _i3.ExposureState { + _FakeExposureState_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [TestInstanceManagerHostApi]. /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i2.TestInstanceManagerHostApi { + implements _i4.TestInstanceManagerHostApi { MockTestInstanceManagerHostApi() { _i1.throwOnMissingStub(this); } @@ -43,7 +71,7 @@ class MockTestInstanceManagerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestMeteringPointHostApi extends _i1.Mock - implements _i2.TestMeteringPointHostApi { + implements _i4.TestMeteringPointHostApi { MockTestMeteringPointHostApi() { _i1.throwOnMissingStub(this); } @@ -54,6 +82,7 @@ class MockTestMeteringPointHostApi extends _i1.Mock double? x, double? y, double? size, + int? cameraInfoId, ) => super.noSuchMethod( Invocation.method( @@ -63,6 +92,7 @@ class MockTestMeteringPointHostApi extends _i1.Mock x, y, size, + cameraInfoId, ], ), returnValueForMissingStub: null, @@ -77,3 +107,70 @@ class MockTestMeteringPointHostApi extends _i1.Mock returnValue: 0.0, ) as double); } + +/// A class which mocks [CameraInfo]. +/// +/// See the documentation for Mockito's code generation for more information. +// ignore: must_be_immutable +class MockCameraInfo extends _i1.Mock implements _i5.CameraInfo { + MockCameraInfo() { + _i1.throwOnMissingStub(this); + } + + @override + _i6.Future getSensorRotationDegrees() => (super.noSuchMethod( + Invocation.method( + #getSensorRotationDegrees, + [], + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future<_i2.LiveData<_i7.CameraState>> getCameraState() => + (super.noSuchMethod( + Invocation.method( + #getCameraState, + [], + ), + returnValue: _i6.Future<_i2.LiveData<_i7.CameraState>>.value( + _FakeLiveData_0<_i7.CameraState>( + this, + Invocation.method( + #getCameraState, + [], + ), + )), + ) as _i6.Future<_i2.LiveData<_i7.CameraState>>); + + @override + _i6.Future<_i3.ExposureState> getExposureState() => (super.noSuchMethod( + Invocation.method( + #getExposureState, + [], + ), + returnValue: _i6.Future<_i3.ExposureState>.value(_FakeExposureState_1( + this, + Invocation.method( + #getExposureState, + [], + ), + )), + ) as _i6.Future<_i3.ExposureState>); + + @override + _i6.Future<_i2.LiveData<_i8.ZoomState>> getZoomState() => (super.noSuchMethod( + Invocation.method( + #getZoomState, + [], + ), + returnValue: _i6.Future<_i2.LiveData<_i8.ZoomState>>.value( + _FakeLiveData_0<_i8.ZoomState>( + this, + Invocation.method( + #getZoomState, + [], + ), + )), + ) as _i6.Future<_i2.LiveData<_i8.ZoomState>>); +} diff --git a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index 3fe7e23c586..c847327cce5 100644 --- a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart @@ -2138,7 +2138,8 @@ abstract class TestMeteringPointHostApi { TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, double x, double y, double? size); + void create( + int identifier, double x, double y, double? size, int cameraInfoId); double getDefaultPointSize(); @@ -2168,7 +2169,11 @@ abstract class TestMeteringPointHostApi { assert(arg_y != null, 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null, expected non-null double.'); final double? arg_size = (args[3] as double?); - api.create(arg_identifier!, arg_x!, arg_y!, arg_size); + final int? arg_cameraInfoId = (args[4] as int?); + assert(arg_cameraInfoId != null, + 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null, expected non-null int.'); + api.create( + arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); return []; }); } From b8526e1e0983a0864e92d9aa273e8d545cff4206 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 8 Feb 2024 10:29:22 -0800 Subject: [PATCH 12/23] Self review --- .../lib/src/android_camera_camerax.dart | 2 +- .../camera_android_camerax/lib/src/metering_point.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 3e3dbf4b1db..172cbdbc308 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -1069,7 +1069,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// This method will merge the current action's metering points with that /// specified such that only one auto-exposure metering point and one /// auto-focus metering point will be part of the action. This method would - /// also accommodatate at most on auto-white balance metering point, but that + /// also accommodate at most one auto-white balance metering point, but that /// mode is currently unused in this plugin. /// /// Thus, if [meteringPoint] is non-null, this action includes: diff --git a/packages/camera/camera_android_camerax/lib/src/metering_point.dart b/packages/camera/camera_android_camerax/lib/src/metering_point.dart index 5c4be0a69d6..c5ee6061de9 100644 --- a/packages/camera/camera_android_camerax/lib/src/metering_point.dart +++ b/packages/camera/camera_android_camerax/lib/src/metering_point.dart @@ -23,15 +23,15 @@ class MeteringPoint extends JavaObject { InstanceManager? instanceManager, required this.x, required this.y, - required this.cameraInfo, this.size, + required this.cameraInfo, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, ) { _api = _MeteringPointHostApiImpl( binaryMessenger: binaryMessenger, instanceManager: instanceManager); - _api.createFromInstance(this, x, y, cameraInfo, size); + _api.createFromInstance(this, x, y, size, cameraInfo); AndroidCameraXCameraFlutterApis.instance.ensureSetUp(); } @@ -42,8 +42,8 @@ class MeteringPoint extends JavaObject { InstanceManager? instanceManager, required this.x, required this.y, - required this.cameraInfo, this.size, + required this.cameraInfo, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, @@ -108,7 +108,7 @@ class _MeteringPointHostApiImpl extends MeteringPointHostApi { /// Creates a [MeteringPoint] instance with the specified [x] and [y] /// coordinates as well as [size] if non-null. Future createFromInstance(MeteringPoint instance, double x, double y, - CameraInfo cameraInfo, double? size) { + double? size, CameraInfo cameraInfo) { int? identifier = instanceManager.getIdentifier(instance); identifier ??= instanceManager.addDartCreatedInstance(instance, onCopy: (MeteringPoint original) { From 928b4cd5675bd37258b3a58c05bf0cac0c83ef0b Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 8 Feb 2024 11:00:19 -0800 Subject: [PATCH 13/23] Nits + lints --- .../flutter/plugins/camerax/MeteringPointHostApiImpl.java | 4 ++-- .../io/flutter/plugins/camerax/MeteringPointTest.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java index 676d0035666..343fac07e21 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java @@ -58,7 +58,7 @@ public MeteringPoint create( } DisplayOrientedMeteringPointFactory factory = - getDisplayOrientedMeteringPointFactory(display, 1f, 1f, cameraInfo); + getDisplayOrientedMeteringPointFactory(display, cameraInfo, 1f, 1f); if (size == null) { return factory.createPoint(x.floatValue(), y.floatValue()); @@ -70,7 +70,7 @@ public MeteringPoint create( @VisibleForTesting @NonNull public DisplayOrientedMeteringPointFactory getDisplayOrientedMeteringPointFactory( - Display display, float width, float height, CameraInfo cameraInfo) { + @NonNull Display display, @NonNull CameraInfo cameraInfo, float width, float height) { return new DisplayOrientedMeteringPointFactory(display, cameraInfo, width, height); } diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java index badefc5711a..0734f6ba6a9 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/MeteringPointTest.java @@ -77,7 +77,7 @@ public void hostApiCreate_createsExpectedMeteringPointWithSizeSpecified_AboveAnd when(mockActivity.getDisplay()).thenReturn(mockDisplay); when(proxySpy.getDisplayOrientedMeteringPointFactory( - mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + mockDisplay, mockCameraInfo, surfaceWidth, surfaceHeight)) .thenReturn(mockDisplayOrientedMeteringPointFactory); when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y, size)).thenReturn(meteringPoint); @@ -120,7 +120,7 @@ public void hostApiCreate_createsExpectedMeteringPointWithSizeSpecified_BelowAnd when(mockActivity.getSystemService(Context.WINDOW_SERVICE)).thenReturn(mockWindowManager); when(mockWindowManager.getDefaultDisplay()).thenReturn(mockDisplay); when(proxySpy.getDisplayOrientedMeteringPointFactory( - mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + mockDisplay, mockCameraInfo, surfaceWidth, surfaceHeight)) .thenReturn(mockDisplayOrientedMeteringPointFactory); when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y, size)).thenReturn(meteringPoint); @@ -159,7 +159,7 @@ public void hostApiCreate_createsExpectedMeteringPointWithoutSizeSpecified_Above when(mockActivity.getDisplay()).thenReturn(mockDisplay); when(proxySpy.getDisplayOrientedMeteringPointFactory( - mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + mockDisplay, mockCameraInfo, surfaceWidth, surfaceHeight)) .thenReturn(mockDisplayOrientedMeteringPointFactory); when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y)).thenReturn(meteringPoint); @@ -197,7 +197,7 @@ public void hostApiCreate_createsExpectedMeteringPointWithoutSizeSpecified_Below when(mockActivity.getSystemService(Context.WINDOW_SERVICE)).thenReturn(mockWindowManager); when(mockWindowManager.getDefaultDisplay()).thenReturn(mockDisplay); when(proxySpy.getDisplayOrientedMeteringPointFactory( - mockDisplay, surfaceWidth, surfaceHeight, mockCameraInfo)) + mockDisplay, mockCameraInfo, surfaceWidth, surfaceHeight)) .thenReturn(mockDisplayOrientedMeteringPointFactory); when(mockDisplayOrientedMeteringPointFactory.createPoint(x, y)).thenReturn(meteringPoint); From 1d4d37e6d6482ae74f7e462deb96c7d157047bbc Mon Sep 17 00:00:00 2001 From: camsim99 Date: Fri, 9 Feb 2024 10:15:31 -0800 Subject: [PATCH 14/23] Update video cap test --- .../test/android_camera_camerax_test.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 6bfe8940e4e..29a6f76ddcb 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -1042,6 +1042,7 @@ void main() { final MockCamera mockCamera = MockCamera(); final MockCamera newMockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final MockCameraControl mockCameraControl = MockCameraControl(); final MockLiveCameraState mockLiveCameraState = MockLiveCameraState(); final MockLiveCameraState newMockLiveCameraState = MockLiveCameraState(); final TestSystemServicesHostApi mockSystemServicesApi = @@ -1080,6 +1081,8 @@ void main() { .thenAnswer((_) async => newMockCamera); when(newMockCamera.getCameraInfo()) .thenAnswer((_) async => mockCameraInfo); + when(newMockCamera.getCameraControl()) + .thenAnswer((_) async => mockCameraControl); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => newMockLiveCameraState); @@ -1091,6 +1094,7 @@ void main() { camera.cameraSelector!, [camera.videoCapture!])); expect(camera.camera, equals(newMockCamera)); expect(camera.cameraInfo, equals(mockCameraInfo)); + expect(camera.cameraControl, equals(mockCameraControl)); verify(mockLiveCameraState.removeObservers()); expect( await testCameraClosingObserver( From 35ab36914fbe77457fe4b8b3b334d42bd1243663 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 12 Feb 2024 12:59:27 -0500 Subject: [PATCH 15/23] Fix nit --- .../camera_android_camerax/lib/src/android_camera_camerax.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 4e6244c9cd4..37332a6d75b 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -516,7 +516,7 @@ class AndroidCameraCameraX extends CameraPlatform { 'Exposure compensation not supported'); } - // (Exposure compensation index) * (exposure offset setep size) = + // (Exposure compensation index) * (exposure offset step size) = // (exposure offset). final int roundedExposureCompensationIndex = (offset / exposureOffsetStepSize).round(); From 0de865aa675d769717554091b3e10bc0b5baee43 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:27:53 -0800 Subject: [PATCH 16/23] Update packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com> --- .../camera_android_camerax/lib/src/android_camera_camerax.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 37332a6d75b..c0bc43fc30f 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -1065,7 +1065,7 @@ class AndroidCameraCameraX extends CameraPlatform { // Methods for configuring auto-focus and auto-exposure: - /// Starts a foucs and metering action. + /// Starts a focus and metering action. /// /// This method will merge the current action's metering points with that /// specified such that only one auto-exposure metering point and one From bb13a35920fcbe03538afa9c73e0bdc4c716ab45 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 14 Feb 2024 13:45:45 -0500 Subject: [PATCH 17/23] Address review --- .../camerax/MeteringPointHostApiImpl.java | 11 +++-- .../lib/src/android_camera_camerax.dart | 46 +++++++++---------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java index 343fac07e21..36306253ed1 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/MeteringPointHostApiImpl.java @@ -42,7 +42,6 @@ public static class MeteringPointProxy { * on camera information and the device orientation automatically. */ @NonNull - @SuppressWarnings("deprecation") public MeteringPoint create( @NonNull Double x, @NonNull Double y, @@ -53,8 +52,7 @@ public MeteringPoint create( if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { display = activity.getDisplay(); } else { - display = - ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); + display = getDefaultDisplayForAndroidVersionBelowR(activity); } DisplayOrientedMeteringPointFactory factory = @@ -67,6 +65,13 @@ public MeteringPoint create( } } + @NonNull + @SuppressWarnings("deprecation") + private Display getDefaultDisplayForAndroidVersionBelowR(@NonNull Activity activity) { + return ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)) + .getDefaultDisplay(); + } + @VisibleForTesting @NonNull public DisplayOrientedMeteringPointFactory getDisplayOrientedMeteringPointFactory( diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 37332a6d75b..fe9958e9aa1 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -456,7 +456,7 @@ class AndroidCameraCameraX extends CameraPlatform { @override Future setExposurePoint(int cameraId, Point? point) async { await _startFocusAndMeteringFor( - meteringPoint: point, meteringMode: FocusMeteringAction.flagAe); + point: point, meteringMode: FocusMeteringAction.flagAe); } /// Gets the minimum supported exposure offset for the selected camera in EV units. @@ -501,7 +501,9 @@ class AndroidCameraCameraX extends CameraPlatform { /// The supplied [offset] value should be in EV units. 1 EV unit represents a /// doubling in brightness. It should be between the minimum and maximum offsets /// obtained through `getMinExposureOffset` and `getMaxExposureOffset` respectively. - /// Throws a `CameraException` when an illegal offset is supplied. + /// Throws a `CameraException` when trying to set exposure offset on a device + /// that doesn't support exposure compensationan or if setting the offset fails, + /// like in the case that an illegal offset is supplied. /// /// When the supplied [offset] value does not align with the step size obtained /// through `getExposureStepSize`, it will automatically be rounded to the nearest step. @@ -542,7 +544,7 @@ class AndroidCameraCameraX extends CameraPlatform { @override Future setFocusPoint(int cameraId, Point? point) async { await _startFocusAndMeteringFor( - meteringPoint: point, meteringMode: FocusMeteringAction.flagAf); + point: point, meteringMode: FocusMeteringAction.flagAf); } /// Gets the maximum supported zoom level for the selected camera. @@ -1067,26 +1069,25 @@ class AndroidCameraCameraX extends CameraPlatform { /// Starts a foucs and metering action. /// - /// This method will merge the current action's metering points with that - /// specified such that only one auto-exposure metering point and one - /// auto-focus metering point will be part of the action. This method would - /// also accommodate at most one auto-white balance metering point, but that - /// mode is currently unused in this plugin. + /// This method will modify and start the current action's metering points + /// overriden with the [point] provided for the specified [meteringMode] type + /// only, with all other points of other modes left untouched. Thus, the + /// focus and metering action started will contain only the one most recently + /// set point for each metering mode: AF, AE, AWB. /// - /// Thus, if [meteringPoint] is non-null, this action includes: + /// Thus, if [point] is non-null, this action includes: /// * metering points and their modes previously added to /// [currentFocusMeteringAction] that do not share a metering mode with - /// [meteringPoint] and - /// * [meteringPoint] with the specified [meteringMode]. - /// If [meteringPoint] is null, this action includes only metering points and + /// [point] and + /// * [point] with the specified [meteringMode]. + /// If [point] is null, this action includes only metering points and /// their modes previously added to [currentFocusMeteringAction] that do not - /// share a metering mode with [meteringPoint]. If there are no such metering + /// share a metering mode with [point]. If there are no such metering /// points, then the previously enabled focus and metering actions will be /// canceled. Future _startFocusAndMeteringFor( - {required Point? meteringPoint, - required int meteringMode}) async { - if (meteringPoint == null) { + {required Point? point, required int meteringMode}) async { + if (point == null) { // Try to clear any metering point from previous action with the specified // meteringMode. if (currentFocusMeteringAction == null) { @@ -1112,15 +1113,14 @@ class AndroidCameraCameraX extends CameraPlatform { // If no other metering points were specified, cancel any previously // started focus and metering actions. await cameraControl!.cancelFocusAndMetering(); + currentFocusMeteringAction = null; return; } currentFocusMeteringAction = proxy.createFocusMeteringAction(newMeteringPointInfos); - } else if (meteringPoint.x < 0 || - meteringPoint.x > 1 || - meteringPoint.y < 0 && meteringPoint.y > 1) { - throw CameraException('meteringPointInvalid', - 'The coordinates of a metering point for an auto-focus or auto-exposure action must be within (0,0) and (1,1).'); + } else if (point.x < 0 || point.x > 1 || point.y < 0 || point.y > 1) { + throw CameraException('pointInvalid', + 'The coordinates of a metering point for an auto-focus or auto-exposure action must be within (0,0) and (1,1), but point $point was provided for metering mode $meteringMode.'); } else { // Add new metering point with specified meteringMode, which may involve // replacing a metering point with the same specified meteringMode from @@ -1138,8 +1138,8 @@ class AndroidCameraCameraX extends CameraPlatform { meteringPointInfo.$2 != meteringMode) .toList(); } - final MeteringPoint newMeteringPoint = proxy.createMeteringPoint( - meteringPoint.x, meteringPoint.y, cameraInfo!); + final MeteringPoint newMeteringPoint = + proxy.createMeteringPoint(point.x, point.y, cameraInfo!); newMeteringPointInfos.add((newMeteringPoint, meteringMode)); currentFocusMeteringAction = proxy.createFocusMeteringAction(newMeteringPointInfos); From 2c3c9abf792040ff75b02ca82bc0a3f970b98f1e Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:16:16 -0800 Subject: [PATCH 18/23] Update packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com> --- .../test/android_camera_camerax_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 29a6f76ddcb..567fe5bd325 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -407,7 +407,7 @@ void main() { // Verify the camera's CameraInfo instance got updated. expect(camera.cameraInfo, equals(mockCameraInfo)); - // Verify camera's CameraControl instance gotu pdated. + // Verify camera's CameraControl instance got updated. expect(camera.cameraControl, equals(mockCameraControl)); // Verify preview has been marked as bound to the camera lifecycle by From 6652171658dc5e9b8300d237617f46784430aaec Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 20 Feb 2024 11:20:46 -0800 Subject: [PATCH 19/23] Use absolute paths --- .../flutter/plugins/camerax/GeneratedCameraXLibrary.java | 8 ++++---- .../camera_android_camerax/lib/src/camerax_library.g.dart | 4 ++-- .../camera_android_camerax/pigeons/camerax_library.dart | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) 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 0dcf169c69e..ac92427314f 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 @@ -83,7 +83,7 @@ private CameraStateType(final int index) { *

If you need to add another type to support a type S to use a LiveData in this plugin, * ensure the following is done on the Dart side: * - *

* In `../lib/src/live_data.dart`, add new cases for S in + *

* In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a * LiveData instance and in `LiveDataFlutterApiImpl#create` to create the expected type of * LiveData when requested. @@ -151,9 +151,9 @@ private VideoResolutionFallbackRule(final int index) { * *

If you need to add another option to support, ensure the following is done on the Dart side: * - *

* In `../lib/src/capture_request_options.dart`, add new cases for this option in - * `_CaptureRequestOptionsHostApiImpl#createFromInstances` to create the expected Map entry of - * option key index and value to send to the native side. + *

* In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this + * option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` to create the expected Map + * entry of option key index and value to send to the native side. * *

On the native side, ensure the following is done: * diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index 48fe02eb1e9..14239dd01b6 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -27,7 +27,7 @@ enum CameraStateType { /// If you need to add another type to support a type S to use a LiveData in /// this plugin, ensure the following is done on the Dart side: /// -/// * In `../lib/src/live_data.dart`, add new cases for S in +/// * In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in /// `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of /// type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` /// to create the expected type of LiveData when requested. @@ -73,7 +73,7 @@ enum VideoResolutionFallbackRule { /// If you need to add another option to support, ensure the following is done /// on the Dart side: /// -/// * In `../lib/src/capture_request_options.dart`, add new cases for this +/// * In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this /// option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` /// to create the expected Map entry of option key index and value to send to /// the native side. diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index 07e38b26a91..fc78cae75d2 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -66,7 +66,7 @@ class CameraStateTypeData { /// If you need to add another type to support a type S to use a LiveData in /// this plugin, ensure the following is done on the Dart side: /// -/// * In `../lib/src/live_data.dart`, add new cases for S in +/// * In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in /// `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of /// type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` /// to create the expected type of LiveData when requested. @@ -148,7 +148,7 @@ class MeteringPointInfo { /// If you need to add another option to support, ensure the following is done /// on the Dart side: /// -/// * In `../lib/src/capture_request_options.dart`, add new cases for this +/// * In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this /// option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` /// to create the expected Map entry of option key index and value to send to /// the native side. From c35fa157d326738e16ce0b5cf34ac63ba93c9073 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 09:41:41 -0800 Subject: [PATCH 20/23] Address nit + change getExposureOffsetStepSize to return 0 --- .../lib/src/android_camera_camerax.dart | 22 ++++++++----------- .../test/android_camera_camerax_test.dart | 20 ----------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index f5bfe375524..3c2d3c32b95 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -74,7 +74,7 @@ class AndroidCameraCameraX extends CameraPlatform { CameraInfo? cameraInfo; /// The [CameraControl] instance that corresponds to the [camera] instance. - CameraControl? cameraControl; + late CameraControl cameraControl; /// The [LiveData] of the [CameraState] that represents the state of the /// [camera] instance. @@ -481,18 +481,14 @@ class AndroidCameraCameraX extends CameraPlatform { /// Gets the supported step size for exposure offset for the selected camera in EV units. /// + /// Returns 0 if exposure compensation is not supported for the device. + /// /// [cameraId] not used. @override Future getExposureOffsetStepSize(int cameraId) async { final ExposureState exposureState = await cameraInfo!.getExposureState(); final double exposureOffsetStepSize = exposureState.exposureCompensationStep; - if (exposureOffsetStepSize == 0) { - // CameraX returns a step size of 0 if exposure compensation is not - // supported for the device. - throw CameraException(exposureCompensationNotSupported, - 'Exposure compensation not supported for the device.'); - } return exposureOffsetStepSize; } @@ -524,7 +520,7 @@ class AndroidCameraCameraX extends CameraPlatform { (offset / exposureOffsetStepSize).round(); try { - await cameraControl! + await cameraControl .setExposureCompensationIndex(roundedExposureCompensationIndex); } on PlatformException catch (e) { throw CameraException( @@ -588,7 +584,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// Throws a `CameraException` when an illegal zoom level is supplied. @override Future setZoomLevel(int cameraId, double zoom) async { - await cameraControl!.setZoomRatio(zoom); + await cameraControl.setZoomRatio(zoom); } /// The ui orientation changed. @@ -674,7 +670,7 @@ class AndroidCameraCameraX extends CameraPlatform { Future setFlashMode(int cameraId, FlashMode mode) async { // Turn off torch mode if it is enabled and not being redundantly set. if (mode != FlashMode.torch && torchEnabled) { - await cameraControl!.enableTorch(false); + await cameraControl.enableTorch(false); torchEnabled = false; } @@ -691,7 +687,7 @@ class AndroidCameraCameraX extends CameraPlatform { // Torch mode enabled already. return; } - await cameraControl!.enableTorch(true); + await cameraControl.enableTorch(true); torchEnabled = true; } } @@ -1112,7 +1108,7 @@ class AndroidCameraCameraX extends CameraPlatform { if (newMeteringPointInfos.isEmpty) { // If no other metering points were specified, cancel any previously // started focus and metering actions. - await cameraControl!.cancelFocusAndMetering(); + await cameraControl.cancelFocusAndMetering(); currentFocusMeteringAction = null; return; } @@ -1145,6 +1141,6 @@ class AndroidCameraCameraX extends CameraPlatform { proxy.createFocusMeteringAction(newMeteringPointInfos); } - await cameraControl!.startFocusAndMetering(currentFocusMeteringAction!); + await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); } } diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 567fe5bd325..b9f8a23b0ba 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -1630,26 +1630,6 @@ void main() { expect(await camera.getExposureOffsetStepSize(55), 0.2); }); - test( - 'getExposureOffsetStepSize throws exception when exposure compensation not supported on device', - () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); - final MockCameraInfo mockCameraInfo = MockCameraInfo(); - final ExposureState exposureState = ExposureState.detached( - exposureCompensationRange: - ExposureCompensationRange(minCompensation: 0, maxCompensation: 0), - exposureCompensationStep: 0); - - // Set directly for test versus calling createCamera. - camera.cameraInfo = mockCameraInfo; - - when(mockCameraInfo.getExposureState()) - .thenAnswer((_) async => exposureState); - - expect(() => camera.getExposureOffsetStepSize(25), - throwsA(isA())); - }); - test('getMaxZoomLevel returns expected exposure offset', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); From 077ee378770fabafc03e394b725510e058cbdf5a Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 10:33:18 -0800 Subject: [PATCH 21/23] Change to -1 --- .../lib/src/android_camera_camerax.dart | 7 ++++++- .../test/android_camera_camerax_test.dart | 19 +++++++++++++++++++ .../platform_interface/camera_platform.dart | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 3c2d3c32b95..deddf4709c9 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -481,7 +481,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// Gets the supported step size for exposure offset for the selected camera in EV units. /// - /// Returns 0 if exposure compensation is not supported for the device. + /// Returns -1 if exposure compensation is not supported for the device. /// /// [cameraId] not used. @override @@ -489,6 +489,11 @@ class AndroidCameraCameraX extends CameraPlatform { final ExposureState exposureState = await cameraInfo!.getExposureState(); final double exposureOffsetStepSize = exposureState.exposureCompensationStep; + if (exposureOffsetStepSize == 0) { + // CameraX returns a step size of 0 if exposure compensation is not + // supported for the device. + return -1; + } return exposureOffsetStepSize; } diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index b9f8a23b0ba..0868916f3bf 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -1630,6 +1630,25 @@ void main() { expect(await camera.getExposureOffsetStepSize(55), 0.2); }); + test( + 'getExposureOffsetStepSize returns -1 when exposure compensation not supported on device', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final ExposureState exposureState = ExposureState.detached( + exposureCompensationRange: + ExposureCompensationRange(minCompensation: 0, maxCompensation: 0), + exposureCompensationStep: 0); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = mockCameraInfo; + + when(mockCameraInfo.getExposureState()) + .thenAnswer((_) async => exposureState); + + expect(await camera.getExposureOffsetStepSize(55), -1); + }); + test('getMaxZoomLevel returns expected exposure offset', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); diff --git a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart index 6707962cbc1..a8397de9a03 100644 --- a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart +++ b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart @@ -221,7 +221,8 @@ abstract class CameraPlatform extends PlatformInterface { /// Gets the supported step size for exposure offset for the selected camera in EV units. /// - /// Returns 0 when the camera supports using a free value without stepping. + /// Returns 0 when the camera supports using a free value without stepping, and + /// returns -1 when exposure compensation is not supported for the device. Future getExposureOffsetStepSize(int cameraId) { throw UnimplementedError('getMinExposureOffset() is not implemented.'); } From ff3fc3993cac43c3f7ee63809e1871895c70bdd0 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 10:36:23 -0800 Subject: [PATCH 22/23] Update wording --- .../lib/src/platform_interface/camera_platform.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart index a8397de9a03..48671f76438 100644 --- a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart +++ b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart @@ -222,7 +222,7 @@ abstract class CameraPlatform extends PlatformInterface { /// Gets the supported step size for exposure offset for the selected camera in EV units. /// /// Returns 0 when the camera supports using a free value without stepping, and - /// returns -1 when exposure compensation is not supported for the device. + /// returns -1 when exposure compensation is not supported. Future getExposureOffsetStepSize(int cameraId) { throw UnimplementedError('getMinExposureOffset() is not implemented.'); } From fc60e77088d9aa7497ffe26b158d9b6be3d61d63 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 11:10:57 -0800 Subject: [PATCH 23/23] Undo platform interface changes --- .../lib/src/platform_interface/camera_platform.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart index 48671f76438..6707962cbc1 100644 --- a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart +++ b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart @@ -221,8 +221,7 @@ abstract class CameraPlatform extends PlatformInterface { /// Gets the supported step size for exposure offset for the selected camera in EV units. /// - /// Returns 0 when the camera supports using a free value without stepping, and - /// returns -1 when exposure compensation is not supported. + /// Returns 0 when the camera supports using a free value without stepping. Future getExposureOffsetStepSize(int cameraId) { throw UnimplementedError('getMinExposureOffset() is not implemented.'); }