From b915f7def1a4352485078e434bdfa0a6c8ccfbb4 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 20 Feb 2024 11:17:44 -0800 Subject: [PATCH 01/27] Locked hacking --- .../Camera2CameraControlHostApiImpl.java | 9 +- .../camerax/CameraAndroidCameraxPlugin.java | 11 + .../CaptureRequestOptionsHostApiImpl.java | 11 +- .../camerax/GeneratedCameraXLibrary.java | 1155 ++++++----------- .../example/lib/main.dart | 148 ++- .../lib/src/android_camera_camerax.dart | 24 + .../lib/src/camerax_library.g.dart | 468 +++---- .../lib/src/capture_request_options.dart | 5 + .../pigeons/camerax_library.dart | 1 + .../test/test_camerax_library.g.dart | 992 +++++--------- 10 files changed, 1071 insertions(+), 1753 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java index 8d10005f7d75..57a41a670dd5 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java @@ -18,6 +18,9 @@ import io.flutter.plugins.camerax.GeneratedCameraXLibrary.Camera2CameraControlHostApi; import java.util.Objects; +import android.hardware.camera2.CaptureRequest; +import android.hardware.camera2.CameraMetadata; + /** * Host API implementation for {@link Camera2CameraControl}. * @@ -55,8 +58,10 @@ public void addCaptureRequestOptions( throw new IllegalStateException("Context must be set to add capture request options."); } - ListenableFuture addCaptureRequestOptionsFuture = - camera2CameraControl.addCaptureRequestOptions(bundle); + // ListenableFuture addCaptureRequestOptionsFuture = + // camera2CameraControl.addCaptureRequestOptions(bundle); + CaptureRequestOptions options = new CaptureRequestOptions.Builder().setCaptureRequestOption(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO).setCaptureRequestOption(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE).build(); + ListenableFuture addCaptureRequestOptionsFuture = camera2CameraControl.setCaptureRequestOptions(options); Futures.addCallback( addCaptureRequestOptionsFuture, 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 b0e0493cbe2a..544320dcfd9c 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 @@ -36,6 +36,9 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting public @Nullable LiveDataHostApiImpl liveDataHostApiImpl; + @VisibleForTesting @Nullable + public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl; + /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. * @@ -119,6 +122,11 @@ public void setUp( cameraControlHostApiImpl = new CameraControlHostApiImpl(binaryMessenger, instanceManager, context); GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl); + camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context); + GeneratedCameraXLibrary.Camera2CameraControlHostApi.setup( + binaryMessenger, camera2CameraControlHostApiImpl); + GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup( + binaryMessenger, new CaptureRequestOptionsHostApiImpl(instanceManager)); } @Override @@ -209,6 +217,9 @@ public void updateContext(@NonNull Context context) { } if (cameraControlHostApiImpl != null) { cameraControlHostApiImpl.setContext(context); + } + if (camera2CameraControlHostApiImpl != null) { + camera2CameraControlHostApiImpl.setContext(context); } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java index 6f8d8c91dda6..cf834db0618f 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java @@ -5,6 +5,7 @@ package io.flutter.plugins.camerax; import android.hardware.camera2.CaptureRequest; +import android.hardware.camera2.CameraMetadata; import androidx.annotation.NonNull; import androidx.annotation.OptIn; import androidx.annotation.VisibleForTesting; @@ -51,6 +52,9 @@ public static class CaptureRequestOptionsProxy { builder.setCaptureRequestOption( (CaptureRequest.Key) optionKey, (Boolean) optionValue); break; + case CONTROL_AF_TRIGGER: + builder.setCaptureRequestOption( (CaptureRequest.Key) optionKey, CameraMetadata.CONTROL_AF_TRIGGER_IDLE); //(Integer) optionValue); + break; default: throw new IllegalArgumentException( "The capture request key " @@ -69,6 +73,9 @@ private CaptureRequest.Key getCaptureRequestKey( case CONTROL_AE_LOCK: key = CaptureRequest.CONTROL_AE_LOCK; break; + case CONTROL_AF_TRIGGER: + key = CaptureRequest.CONTROL_AF_TRIGGER; + break; default: throw new IllegalArgumentException( "The capture request key is not currently supported by the plugin."); @@ -110,8 +117,8 @@ public void create(@NonNull Long identifier, @NonNull Map options) Map decodedOptions = new HashMap(); for (Map.Entry option : options.entrySet()) { - decodedOptions.put( - CaptureRequestKeySupportedType.values()[option.getKey().intValue()], option.getValue()); + Integer index = ((Number) option.getKey()).intValue(); + decodedOptions.put(CaptureRequestKeySupportedType.values()[index], option.getValue()); } instanceManager.addDartCreatedInstance(proxy.create(decodedOptions), identifier); } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java index 08f8ea2da9ff..0ad7d8fc87fa 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,6 +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; @@ -34,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; @@ -53,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; } @@ -61,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), @@ -80,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. + * * 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), @@ -106,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), @@ -131,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), @@ -146,8 +149,29 @@ 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: + * + * * 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: + * + * * 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. + */ public enum CaptureRequestKeySupportedType { - CONTROL_AE_LOCK(0); + CONTROL_AE_LOCK(0), + CONTROL_AF_TRIGGER(1); final int index; @@ -222,13 +246,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; } } @@ -470,19 +490,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; } } @@ -490,7 +500,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; @@ -541,9 +551,10 @@ 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]. */ @@ -563,7 +574,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; @@ -613,17 +624,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; } } @@ -639,7 +642,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(); @@ -647,12 +650,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<>( @@ -664,7 +663,8 @@ static void setup( try { api.clear(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -685,9 +685,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 = @@ -702,7 +700,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; } @@ -722,7 +721,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); @@ -731,7 +730,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -744,32 +742,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) -> { @@ -777,11 +771,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; } @@ -802,11 +795,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; } @@ -819,9 +811,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) -> { @@ -829,11 +819,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; } @@ -854,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; } @@ -877,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); @@ -886,7 +875,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -901,19 +889,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<>( @@ -926,11 +910,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; } @@ -952,12 +935,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; } @@ -977,7 +958,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); @@ -986,9 +967,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()); @@ -1002,16 +981,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); @@ -1022,18 +998,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) -> { @@ -1060,9 +1030,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) -> { @@ -1070,11 +1038,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; } @@ -1087,9 +1054,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) -> { @@ -1099,15 +1064,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; } @@ -1120,9 +1080,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) -> { @@ -1131,12 +1089,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; } @@ -1149,9 +1105,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) -> { @@ -1160,10 +1114,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; } @@ -1176,9 +1130,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) -> { @@ -1188,7 +1140,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; } @@ -1208,7 +1161,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); @@ -1217,13 +1170,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)); @@ -1232,17 +1182,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 = @@ -1255,10 +1205,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; } @@ -1279,11 +1229,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; } @@ -1303,7 +1252,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); @@ -1312,7 +1261,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1352,28 +1300,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) -> { @@ -1402,9 +1343,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) -> { @@ -1415,7 +1354,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; } @@ -1435,7 +1375,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); @@ -1444,13 +1384,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)); @@ -1459,30 +1396,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) -> { @@ -1491,11 +1421,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; } @@ -1508,9 +1437,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) -> { @@ -1518,7 +1445,8 @@ static void setup( try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1531,9 +1459,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) -> { @@ -1541,7 +1467,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; } @@ -1561,7 +1488,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); @@ -1570,14 +1497,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)); @@ -1613,15 +1536,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); @@ -1630,7 +1552,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 = @@ -1645,14 +1567,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; } @@ -1665,9 +1583,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) -> { @@ -1675,11 +1591,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; } @@ -1692,9 +1607,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) -> { @@ -1702,7 +1615,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; } @@ -1723,11 +1637,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; } @@ -1749,11 +1662,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; } @@ -1768,10 +1680,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); @@ -1780,10 +1692,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 = @@ -1796,11 +1705,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; } @@ -1821,10 +1729,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; } @@ -1837,9 +1745,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) -> { @@ -1848,11 +1754,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; } @@ -1872,7 +1777,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); @@ -1881,7 +1786,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1894,28 +1798,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 = @@ -1931,13 +1829,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; } @@ -1958,11 +1853,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; } @@ -1975,9 +1869,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) -> { @@ -1985,11 +1877,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; } @@ -2011,11 +1902,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; } @@ -2035,7 +1925,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); @@ -2044,12 +1934,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()); @@ -2061,19 +1946,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<>( @@ -2085,10 +1966,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; } @@ -2108,7 +1989,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); @@ -2117,7 +1998,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2142,9 +2022,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 = @@ -2159,7 +2037,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; } @@ -2182,7 +2061,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; } @@ -2205,7 +2085,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; } @@ -2228,7 +2109,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; } @@ -2248,7 +2130,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); @@ -2257,7 +2139,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2270,11 +2151,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); @@ -2286,10 +2163,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 = @@ -2305,15 +2179,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; } @@ -2335,11 +2204,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; } @@ -2372,8 +2240,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); @@ -2382,9 +2249,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) -> { @@ -2393,11 +2258,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; } @@ -2411,8 +2275,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() {} @@ -2440,19 +2303,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<>( @@ -2466,12 +2324,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; } @@ -2486,21 +2342,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<>( @@ -2514,16 +2363,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; } @@ -2538,25 +2381,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) -> { @@ -2566,14 +2402,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; } @@ -2620,7 +2452,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); @@ -2629,12 +2461,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()); @@ -2678,7 +2505,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); @@ -2687,19 +2514,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)); } } @@ -2711,7 +2531,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); @@ -2720,12 +2540,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()); @@ -2737,10 +2552,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); @@ -2752,12 +2564,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<>( @@ -2771,14 +2579,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; } @@ -2800,11 +2604,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; } @@ -2817,9 +2620,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) -> { @@ -2829,7 +2630,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; } @@ -2842,9 +2644,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) -> { @@ -2853,11 +2653,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; } @@ -2878,9 +2677,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 = @@ -2895,7 +2692,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; } @@ -2916,9 +2714,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 = @@ -2933,7 +2729,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; } @@ -2953,7 +2750,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); @@ -2962,11 +2759,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()); @@ -2983,7 +2776,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); @@ -2992,9 +2785,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()); @@ -3037,16 +2828,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 = @@ -3060,11 +2849,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; } @@ -3087,7 +2875,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; } @@ -3109,11 +2898,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; } @@ -3160,7 +2948,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); @@ -3169,11 +2957,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()); @@ -3190,7 +2974,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); @@ -3199,7 +2983,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3208,11 +2991,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()); @@ -3224,7 +3003,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); @@ -3233,9 +3012,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 = @@ -3248,10 +3025,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; } @@ -3274,7 +3051,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; } @@ -3294,7 +3072,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); @@ -3303,13 +3081,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()); @@ -3326,7 +3098,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); @@ -3335,19 +3107,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)); } } @@ -3386,24 +3151,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<>( @@ -3414,16 +3172,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; } @@ -3436,24 +3191,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; } @@ -3468,21 +3218,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<>( @@ -3493,19 +3236,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; } @@ -3520,32 +3257,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<>( @@ -3570,10 +3297,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); @@ -3582,9 +3306,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) -> { @@ -3605,10 +3327,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); @@ -3617,9 +3336,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) -> { @@ -3640,12 +3357,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); @@ -3654,9 +3366,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) -> { @@ -3676,8 +3386,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); @@ -3686,9 +3395,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) -> { @@ -3709,10 +3416,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); @@ -3728,7 +3432,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); @@ -3737,7 +3441,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3749,8 +3452,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() {} @@ -3784,32 +3486,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; } @@ -3824,25 +3518,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) -> { @@ -3850,11 +3538,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; } @@ -3874,7 +3561,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); @@ -3883,13 +3570,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)); @@ -3898,22 +3582,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<>( @@ -3928,13 +3607,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) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3947,9 +3623,7 @@ static void setup( { 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) -> { @@ -3957,7 +3631,8 @@ static void setup( try { Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3971,8 +3646,7 @@ static void setup( } private static class CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { - public static final CaptureRequestOptionsHostApiCodec INSTANCE = - new CaptureRequestOptionsHostApiCodec(); + public static final CaptureRequestOptionsHostApiCodec INSTANCE = new CaptureRequestOptionsHostApiCodec(); private CaptureRequestOptionsHostApiCodec() {} @@ -4036,18 +3710,12 @@ 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) -> { @@ -4056,10 +3724,10 @@ static void setup( 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; } @@ -4076,27 +3744,18 @@ 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) -> { @@ -4105,13 +3764,10 @@ static void setup( 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; } @@ -4124,9 +3780,7 @@ static void setup( { 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) -> { @@ -4147,12 +3801,7 @@ 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/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index 4484c5dac982..cf3fa303d763 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -4,6 +4,7 @@ import 'dart:async'; import 'dart:io'; +import 'dart:math'; import 'package:camera_platform_interface/camera_platform_interface.dart'; import 'package:flutter/foundation.dart'; @@ -110,7 +111,6 @@ class _CameraExampleHomeState extends State super.dispose(); } - // #docregion AppLifecycle @override void didChangeAppLifecycleState(AppLifecycleState state) { final CameraController? cameraController = controller; @@ -123,10 +123,9 @@ class _CameraExampleHomeState extends State if (state == AppLifecycleState.inactive) { cameraController.dispose(); } else if (state == AppLifecycleState.resumed) { - onNewCameraSelected(cameraController.description); + _initializeCameraController(cameraController.description); } } - // #enddocregion AppLifecycle @override Widget build(BuildContext context) { @@ -219,7 +218,8 @@ class _CameraExampleHomeState extends State _currentScale = (_baseScale * details.scale) .clamp(_minAvailableZoom, _maxAvailableZoom); - await controller!.setZoomLevel(_currentScale); + await CameraPlatform.instance + .setZoomLevel(controller!.cameraId, _currentScale); } /// Display the thumbnail of the captured image or video. @@ -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, ) ] : [], @@ -392,22 +393,32 @@ class _CameraExampleHomeState extends State children: [ TextButton( style: styleAuto, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. - onLongPress: - () {}, // TODO(camsim99): Add functionality back here., + onPressed: controller != null + ? () => + onSetExposureModeButtonPressed(ExposureMode.auto) + : null, + onLongPress: () { + if (controller != null) { + CameraPlatform.instance + .setExposurePoint(controller!.cameraId, null); + showInSnackBar('Resetting exposure point'); + } + }, child: const Text('AUTO'), ), TextButton( style: styleLocked, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => + onSetExposureModeButtonPressed(ExposureMode.locked) + : null, child: const Text('LOCKED'), ), TextButton( style: styleLocked, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => controller!.setExposureOffset(0.0) + : null, child: const Text('RESET OFFSET'), ), ], @@ -466,16 +477,23 @@ class _CameraExampleHomeState extends State children: [ TextButton( style: styleAuto, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. - onLongPress: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => onSetFocusModeButtonPressed(FocusMode.auto) + : null, + onLongPress: () { + if (controller != null) { + CameraPlatform.instance + .setFocusPoint(controller!.cameraId, null); + } + showInSnackBar('Resetting focus point'); + }, child: const Text('AUTO'), ), TextButton( style: styleLocked, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => onSetFocusModeButtonPressed(FocusMode.locked) + : null, child: const Text('LOCKED'), ), ], @@ -506,29 +524,35 @@ class _CameraExampleHomeState extends State IconButton( icon: const Icon(Icons.videocam), color: Colors.blue, - onPressed: - cameraController == null ? null : onVideoRecordButtonPressed, + onPressed: cameraController != null && + cameraController.value.isInitialized && + !cameraController.value.isRecordingVideo + ? onVideoRecordButtonPressed + : null, ), IconButton( icon: cameraController != null && - cameraController.value.isRecordingPaused + (!cameraController.value.isRecordingVideo || + cameraController.value.isRecordingPaused) ? const Icon(Icons.play_arrow) : const Icon(Icons.pause), color: Colors.blue, - onPressed: () { - if (cameraController == null) { - return; - } else if (cameraController.value.isRecordingPaused) { - return onResumeButtonPressed(); - } else { - return onPauseButtonPressed(); - } - }, + onPressed: cameraController != null && + cameraController.value.isInitialized && + cameraController.value.isRecordingVideo + ? (cameraController.value.isRecordingPaused) + ? onResumeButtonPressed + : onPauseButtonPressed + : null, ), IconButton( icon: const Icon(Icons.stop), color: Colors.red, - onPressed: cameraController == null ? null : onStopButtonPressed, + onPressed: cameraController != null && + cameraController.value.isInitialized && + cameraController.value.isRecordingVideo + ? onStopButtonPressed + : null, ), IconButton( icon: const Icon(Icons.pause_presentation), @@ -569,10 +593,7 @@ class _CameraExampleHomeState extends State title: Icon(getCameraLensIcon(cameraDescription.lensDirection)), groupValue: controller?.description, value: cameraDescription, - onChanged: - controller != null && controller!.value.isRecordingVideo - ? null - : onChanged, + onChanged: onChanged, ), ), ); @@ -596,26 +617,24 @@ class _CameraExampleHomeState extends State final CameraController cameraController = controller!; - final Offset offset = Offset( + final Point point = Point( details.localPosition.dx / constraints.maxWidth, details.localPosition.dy / constraints.maxHeight, ); - cameraController.setExposurePoint(offset); - cameraController.setFocusPoint(offset); + CameraPlatform.instance.setExposurePoint(cameraController.cameraId, point); + CameraPlatform.instance.setFocusPoint(cameraController.cameraId, point); } Future onNewCameraSelected(CameraDescription cameraDescription) async { - final CameraController? oldController = controller; - if (oldController != null) { - // `controller` needs to be set to null before getting disposed, - // to avoid a race condition when we use the controller that is being - // disposed. This happens when camera permission dialog shows up, - // which triggers `didChangeAppLifecycleState`, which disposes and - // re-creates the controller. - controller = null; - await oldController.dispose(); - } + // if (controller != null) { + // return controller!.setDescription(cameraDescription); + // } else { + return _initializeCameraController(cameraDescription); + // } + } + Future _initializeCameraController( + CameraDescription cameraDescription) async { final CameraController cameraController = CameraController( cameraDescription, kIsWeb ? ResolutionPreset.max : ResolutionPreset.medium, @@ -630,10 +649,6 @@ class _CameraExampleHomeState extends State if (mounted) { setState(() {}); } - if (cameraController.value.hasError) { - showInSnackBar( - 'Camera error ${cameraController.value.errorDescription}'); - } }); try { @@ -642,18 +657,20 @@ class _CameraExampleHomeState extends State // The exposure mode is currently not supported on the web. ...!kIsWeb ? >[ - cameraController.getMinExposureOffset().then( - (double value) => _minAvailableExposureOffset = value), - cameraController - .getMaxExposureOffset() + CameraPlatform.instance + .getMinExposureOffset(cameraController.cameraId) + .then( + (double value) => _minAvailableExposureOffset = value), + CameraPlatform.instance + .getMaxExposureOffset(cameraController.cameraId) .then((double value) => _maxAvailableExposureOffset = value) ] : >[], - cameraController - .getMaxZoomLevel() + CameraPlatform.instance + .getMaxZoomLevel(cameraController.cameraId) .then((double value) => _maxAvailableZoom = value), - cameraController - .getMinZoomLevel() + CameraPlatform.instance + .getMinZoomLevel(cameraController.cameraId) .then((double value) => _minAvailableZoom = value), ]); } on CameraException catch (e) { @@ -674,6 +691,9 @@ class _CameraExampleHomeState extends State case 'AudioAccessRestricted': // iOS only showInSnackBar('Audio access is restricted.'); + case 'cameraPermission': + // Android & web only + showInSnackBar('Unknown permission error.'); default: _showCameraException(e); break; @@ -1038,7 +1058,7 @@ Future main() async { // Fetch the available cameras before initializing the app. try { WidgetsFlutterBinding.ensureInitialized(); - _cameras = await availableCameras(); + _cameras = await CameraPlatform.instance.availableCameras(); } on CameraException catch (e) { _logError(e.code, e.description); } 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 b05788d68a43..71a44df65c65 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 @@ -12,12 +12,14 @@ import 'package:stream_transform/stream_transform.dart'; import 'analyzer.dart'; import 'camera.dart'; +import 'camera2_camera_control.dart'; import 'camera_control.dart'; import 'camera_info.dart'; import 'camera_selector.dart'; import 'camera_state.dart'; import 'camerax_library.g.dart'; import 'camerax_proxy.dart'; +import 'capture_request_options.dart'; import 'device_orientation_manager.dart'; import 'exposure_state.dart'; import 'fallback_strategy.dart'; @@ -450,6 +452,28 @@ class AndroidCameraCameraX extends CameraPlatform { exposureState.exposureCompensationStep; } + /// Sets the focus mode for taking pictures. + @override + Future setFocusMode(int cameraId, FocusMode mode) async { + final CameraControl cameraControl = await camera!.getCameraControl(); + final Camera2CameraControl camera2cameraControl = + Camera2CameraControl(cameraControl: cameraControl); + switch (mode) { + case FocusMode.auto: + // CameraX defaults to auto mode, so simply ensure that the autofocus + // trigger is not idle, as set by previously setting FocusMode.locked. + // TODO(camsim99): Clear af trigger. + break; + case FocusMode.locked: + // Set autofocus trigger to idle to keep current focus setting. + final CaptureRequestOptions options = CaptureRequestOptions( + requestedOptions: const <(CaptureRequestKeySupportedType, Object?)>[ + (CaptureRequestKeySupportedType.controlAfTrigger, 0) + ]); // TODO(camsim99): Add constants for AF trigger values. + await camera2cameraControl.addCaptureRequestOptions(options); + } + } + /// Gets the supported step size for exposure offset for the selected camera in EV units. /// /// Returns 0 when exposure compensation is not supported. 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 07515c0c14fd..3ce671aa648c 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 @@ -34,7 +34,7 @@ enum CameraStateType { /// /// On the native side, ensure the following is done: /// -/// * Update `LiveDataHostApiImpl#getValue` is updated to properly return +/// * 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. @@ -68,8 +68,27 @@ enum VideoResolutionFallbackRule { lowerQualityThan, } +/// 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: +/// +/// * 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: +/// +/// * 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. enum CaptureRequestKeySupportedType { controlAeLock, + controlAfTrigger, } class ResolutionInfo { @@ -263,7 +282,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', @@ -319,8 +339,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, @@ -330,7 +349,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, @@ -467,8 +486,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, @@ -478,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, @@ -505,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', @@ -523,13 +541,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', @@ -557,8 +574,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, @@ -568,7 +584,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, @@ -596,7 +612,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', @@ -620,8 +637,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?; @@ -646,17 +662,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', @@ -683,8 +694,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', @@ -710,8 +720,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', @@ -756,8 +766,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, @@ -767,7 +776,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, @@ -860,7 +869,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, @@ -888,7 +897,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); @@ -906,11 +915,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?; @@ -963,8 +970,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, @@ -974,7 +980,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, @@ -997,15 +1003,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', @@ -1024,10 +1027,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', @@ -1046,10 +1049,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', @@ -1077,19 +1080,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, @@ -1117,7 +1118,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,14 +1136,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', @@ -1190,7 +1189,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', @@ -1238,8 +1238,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', @@ -1325,8 +1325,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', @@ -1349,8 +1349,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, @@ -1360,7 +1359,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, @@ -1383,17 +1382,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', @@ -1439,8 +1433,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?; @@ -1469,8 +1462,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', @@ -1498,8 +1491,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, @@ -1509,7 +1501,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, @@ -1567,8 +1559,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, @@ -1578,7 +1569,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, @@ -1695,8 +1686,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, @@ -1706,7 +1696,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, @@ -1729,17 +1719,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', @@ -1760,8 +1745,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', @@ -1809,8 +1794,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', @@ -1843,7 +1828,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); @@ -1861,14 +1846,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', @@ -1896,16 +1879,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', @@ -1933,16 +1912,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', @@ -1975,7 +1950,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); @@ -1988,8 +1963,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, @@ -1999,13 +1973,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?); @@ -2032,7 +2005,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); @@ -2043,13 +2016,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, @@ -2059,20 +2028,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; }); } @@ -2085,8 +2052,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, @@ -2096,7 +2062,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, @@ -2125,16 +2091,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', @@ -2151,14 +2113,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', @@ -2201,8 +2161,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', @@ -2291,8 +2251,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, @@ -2302,7 +2261,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, @@ -2323,8 +2282,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, @@ -2334,7 +2292,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, @@ -2365,7 +2323,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); @@ -2388,8 +2346,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', @@ -2428,13 +2385,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', @@ -2467,7 +2423,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); @@ -2480,8 +2436,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, @@ -2491,13 +2446,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!); @@ -2515,8 +2469,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, @@ -2526,7 +2479,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, @@ -2545,7 +2498,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, @@ -2626,8 +2579,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, @@ -2637,7 +2589,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, @@ -2664,8 +2616,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, @@ -2675,7 +2626,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, @@ -2689,8 +2640,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; }); } @@ -2716,9 +2666,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); @@ -2736,18 +2686,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', @@ -2764,13 +2708,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', @@ -2803,16 +2746,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', @@ -2844,8 +2783,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', @@ -2866,8 +2805,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', @@ -2884,14 +2823,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', @@ -2935,14 +2872,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', @@ -2970,8 +2905,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, @@ -2981,7 +2915,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, @@ -3009,7 +2943,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); @@ -3027,14 +2961,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', @@ -3064,8 +2996,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?; @@ -3096,8 +3027,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, @@ -3107,7 +3037,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, @@ -3130,14 +3060,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', @@ -3158,7 +3086,8 @@ 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', @@ -3214,19 +3143,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); @@ -3242,16 +3171,14 @@ 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', @@ -3279,14 +3206,12 @@ 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', @@ -3303,15 +3228,12 @@ 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/lib/src/capture_request_options.dart b/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart index 777d4a43370f..ddeffb78eb0e 100644 --- a/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart +++ b/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart @@ -112,6 +112,11 @@ class _CaptureRequestOptionsHostApiImpl extends CaptureRequestOptionsHostApi { throw ArgumentError( 'A controlAeLock value must be specified as a bool, but a $valueRuntimeType was specified.'); } + case CaptureRequestKeySupportedType.controlAfTrigger: + if (valueRuntimeType != int) { + throw ArgumentError( + 'A controlAfTrigger value must be specified as a int, but a $valueRuntimeType was specified.'); + } // This ignore statement is safe beause this error will be useful when // a new CaptureRequestKeySupportedType is being added, but the logic in // this method has not yet been updated. diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index db6164044d30..0ea4ad33a739 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -163,6 +163,7 @@ class MeteringPointInfo { /// interoperability with Camera2. enum CaptureRequestKeySupportedType { controlAeLock, + controlAfTrigger, } @HostApi(dartHostTestHandler: 'TestInstanceManagerHostApi') 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 4450f97c82d5..d9bd03d59b97 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,8 +1625,7 @@ 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); @@ -1904,21 +1638,17 @@ 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, @@ -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]; @@ -2226,19 +1918,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); @@ -2247,34 +1939,27 @@ 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!); @@ -2286,30 +1971,24 @@ 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, @@ -2324,18 +2003,14 @@ 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, @@ -2343,8 +2018,7 @@ 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 0b33c78820acd5075942b0af407f8340cdb296f7 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 11:10:03 -0800 Subject: [PATCH 02/27] This works but may need to swap in/out af points. I will see --- .../camerax/CameraAndroidCameraxPlugin.java | 12 ++++ .../FocusMeteringActionHostApiImpl.java | 2 +- .../camerax/GeneratedCameraXLibrary.java | 9 +-- .../camerax/MeteringPointHostApiImpl.java | 64 +++++++++++++++---- .../lib/src/android_camera_camerax.dart | 22 +++++-- .../lib/src/camera_control.dart | 4 +- .../lib/src/camerax_library.g.dart | 26 +++----- .../lib/src/metering_point.dart | 17 +++-- .../pigeons/camerax_library.dart | 11 ++-- .../test/test_camerax_library.g.dart | 15 +++-- 10 files changed, 125 insertions(+), 57 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 544320dcfd9c..8a9c309a128c 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 @@ -39,6 +39,9 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting @Nullable public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl; + @VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl; + + /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. * @@ -127,6 +130,12 @@ public void setUp( binaryMessenger, camera2CameraControlHostApiImpl); GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup( binaryMessenger, new CaptureRequestOptionsHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup( + binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager)); + GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup( + binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); + meteringPointHostApiImpl = new MeteringPointHostApiImpl(instanceManager); + GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, meteringPointHostApiImpl); } @Override @@ -248,6 +257,9 @@ 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/FocusMeteringActionHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java index 5eeedd15211c..568c83518429 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java @@ -59,7 +59,7 @@ public static class FocusMeteringActionProxy { } } - return focusMeteringActionBuilder.build(); + return focusMeteringActionBuilder.disableAutoCancel().build(); } @VisibleForTesting 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 0ad7d8fc87fa..e0ed23573ba4 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 @@ -85,7 +85,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. @@ -155,7 +155,7 @@ 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 + * * 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. @@ -3582,7 +3582,7 @@ 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 Long cameraInfoId); @NonNull Double getDefaultPointSize(); @@ -3606,8 +3606,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo 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); + api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg, (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); } catch (Throwable 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 56ffcfb2e391..36306253ed13 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,32 @@ 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); + 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 = getDefaultDisplayForAndroidVersionBelowR(activity); + } + + DisplayOrientedMeteringPointFactory factory = + getDisplayOrientedMeteringPointFactory(display, cameraInfo, 1f, 1f); + if (size == null) { return factory.createPoint(x.floatValue(), y.floatValue()); } else { @@ -43,11 +65,18 @@ public MeteringPoint create(@NonNull Double x, @NonNull Double y, @Nullable Doub } } + @NonNull + @SuppressWarnings("deprecation") + private Display getDefaultDisplayForAndroidVersionBelowR(@NonNull Activity activity) { + return ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)) + .getDefaultDisplay(); + } + @VisibleForTesting @NonNull - public SurfaceOrientedMeteringPointFactory getSurfaceOrientedMeteringPointFactory( - float width, float height) { - return new SurfaceOrientedMeteringPointFactory(width, height); + public DisplayOrientedMeteringPointFactory getDisplayOrientedMeteringPointFactory( + @NonNull Display display, @NonNull CameraInfo cameraInfo, float width, float height) { + return new DisplayOrientedMeteringPointFactory(display, cameraInfo, width, height); } /** @@ -81,10 +110,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/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 71a44df65c65..7f14ea9793da 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 @@ -23,10 +23,12 @@ import 'capture_request_options.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'; @@ -465,12 +467,20 @@ class AndroidCameraCameraX extends CameraPlatform { // TODO(camsim99): Clear af trigger. break; case FocusMode.locked: - // Set autofocus trigger to idle to keep current focus setting. - final CaptureRequestOptions options = CaptureRequestOptions( - requestedOptions: const <(CaptureRequestKeySupportedType, Object?)>[ - (CaptureRequestKeySupportedType.controlAfTrigger, 0) - ]); // TODO(camsim99): Add constants for AF trigger values. - await camera2cameraControl.addCaptureRequestOptions(options); + // this will construct an action with a MeteringRectangle that represents the whole FoV. + MeteringPoint point = + MeteringPoint(x: 0.5, y: 0.5, size: 1, cameraInfo: cameraInfo!); + FocusMeteringAction action = FocusMeteringAction(meteringPointInfos: <( + MeteringPoint meteringPoint, + int? meteringMode + )>[(point, FocusMeteringAction.flagAf)]); + await cameraControl.startFocusAndMetering(action); + // Set autofocus trigger to idle to keep current focus setting. + // final CaptureRequestOptions options = CaptureRequestOptions( + // requestedOptions: const <(CaptureRequestKeySupportedType, Object?)>[ + // (CaptureRequestKeySupportedType.controlAfTrigger, 0) + // ]); // TODO(camsim99): Add constants for AF trigger values. + // await camera2cameraControl.addCaptureRequestOptions(options); } } 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 9c50ffa161fd..d42a5c03b74d 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -133,10 +133,10 @@ 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); return instanceManager.getInstanceWithWeakReference( - focusMeteringResultId); + focusMeteringResultId!); } on PlatformException catch (e) { SystemServices.cameraErrorStreamController .add(e.message ?? 'Starting focus and metering failed.'); 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 3ce671aa648c..5db307876837 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. @@ -2823,7 +2823,7 @@ 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); @@ -2840,13 +2840,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?); } } @@ -2872,7 +2867,7 @@ 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, binaryMessenger: _binaryMessenger); @@ -2889,13 +2884,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?); } } } @@ -3060,12 +3050,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, 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?; + 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/metering_point.dart b/packages/camera/camera_android_camerax/lib/src/metering_point.dart index d699993a8933..c5ee6061de9c 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'; @@ -23,13 +24,14 @@ class MeteringPoint extends JavaObject { required this.x, required this.y, this.size, + required this.cameraInfo, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, ) { _api = _MeteringPointHostApiImpl( binaryMessenger: binaryMessenger, instanceManager: instanceManager); - _api.createFromInstance(this, x, y, size); + _api.createFromInstance(this, x, y, size, cameraInfo); AndroidCameraXCameraFlutterApis.instance.ensureSetUp(); } @@ -41,6 +43,7 @@ class MeteringPoint extends JavaObject { required this.x, required this.y, this.size, + required this.cameraInfo, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, @@ -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, + double? size, CameraInfo cameraInfo) { 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 0ea4ad33a739..c5d80a4e8634 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. @@ -486,13 +486,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() @@ -517,7 +517,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/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index d9bd03d59b97..34a75944e628 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 @@ -1632,11 +1632,11 @@ abstract class TestCameraControlHostApi { 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}) { { @@ -1700,7 +1700,7 @@ 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]; }); } @@ -1741,7 +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]; }); } @@ -1837,7 +1837,7 @@ abstract class TestMeteringPointHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => 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(); @@ -1863,7 +1863,10 @@ 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 f1bdb1f52851ee5cae2bbe76ab4f915f16741934 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 14:00:11 -0800 Subject: [PATCH 03/27] Formatting --- .../Camera2CameraControlHostApiImpl.java | 16 +- .../camerax/CameraAndroidCameraxPlugin.java | 9 +- .../CaptureRequestOptionsHostApiImpl.java | 6 +- .../camerax/GeneratedCameraXLibrary.java | 1159 +++++++++++------ .../lib/src/camerax_library.g.dart | 449 ++++--- .../test/test_camerax_library.g.dart | 998 +++++++++----- 6 files changed, 1722 insertions(+), 915 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java index 57a41a670dd5..7594fb7a9bc8 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java @@ -5,6 +5,8 @@ package io.flutter.plugins.camerax; import android.content.Context; +import android.hardware.camera2.CameraMetadata; +import android.hardware.camera2.CaptureRequest; import androidx.annotation.NonNull; import androidx.annotation.OptIn; import androidx.annotation.VisibleForTesting; @@ -18,9 +20,6 @@ import io.flutter.plugins.camerax.GeneratedCameraXLibrary.Camera2CameraControlHostApi; import java.util.Objects; -import android.hardware.camera2.CaptureRequest; -import android.hardware.camera2.CameraMetadata; - /** * Host API implementation for {@link Camera2CameraControl}. * @@ -60,8 +59,15 @@ public void addCaptureRequestOptions( // ListenableFuture addCaptureRequestOptionsFuture = // camera2CameraControl.addCaptureRequestOptions(bundle); - CaptureRequestOptions options = new CaptureRequestOptions.Builder().setCaptureRequestOption(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO).setCaptureRequestOption(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE).build(); - ListenableFuture addCaptureRequestOptionsFuture = camera2CameraControl.setCaptureRequestOptions(options); + CaptureRequestOptions options = + new CaptureRequestOptions.Builder() + .setCaptureRequestOption( + CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO) + .setCaptureRequestOption( + CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE) + .build(); + ListenableFuture addCaptureRequestOptionsFuture = + camera2CameraControl.setCaptureRequestOptions(options); Futures.addCallback( addCaptureRequestOptionsFuture, 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 60ae03c355af..2a06c1448a61 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 @@ -37,11 +37,10 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting public @Nullable LiveDataHostApiImpl liveDataHostApiImpl; - @VisibleForTesting @Nullable + @VisibleForTesting @Nullable public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl; - @VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl; - + @VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl; /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. @@ -126,7 +125,7 @@ public void setUp( cameraControlHostApiImpl = new CameraControlHostApiImpl(binaryMessenger, instanceManager, context); GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl); - camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context); + camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context); GeneratedCameraXLibrary.Camera2CameraControlHostApi.setup( binaryMessenger, camera2CameraControlHostApiImpl); GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup( @@ -228,7 +227,7 @@ public void updateContext(@NonNull Context context) { if (cameraControlHostApiImpl != null) { cameraControlHostApiImpl.setContext(context); } - if (camera2CameraControlHostApiImpl != null) { + if (camera2CameraControlHostApiImpl != null) { camera2CameraControlHostApiImpl.setContext(context); } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java index cf834db0618f..6cb51a48255d 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java @@ -4,8 +4,8 @@ package io.flutter.plugins.camerax; -import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CameraMetadata; +import android.hardware.camera2.CaptureRequest; import androidx.annotation.NonNull; import androidx.annotation.OptIn; import androidx.annotation.VisibleForTesting; @@ -53,7 +53,9 @@ public static class CaptureRequestOptionsProxy { (CaptureRequest.Key) optionKey, (Boolean) optionValue); break; case CONTROL_AF_TRIGGER: - builder.setCaptureRequestOption( (CaptureRequest.Key) optionKey, CameraMetadata.CONTROL_AF_TRIGGER_IDLE); //(Integer) optionValue); + builder.setCaptureRequestOption( + (CaptureRequest.Key) optionKey, + CameraMetadata.CONTROL_AF_TRIGGER_IDLE); //(Integer) optionValue); break; default: throw new IllegalArgumentException( 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 e0ed23573ba4..8f60778a6d47 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 `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. + *

* 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. * - * 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 `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. + *

* 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: + *

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), @@ -246,9 +241,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; } } @@ -490,9 +489,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; } } @@ -500,7 +509,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; @@ -551,10 +560,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]. */ @@ -574,7 +582,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; @@ -624,9 +632,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; } } @@ -642,7 +658,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(); @@ -650,8 +666,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<>( @@ -663,8 +683,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; } @@ -685,7 +704,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 = @@ -700,8 +721,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; } @@ -721,7 +741,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); @@ -730,6 +750,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -742,28 +763,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) -> { @@ -771,10 +796,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; } @@ -795,10 +821,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; } @@ -811,7 +838,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) -> { @@ -819,10 +848,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; } @@ -843,10 +873,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; } @@ -866,7 +896,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); @@ -875,6 +905,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -889,15 +920,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<>( @@ -910,10 +945,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; } @@ -935,10 +971,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; } @@ -958,7 +996,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); @@ -967,7 +1005,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()); @@ -981,13 +1021,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); @@ -998,12 +1041,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) -> { @@ -1030,7 +1079,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) -> { @@ -1038,10 +1089,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; } @@ -1054,7 +1106,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) -> { @@ -1064,10 +1118,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; } @@ -1080,7 +1139,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) -> { @@ -1089,10 +1150,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; } @@ -1105,7 +1168,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) -> { @@ -1114,10 +1179,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; } @@ -1130,7 +1195,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) -> { @@ -1140,8 +1207,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; } @@ -1161,7 +1227,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); @@ -1170,10 +1236,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)); @@ -1182,17 +1251,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 = @@ -1205,10 +1274,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; } @@ -1229,10 +1298,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; } @@ -1252,7 +1322,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); @@ -1261,6 +1331,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1300,21 +1371,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) -> { @@ -1343,7 +1421,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) -> { @@ -1354,8 +1434,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; } @@ -1375,7 +1454,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); @@ -1384,10 +1463,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)); @@ -1396,23 +1478,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) -> { @@ -1421,10 +1510,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; } @@ -1437,7 +1527,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) -> { @@ -1445,8 +1537,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; } @@ -1459,7 +1550,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) -> { @@ -1467,8 +1560,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; } @@ -1488,7 +1580,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); @@ -1497,10 +1589,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)); @@ -1536,14 +1632,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); @@ -1552,7 +1649,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 = @@ -1567,10 +1664,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; } @@ -1583,7 +1684,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) -> { @@ -1591,10 +1694,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; } @@ -1607,7 +1711,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) -> { @@ -1615,8 +1721,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; } @@ -1637,10 +1742,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; } @@ -1662,10 +1768,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; } @@ -1680,10 +1787,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); @@ -1692,7 +1799,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 = @@ -1705,10 +1815,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; } @@ -1729,10 +1840,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; } @@ -1745,7 +1856,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) -> { @@ -1754,10 +1867,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; } @@ -1777,7 +1891,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); @@ -1786,6 +1900,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1798,22 +1913,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 = @@ -1829,10 +1950,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; } @@ -1853,10 +1977,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; } @@ -1869,7 +1994,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) -> { @@ -1877,10 +2004,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; } @@ -1902,10 +2030,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; } @@ -1925,7 +2054,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); @@ -1934,7 +2063,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()); @@ -1946,15 +2080,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<>( @@ -1966,10 +2104,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; } @@ -1989,7 +2127,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); @@ -1998,6 +2136,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2022,7 +2161,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 = @@ -2037,8 +2178,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; } @@ -2061,8 +2201,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; } @@ -2085,8 +2224,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; } @@ -2109,8 +2247,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; } @@ -2130,7 +2267,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); @@ -2139,6 +2276,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2151,7 +2289,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); @@ -2163,7 +2305,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 = @@ -2179,10 +2324,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; } @@ -2204,10 +2354,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; } @@ -2240,7 +2391,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); @@ -2249,7 +2401,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) -> { @@ -2258,10 +2412,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; } @@ -2275,7 +2430,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() {} @@ -2303,14 +2459,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<>( @@ -2324,10 +2485,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; } @@ -2342,14 +2505,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<>( @@ -2363,10 +2533,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; } @@ -2381,18 +2557,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) -> { @@ -2402,10 +2585,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; } @@ -2452,7 +2639,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); @@ -2461,7 +2648,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()); @@ -2505,7 +2697,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); @@ -2514,12 +2706,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)); } } @@ -2531,7 +2730,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); @@ -2540,7 +2739,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()); @@ -2552,7 +2756,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); @@ -2564,8 +2771,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<>( @@ -2579,10 +2790,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; } @@ -2604,10 +2819,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; } @@ -2620,7 +2836,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) -> { @@ -2630,8 +2848,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; } @@ -2644,7 +2861,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) -> { @@ -2653,10 +2872,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; } @@ -2677,7 +2897,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 = @@ -2692,8 +2914,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; } @@ -2714,7 +2935,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 = @@ -2729,8 +2952,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; } @@ -2750,7 +2972,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); @@ -2759,7 +2981,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()); @@ -2776,7 +3002,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); @@ -2785,7 +3011,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()); @@ -2828,14 +3056,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 = @@ -2849,10 +3079,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; } @@ -2875,8 +3106,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; } @@ -2898,10 +3128,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; } @@ -2948,7 +3179,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); @@ -2957,7 +3188,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()); @@ -2974,7 +3209,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); @@ -2983,6 +3218,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2991,7 +3227,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()); @@ -3003,7 +3243,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); @@ -3012,7 +3252,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 = @@ -3025,10 +3267,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; } @@ -3051,8 +3293,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; } @@ -3072,7 +3313,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); @@ -3081,7 +3322,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()); @@ -3098,7 +3345,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); @@ -3107,12 +3354,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)); } } @@ -3151,17 +3405,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<>( @@ -3172,13 +3433,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; } @@ -3191,19 +3455,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; } @@ -3218,14 +3487,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<>( @@ -3236,13 +3512,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; } @@ -3257,22 +3539,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<>( @@ -3297,7 +3589,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); @@ -3306,7 +3601,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) -> { @@ -3327,7 +3624,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); @@ -3336,7 +3636,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) -> { @@ -3357,7 +3659,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); @@ -3366,7 +3673,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) -> { @@ -3386,7 +3695,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); @@ -3395,7 +3705,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) -> { @@ -3416,7 +3728,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); @@ -3432,7 +3747,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); @@ -3441,6 +3756,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3452,7 +3768,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() {} @@ -3486,24 +3803,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; } @@ -3518,19 +3843,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) -> { @@ -3538,10 +3869,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; } @@ -3561,7 +3893,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); @@ -3570,10 +3902,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)); @@ -3582,17 +3917,26 @@ 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, @NonNull Long cameraInfoId); + void create( + @NonNull Long identifier, + @NonNull Double x, + @NonNull Double y, + @Nullable Double size, + @NonNull Long cameraInfoId); - @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<>( @@ -3608,10 +3952,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo Double sizeArg = (Double) args.get(3); Number cameraInfoIdArg = (Number) args.get(4); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg, (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + xArg, + yArg, + sizeArg, + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3624,7 +3972,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) -> { @@ -3632,8 +3982,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; } @@ -3647,7 +3996,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() {} @@ -3711,12 +4061,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) -> { @@ -3725,10 +4081,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; } @@ -3745,18 +4101,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) -> { @@ -3765,10 +4130,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; } @@ -3781,7 +4149,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) -> { @@ -3802,7 +4172,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/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index 5db307876837..cf85532118aa 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 @@ -282,8 +282,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', @@ -339,7 +338,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, @@ -349,7 +349,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, @@ -486,7 +486,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, @@ -496,7 +497,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, @@ -523,8 +524,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', @@ -541,12 +542,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', @@ -574,7 +576,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, @@ -584,7 +587,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, @@ -612,8 +615,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', @@ -637,7 +639,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?; @@ -662,12 +665,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', @@ -694,7 +702,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', @@ -720,8 +729,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', @@ -766,7 +775,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, @@ -776,7 +786,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, @@ -869,7 +879,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, @@ -897,7 +907,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); @@ -915,9 +925,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?; @@ -970,7 +982,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, @@ -980,7 +993,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, @@ -1003,12 +1016,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', @@ -1027,10 +1043,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', @@ -1049,10 +1065,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', @@ -1080,17 +1096,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, @@ -1118,7 +1136,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); @@ -1136,12 +1154,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', @@ -1189,8 +1209,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', @@ -1238,8 +1257,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', @@ -1325,8 +1344,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', @@ -1349,7 +1368,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, @@ -1359,7 +1379,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, @@ -1382,12 +1402,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', @@ -1433,7 +1458,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?; @@ -1462,8 +1488,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', @@ -1491,7 +1517,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, @@ -1501,7 +1528,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, @@ -1559,7 +1586,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, @@ -1569,7 +1597,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, @@ -1686,7 +1714,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, @@ -1696,7 +1725,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, @@ -1719,12 +1748,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', @@ -1745,8 +1779,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', @@ -1794,8 +1828,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', @@ -1828,7 +1862,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); @@ -1846,12 +1880,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', @@ -1879,12 +1915,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', @@ -1912,12 +1952,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', @@ -1950,7 +1994,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); @@ -1963,7 +2007,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, @@ -1973,12 +2018,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?); @@ -2005,7 +2051,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); @@ -2016,9 +2062,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, @@ -2028,18 +2078,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; }); } @@ -2052,7 +2104,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, @@ -2062,7 +2115,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, @@ -2091,12 +2144,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', @@ -2113,12 +2170,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', @@ -2161,8 +2220,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', @@ -2251,7 +2310,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, @@ -2261,7 +2321,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, @@ -2282,7 +2342,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, @@ -2292,7 +2353,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, @@ -2323,7 +2384,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); @@ -2346,7 +2407,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', @@ -2385,12 +2447,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', @@ -2423,7 +2486,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); @@ -2436,7 +2499,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, @@ -2446,12 +2510,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!); @@ -2469,7 +2534,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, @@ -2479,7 +2545,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, @@ -2498,7 +2564,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, @@ -2579,7 +2645,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, @@ -2589,7 +2656,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, @@ -2616,7 +2683,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, @@ -2626,7 +2694,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, @@ -2640,7 +2708,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; }); } @@ -2666,9 +2735,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); @@ -2686,12 +2755,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', @@ -2708,12 +2783,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', @@ -2746,12 +2822,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', @@ -2783,8 +2863,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', @@ -2805,8 +2885,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', @@ -2823,12 +2903,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', @@ -2867,12 +2949,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', @@ -2895,7 +2979,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, @@ -2905,7 +2990,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, @@ -2933,7 +3018,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); @@ -2951,12 +3036,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', @@ -2986,7 +3073,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?; @@ -3017,7 +3105,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, @@ -3027,7 +3116,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, @@ -3050,12 +3139,14 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size, int arg_cameraInfoId) 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, arg_cameraInfoId]) 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', @@ -3076,8 +3167,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', @@ -3133,19 +3223,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); @@ -3161,14 +3251,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', @@ -3196,12 +3288,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', @@ -3218,12 +3312,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 34a75944e628..c847327cce59 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,30 @@ 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, int cameraInfoId); + void create( + int identifier, double x, double y, double? size, int cameraInfoId); 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, @@ -1866,7 +2172,8 @@ abstract class TestMeteringPointHostApi { 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!); + api.create( + arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); return []; }); } @@ -1876,9 +2183,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]; @@ -1921,19 +2231,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); @@ -1942,27 +2252,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!); @@ -1974,24 +2291,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, @@ -2006,14 +2329,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, @@ -2021,7 +2348,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 bd1f1ba76fcb84cf4505e6a277f6a138eb5af1ae Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 14:10:06 -0800 Subject: [PATCH 04/27] Undo incorrect test changes --- .../Camera2CameraControlHostApiImpl.java | 13 +-- .../camerax/CameraAndroidCameraxPlugin.java | 13 --- .../CaptureRequestOptionsHostApiImpl.java | 13 +-- .../example/lib/main.dart | 108 +++++++++--------- .../lib/src/android_camera_camerax.dart | 16 +-- .../lib/src/camera_control.dart | 2 +- .../lib/src/capture_request_options.dart | 5 - .../pigeons/camerax_library.dart | 1 - 8 files changed, 58 insertions(+), 113 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java index 7594fb7a9bc8..8d10005f7d75 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java @@ -5,8 +5,6 @@ package io.flutter.plugins.camerax; import android.content.Context; -import android.hardware.camera2.CameraMetadata; -import android.hardware.camera2.CaptureRequest; import androidx.annotation.NonNull; import androidx.annotation.OptIn; import androidx.annotation.VisibleForTesting; @@ -57,17 +55,8 @@ public void addCaptureRequestOptions( throw new IllegalStateException("Context must be set to add capture request options."); } - // ListenableFuture addCaptureRequestOptionsFuture = - // camera2CameraControl.addCaptureRequestOptions(bundle); - CaptureRequestOptions options = - new CaptureRequestOptions.Builder() - .setCaptureRequestOption( - CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO) - .setCaptureRequestOption( - CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE) - .build(); ListenableFuture addCaptureRequestOptionsFuture = - camera2CameraControl.setCaptureRequestOptions(options); + camera2CameraControl.addCaptureRequestOptions(bundle); Futures.addCallback( addCaptureRequestOptionsFuture, 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 2a06c1448a61..ea9f3ed4d06c 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 @@ -37,11 +37,6 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting public @Nullable LiveDataHostApiImpl liveDataHostApiImpl; - @VisibleForTesting @Nullable - public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl; - - @VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl; - /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. * @@ -125,11 +120,6 @@ public void setUp( cameraControlHostApiImpl = new CameraControlHostApiImpl(binaryMessenger, instanceManager, context); GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl); - camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context); - GeneratedCameraXLibrary.Camera2CameraControlHostApi.setup( - binaryMessenger, camera2CameraControlHostApiImpl); - GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup( - binaryMessenger, new CaptureRequestOptionsHostApiImpl(instanceManager)); GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup( binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager)); GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup( @@ -227,9 +217,6 @@ public void updateContext(@NonNull Context context) { if (cameraControlHostApiImpl != null) { cameraControlHostApiImpl.setContext(context); } - if (camera2CameraControlHostApiImpl != null) { - camera2CameraControlHostApiImpl.setContext(context); - } } /** Sets {@code LifecycleOwner} that is used to control the lifecycle of the camera by CameraX. */ diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java index 6cb51a48255d..6f8d8c91dda6 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java @@ -4,7 +4,6 @@ package io.flutter.plugins.camerax; -import android.hardware.camera2.CameraMetadata; import android.hardware.camera2.CaptureRequest; import androidx.annotation.NonNull; import androidx.annotation.OptIn; @@ -52,11 +51,6 @@ public static class CaptureRequestOptionsProxy { builder.setCaptureRequestOption( (CaptureRequest.Key) optionKey, (Boolean) optionValue); break; - case CONTROL_AF_TRIGGER: - builder.setCaptureRequestOption( - (CaptureRequest.Key) optionKey, - CameraMetadata.CONTROL_AF_TRIGGER_IDLE); //(Integer) optionValue); - break; default: throw new IllegalArgumentException( "The capture request key " @@ -75,9 +69,6 @@ private CaptureRequest.Key getCaptureRequestKey( case CONTROL_AE_LOCK: key = CaptureRequest.CONTROL_AE_LOCK; break; - case CONTROL_AF_TRIGGER: - key = CaptureRequest.CONTROL_AF_TRIGGER; - break; default: throw new IllegalArgumentException( "The capture request key is not currently supported by the plugin."); @@ -119,8 +110,8 @@ public void create(@NonNull Long identifier, @NonNull Map options) Map decodedOptions = new HashMap(); for (Map.Entry option : options.entrySet()) { - Integer index = ((Number) option.getKey()).intValue(); - decodedOptions.put(CaptureRequestKeySupportedType.values()[index], option.getValue()); + decodedOptions.put( + CaptureRequestKeySupportedType.values()[option.getKey().intValue()], option.getValue()); } instanceManager.addDartCreatedInstance(proxy.create(decodedOptions), identifier); } diff --git a/packages/camera/camera_android_camerax/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index cf3fa303d763..c57ca6491dc5 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -4,7 +4,6 @@ import 'dart:async'; import 'dart:io'; -import 'dart:math'; import 'package:camera_platform_interface/camera_platform_interface.dart'; import 'package:flutter/foundation.dart'; @@ -111,6 +110,7 @@ class _CameraExampleHomeState extends State super.dispose(); } + // #docregion AppLifecycle @override void didChangeAppLifecycleState(AppLifecycleState state) { final CameraController? cameraController = controller; @@ -123,9 +123,10 @@ class _CameraExampleHomeState extends State if (state == AppLifecycleState.inactive) { cameraController.dispose(); } else if (state == AppLifecycleState.resumed) { - _initializeCameraController(cameraController.description); + onNewCameraSelected(cameraController.description); } } + // #enddocregion AppLifecycle @override Widget build(BuildContext context) { @@ -218,8 +219,7 @@ class _CameraExampleHomeState extends State _currentScale = (_baseScale * details.scale) .clamp(_minAvailableZoom, _maxAvailableZoom); - await CameraPlatform.instance - .setZoomLevel(controller!.cameraId, _currentScale); + await controller!.setZoomLevel(_currentScale); } /// Display the thumbnail of the captured image or video. @@ -393,10 +393,8 @@ class _CameraExampleHomeState extends State children: [ TextButton( style: styleAuto, - onPressed: controller != null - ? () => - onSetExposureModeButtonPressed(ExposureMode.auto) - : null, + onPressed: + () {}, // TODO(camsim99): Add functionality back here. onLongPress: () { if (controller != null) { CameraPlatform.instance @@ -408,10 +406,8 @@ class _CameraExampleHomeState extends State ), TextButton( style: styleLocked, - onPressed: controller != null - ? () => - onSetExposureModeButtonPressed(ExposureMode.locked) - : null, + onPressed: + () {}, // TODO(camsim99): Add functionality back here. child: const Text('LOCKED'), ), TextButton( @@ -524,35 +520,29 @@ class _CameraExampleHomeState extends State IconButton( icon: const Icon(Icons.videocam), color: Colors.blue, - onPressed: cameraController != null && - cameraController.value.isInitialized && - !cameraController.value.isRecordingVideo - ? onVideoRecordButtonPressed - : null, + onPressed: + cameraController == null ? null : onVideoRecordButtonPressed, ), IconButton( icon: cameraController != null && - (!cameraController.value.isRecordingVideo || - cameraController.value.isRecordingPaused) + cameraController.value.isRecordingPaused ? const Icon(Icons.play_arrow) : const Icon(Icons.pause), color: Colors.blue, - onPressed: cameraController != null && - cameraController.value.isInitialized && - cameraController.value.isRecordingVideo - ? (cameraController.value.isRecordingPaused) - ? onResumeButtonPressed - : onPauseButtonPressed - : null, + onPressed: () { + if (cameraController == null) { + return; + } else if (cameraController.value.isRecordingPaused) { + return onResumeButtonPressed(); + } else { + return onPauseButtonPressed(); + } + }, ), IconButton( icon: const Icon(Icons.stop), color: Colors.red, - onPressed: cameraController != null && - cameraController.value.isInitialized && - cameraController.value.isRecordingVideo - ? onStopButtonPressed - : null, + onPressed: cameraController == null ? null : onStopButtonPressed, ), IconButton( icon: const Icon(Icons.pause_presentation), @@ -593,7 +583,10 @@ class _CameraExampleHomeState extends State title: Icon(getCameraLensIcon(cameraDescription.lensDirection)), groupValue: controller?.description, value: cameraDescription, - onChanged: onChanged, + onChanged: + controller != null && controller!.value.isRecordingVideo + ? null + : onChanged, ), ), ); @@ -617,24 +610,26 @@ class _CameraExampleHomeState extends State final CameraController cameraController = controller!; - final Point point = Point( + final Offset offset = Offset( details.localPosition.dx / constraints.maxWidth, details.localPosition.dy / constraints.maxHeight, ); - CameraPlatform.instance.setExposurePoint(cameraController.cameraId, point); - CameraPlatform.instance.setFocusPoint(cameraController.cameraId, point); + cameraController.setExposurePoint(offset); + cameraController.setFocusPoint(offset); } Future onNewCameraSelected(CameraDescription cameraDescription) async { - // if (controller != null) { - // return controller!.setDescription(cameraDescription); - // } else { - return _initializeCameraController(cameraDescription); - // } - } + final CameraController? oldController = controller; + if (oldController != null) { + // `controller` needs to be set to null before getting disposed, + // to avoid a race condition when we use the controller that is being + // disposed. This happens when camera permission dialog shows up, + // which triggers `didChangeAppLifecycleState`, which disposes and + // re-creates the controller. + controller = null; + await oldController.dispose(); + } - Future _initializeCameraController( - CameraDescription cameraDescription) async { final CameraController cameraController = CameraController( cameraDescription, kIsWeb ? ResolutionPreset.max : ResolutionPreset.medium, @@ -649,6 +644,10 @@ class _CameraExampleHomeState extends State if (mounted) { setState(() {}); } + if (cameraController.value.hasError) { + showInSnackBar( + 'Camera error ${cameraController.value.errorDescription}'); + } }); try { @@ -657,20 +656,18 @@ class _CameraExampleHomeState extends State // The exposure mode is currently not supported on the web. ...!kIsWeb ? >[ - CameraPlatform.instance - .getMinExposureOffset(cameraController.cameraId) - .then( - (double value) => _minAvailableExposureOffset = value), - CameraPlatform.instance - .getMaxExposureOffset(cameraController.cameraId) + cameraController.getMinExposureOffset().then( + (double value) => _minAvailableExposureOffset = value), + cameraController + .getMaxExposureOffset() .then((double value) => _maxAvailableExposureOffset = value) ] : >[], - CameraPlatform.instance - .getMaxZoomLevel(cameraController.cameraId) + cameraController + .getMaxZoomLevel() .then((double value) => _maxAvailableZoom = value), - CameraPlatform.instance - .getMinZoomLevel(cameraController.cameraId) + cameraController + .getMinZoomLevel() .then((double value) => _minAvailableZoom = value), ]); } on CameraException catch (e) { @@ -691,9 +688,6 @@ class _CameraExampleHomeState extends State case 'AudioAccessRestricted': // iOS only showInSnackBar('Audio access is restricted.'); - case 'cameraPermission': - // Android & web only - showInSnackBar('Unknown permission error.'); default: _showCameraException(e); break; @@ -1058,7 +1052,7 @@ Future main() async { // Fetch the available cameras before initializing the app. try { WidgetsFlutterBinding.ensureInitialized(); - _cameras = await CameraPlatform.instance.availableCameras(); + _cameras = await availableCameras(); } on CameraException catch (e) { _logError(e.code, e.description); } 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 1e11cf52e812..869fb2b0197f 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 @@ -14,14 +14,12 @@ import 'package:stream_transform/stream_transform.dart'; import 'analyzer.dart'; import 'camera.dart'; -import 'camera2_camera_control.dart'; import 'camera_control.dart'; import 'camera_info.dart'; import 'camera_selector.dart'; import 'camera_state.dart'; import 'camerax_library.g.dart'; import 'camerax_proxy.dart'; -import 'capture_request_options.dart'; import 'device_orientation_manager.dart'; import 'exposure_state.dart'; import 'fallback_strategy.dart'; @@ -484,9 +482,6 @@ class AndroidCameraCameraX extends CameraPlatform { /// Sets the focus mode for taking pictures. @override Future setFocusMode(int cameraId, FocusMode mode) async { - final CameraControl cameraControl = await camera!.getCameraControl(); - final Camera2CameraControl camera2cameraControl = - Camera2CameraControl(cameraControl: cameraControl); switch (mode) { case FocusMode.auto: // CameraX defaults to auto mode, so simply ensure that the autofocus @@ -495,19 +490,14 @@ class AndroidCameraCameraX extends CameraPlatform { break; case FocusMode.locked: // this will construct an action with a MeteringRectangle that represents the whole FoV. - MeteringPoint point = + final MeteringPoint point = MeteringPoint(x: 0.5, y: 0.5, size: 1, cameraInfo: cameraInfo!); - FocusMeteringAction action = FocusMeteringAction(meteringPointInfos: <( + final FocusMeteringAction action = FocusMeteringAction( + meteringPointInfos: <( MeteringPoint meteringPoint, int? meteringMode )>[(point, FocusMeteringAction.flagAf)]); await cameraControl.startFocusAndMetering(action); - // Set autofocus trigger to idle to keep current focus setting. - // final CaptureRequestOptions options = CaptureRequestOptions( - // requestedOptions: const <(CaptureRequestKeySupportedType, Object?)>[ - // (CaptureRequestKeySupportedType.controlAfTrigger, 0) - // ]); // TODO(camsim99): Add constants for AF trigger values. - // await camera2cameraControl.addCaptureRequestOptions(options); } } 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 cc2959f9c898..a233011975f0 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -149,7 +149,7 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { return Future.value(); } return instanceManager.getInstanceWithWeakReference( - focusMeteringResultId!); + focusMeteringResultId); } on PlatformException catch (e) { SystemServices.cameraErrorStreamController .add(e.message ?? 'Starting focus and metering failed.'); diff --git a/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart b/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart index ddeffb78eb0e..777d4a43370f 100644 --- a/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart +++ b/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart @@ -112,11 +112,6 @@ class _CaptureRequestOptionsHostApiImpl extends CaptureRequestOptionsHostApi { throw ArgumentError( 'A controlAeLock value must be specified as a bool, but a $valueRuntimeType was specified.'); } - case CaptureRequestKeySupportedType.controlAfTrigger: - if (valueRuntimeType != int) { - throw ArgumentError( - 'A controlAfTrigger value must be specified as a int, but a $valueRuntimeType was specified.'); - } // This ignore statement is safe beause this error will be useful when // a new CaptureRequestKeySupportedType is being added, but the logic in // this method has not yet been updated. diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index c5d80a4e8634..fc78cae75d24 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -163,7 +163,6 @@ class MeteringPointInfo { /// interoperability with Camera2. enum CaptureRequestKeySupportedType { controlAeLock, - controlAfTrigger, } @HostApi(dartHostTestHandler: 'TestInstanceManagerHostApi') From 24dd03b3cda6bca8923c87016117def95f0ceb3b Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 14:11:12 -0800 Subject: [PATCH 05/27] Undo more changes --- .../io/flutter/plugins/camerax/GeneratedCameraXLibrary.java | 3 +-- .../camera_android_camerax/lib/src/camerax_library.g.dart | 1 - 2 files changed, 1 insertion(+), 3 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 8f60778a6d47..ac92427314f9 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 @@ -165,8 +165,7 @@ private VideoResolutionFallbackRule(final int index) { * Camera2. */ public enum CaptureRequestKeySupportedType { - CONTROL_AE_LOCK(0), - CONTROL_AF_TRIGGER(1); + CONTROL_AE_LOCK(0); final int index; 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 cf85532118aa..14239dd01b69 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 @@ -88,7 +88,6 @@ enum VideoResolutionFallbackRule { /// interoperability with Camera2. enum CaptureRequestKeySupportedType { controlAeLock, - controlAfTrigger, } class ResolutionInfo { From f73c2fb9eed4f3256a425c7fb14b66101fbe13aa Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 15:47:09 -0800 Subject: [PATCH 06/27] Add disableAutoCancel param + leave todos for case handling --- .../FocusMeteringActionHostApiImpl.java | 12 +- .../camerax/GeneratedCameraXLibrary.java | 1162 ++++++----------- .../lib/src/android_camera_camerax.dart | 17 +- .../lib/src/camerax_library.g.dart | 449 +++---- .../lib/src/focus_metering_action.dart | 16 +- .../pigeons/camerax_library.dart | 3 +- .../test/test_camerax_library.g.dart | 1003 +++++--------- 7 files changed, 944 insertions(+), 1718 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java index 568c83518429..1a7d51b94527 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java @@ -29,7 +29,7 @@ public class FocusMeteringActionHostApiImpl implements FocusMeteringActionHostAp public static class FocusMeteringActionProxy { /** Creates an instance of {@link FocusMeteringAction}. */ public @NonNull FocusMeteringAction create( - @NonNull List meteringPoints, @NonNull List meteringPointModes) { + @NonNull List meteringPoints, @NonNull List meteringPointModes, @Nullable Boolean disableAutoCancel) { if (meteringPoints.size() >= 1 && meteringPoints.size() != meteringPointModes.size()) { throw new IllegalArgumentException( "One metering point must be specified and the number of specified metering points must match the number of specified metering point modes."); @@ -59,7 +59,11 @@ public static class FocusMeteringActionProxy { } } - return focusMeteringActionBuilder.disableAutoCancel().build(); + if (disableAutoCancel == true) { + focusMeteringActionBuilder.disableAutoCancel(); + } + + return focusMeteringActionBuilder.build(); } @VisibleForTesting @@ -100,7 +104,7 @@ public FocusMeteringActionHostApiImpl(@NonNull InstanceManager instanceManager) @Override public void create( - @NonNull Long identifier, @NonNull List meteringPointInfos) { + @NonNull Long identifier, @NonNull List meteringPointInfos, @Nullable Boolean disableAutoCancel) { final List meteringPoints = new ArrayList(); final List meteringPointModes = new ArrayList(); for (MeteringPointInfo meteringPointInfo : meteringPointInfos) { @@ -110,6 +114,6 @@ public void create( } instanceManager.addDartCreatedInstance( - proxy.create(meteringPoints, meteringPointModes), identifier); + proxy.create(meteringPoints, meteringPointModes), identifier, disableAutoCancel); } } 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 ac92427314f9..e34019800cf4 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,6 +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; @@ -34,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; @@ -53,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; } @@ -61,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), @@ -80,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 `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. + * * 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. * - *

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), @@ -106,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), @@ -131,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), @@ -149,20 +152,22 @@ 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 `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. + * * 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: + * 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); @@ -240,13 +245,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; } } @@ -488,19 +489,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; } } @@ -508,7 +499,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; @@ -559,9 +550,10 @@ 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]. */ @@ -581,7 +573,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; @@ -631,17 +623,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; } } @@ -657,7 +641,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(); @@ -665,12 +649,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<>( @@ -682,7 +662,8 @@ static void setup( try { api.clear(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -703,9 +684,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 = @@ -720,7 +699,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; } @@ -740,7 +720,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); @@ -749,7 +729,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -762,32 +741,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) -> { @@ -795,11 +770,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; } @@ -820,11 +794,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; } @@ -837,9 +810,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) -> { @@ -847,11 +818,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; } @@ -872,10 +842,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; } @@ -895,7 +865,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); @@ -904,7 +874,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -919,19 +888,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<>( @@ -944,11 +909,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; } @@ -970,12 +934,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; } @@ -995,7 +957,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); @@ -1004,9 +966,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()); @@ -1020,16 +980,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); @@ -1040,18 +997,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) -> { @@ -1078,9 +1029,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) -> { @@ -1088,11 +1037,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; } @@ -1105,9 +1053,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) -> { @@ -1117,15 +1063,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; } @@ -1138,9 +1079,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) -> { @@ -1149,12 +1088,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; } @@ -1167,9 +1104,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) -> { @@ -1178,10 +1113,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; } @@ -1194,9 +1129,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) -> { @@ -1206,7 +1139,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; } @@ -1226,7 +1160,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); @@ -1235,13 +1169,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)); @@ -1250,17 +1181,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 = @@ -1273,10 +1204,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; } @@ -1297,11 +1228,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; } @@ -1321,7 +1251,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); @@ -1330,7 +1260,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1370,28 +1299,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) -> { @@ -1420,9 +1342,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) -> { @@ -1433,7 +1353,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; } @@ -1453,7 +1374,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); @@ -1462,13 +1383,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)); @@ -1477,30 +1395,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) -> { @@ -1509,11 +1420,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; } @@ -1526,9 +1436,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) -> { @@ -1536,7 +1444,8 @@ static void setup( try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1549,9 +1458,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) -> { @@ -1559,7 +1466,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; } @@ -1579,7 +1487,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); @@ -1588,14 +1496,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)); @@ -1631,15 +1535,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); @@ -1648,7 +1551,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 = @@ -1663,14 +1566,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; } @@ -1683,9 +1582,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) -> { @@ -1693,11 +1590,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; } @@ -1710,9 +1606,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) -> { @@ -1720,7 +1614,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; } @@ -1741,11 +1636,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; } @@ -1767,11 +1661,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; } @@ -1786,10 +1679,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); @@ -1798,10 +1691,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 = @@ -1814,11 +1704,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; } @@ -1839,10 +1728,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; } @@ -1855,9 +1744,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) -> { @@ -1866,11 +1753,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; } @@ -1890,7 +1776,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); @@ -1899,7 +1785,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1912,28 +1797,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 = @@ -1949,13 +1828,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; } @@ -1976,11 +1852,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; } @@ -1993,9 +1868,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) -> { @@ -2003,11 +1876,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; } @@ -2029,11 +1901,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; } @@ -2053,7 +1924,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); @@ -2062,12 +1933,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()); @@ -2079,19 +1945,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<>( @@ -2103,10 +1965,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; } @@ -2126,7 +1988,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); @@ -2135,7 +1997,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2160,9 +2021,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 = @@ -2177,7 +2036,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; } @@ -2200,7 +2060,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; } @@ -2223,7 +2084,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; } @@ -2246,7 +2108,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; } @@ -2266,7 +2129,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); @@ -2275,7 +2138,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2288,11 +2150,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); @@ -2304,10 +2162,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 = @@ -2323,15 +2178,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; } @@ -2353,11 +2203,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; } @@ -2390,8 +2239,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); @@ -2400,9 +2248,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) -> { @@ -2411,11 +2257,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; } @@ -2429,8 +2274,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() {} @@ -2458,19 +2302,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<>( @@ -2484,12 +2323,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; } @@ -2504,21 +2341,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<>( @@ -2532,16 +2362,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; } @@ -2556,25 +2380,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) -> { @@ -2584,14 +2401,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; } @@ -2638,7 +2451,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); @@ -2647,12 +2460,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()); @@ -2696,7 +2504,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); @@ -2705,19 +2513,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)); } } @@ -2729,7 +2530,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); @@ -2738,12 +2539,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()); @@ -2755,10 +2551,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); @@ -2770,12 +2563,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<>( @@ -2789,14 +2578,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; } @@ -2818,11 +2603,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; } @@ -2835,9 +2619,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) -> { @@ -2847,7 +2629,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; } @@ -2860,9 +2643,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) -> { @@ -2871,11 +2652,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; } @@ -2896,9 +2676,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 = @@ -2913,7 +2691,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; } @@ -2934,9 +2713,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 = @@ -2951,7 +2728,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; } @@ -2971,7 +2749,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); @@ -2980,11 +2758,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()); @@ -3001,7 +2775,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); @@ -3010,9 +2784,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()); @@ -3055,16 +2827,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 = @@ -3078,11 +2848,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; } @@ -3105,7 +2874,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; } @@ -3127,11 +2897,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; } @@ -3178,7 +2947,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); @@ -3187,11 +2956,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()); @@ -3208,7 +2973,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); @@ -3217,7 +2982,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3226,11 +2990,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()); @@ -3242,7 +3002,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); @@ -3251,9 +3011,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 = @@ -3266,10 +3024,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; } @@ -3292,7 +3050,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; } @@ -3312,7 +3071,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); @@ -3321,13 +3080,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()); @@ -3344,7 +3097,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); @@ -3353,19 +3106,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)); } } @@ -3404,24 +3150,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<>( @@ -3432,16 +3171,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; } @@ -3454,24 +3190,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; } @@ -3486,21 +3217,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<>( @@ -3511,19 +3235,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; } @@ -3538,32 +3256,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<>( @@ -3588,10 +3296,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); @@ -3600,9 +3305,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) -> { @@ -3623,10 +3326,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); @@ -3635,9 +3335,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) -> { @@ -3658,12 +3356,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); @@ -3672,9 +3365,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) -> { @@ -3694,8 +3385,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); @@ -3704,9 +3394,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) -> { @@ -3727,10 +3415,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); @@ -3746,7 +3431,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); @@ -3755,7 +3440,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3767,8 +3451,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() {} @@ -3796,38 +3479,31 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringActionHostApi { - void create(@NonNull Long identifier, @NonNull List meteringPointInfos); + void create(@NonNull Long identifier, @NonNull List meteringPointInfos, @Nullable Boolean disableAutoCancel); /** The codec used by 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); + Boolean disableAutoCancelArg = (Boolean) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - meteringPointInfosArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg, disableAutoCancelArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3842,25 +3518,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) -> { @@ -3868,11 +3538,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; } @@ -3892,7 +3561,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); @@ -3901,13 +3570,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)); @@ -3916,26 +3582,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, - @NonNull Long cameraInfoId); + void create(@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size, @NonNull Long cameraInfoId); - @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<>( @@ -3951,14 +3608,10 @@ static void setup( Double sizeArg = (Double) args.get(3); Number cameraInfoIdArg = (Number) args.get(4); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - xArg, - yArg, - sizeArg, - (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg, (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3971,9 +3624,7 @@ static void setup( { 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) -> { @@ -3981,7 +3632,8 @@ static void setup( try { Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3995,8 +3647,7 @@ static void setup( } private static class CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { - public static final CaptureRequestOptionsHostApiCodec INSTANCE = - new CaptureRequestOptionsHostApiCodec(); + public static final CaptureRequestOptionsHostApiCodec INSTANCE = new CaptureRequestOptionsHostApiCodec(); private CaptureRequestOptionsHostApiCodec() {} @@ -4060,18 +3711,12 @@ 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) -> { @@ -4080,10 +3725,10 @@ static void setup( 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; } @@ -4100,27 +3745,18 @@ 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) -> { @@ -4129,13 +3765,10 @@ static void setup( 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; } @@ -4148,9 +3781,7 @@ static void setup( { 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) -> { @@ -4171,12 +3802,7 @@ 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/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 869fb2b0197f..3d4e53c7694b 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 @@ -484,11 +484,22 @@ class AndroidCameraCameraX extends CameraPlatform { Future setFocusMode(int cameraId, FocusMode mode) async { switch (mode) { case FocusMode.auto: - // CameraX defaults to auto mode, so simply ensure that the autofocus - // trigger is not idle, as set by previously setting FocusMode.locked. - // TODO(camsim99): Clear af trigger. + // CameraX defaults to auto mode, so simply ensure that focus points + // are cancelable? + // TODO(camsim99): If no AF point specified, we are good + // TODO(camsim99): If AF point specified, resubmit same action with auto-canceled enabled break; case FocusMode.locked: + // TODO(camsim99): if AF point specified, lock it + handle exposure mode accordingly + // TODO(camsim99): if AF point not specified, set 0.5f, 0.5f + lock it + handle exposure mode accordingly + if (currentFocusMeteringAction != null) { + final bool focusPointSpecified = currentFocusMeteringAction! + .meteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 != FocusMeteringAction.flagAf) + .toList() + .isNotEmpty; + } // this will construct an action with a MeteringRectangle that represents the whole FoV. final MeteringPoint point = MeteringPoint(x: 0.5, y: 0.5, size: 1, cameraInfo: cameraInfo!); 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 14239dd01b69..44ea1664be07 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,7 +281,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', @@ -337,8 +338,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, @@ -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,8 +485,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, @@ -496,7 +495,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, @@ -523,8 +522,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', @@ -541,13 +540,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', @@ -575,8 +573,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, @@ -586,7 +583,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, @@ -614,7 +611,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', @@ -638,8 +636,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?; @@ -664,17 +661,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', @@ -701,8 +693,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', @@ -728,8 +719,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', @@ -774,8 +765,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, @@ -785,7 +775,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, @@ -878,7 +868,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, @@ -906,7 +896,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); @@ -924,11 +914,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?; @@ -981,8 +969,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, @@ -992,7 +979,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, @@ -1015,15 +1002,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', @@ -1042,10 +1026,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', @@ -1064,10 +1048,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', @@ -1095,19 +1079,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, @@ -1135,7 +1117,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); @@ -1153,14 +1135,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', @@ -1208,7 +1188,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', @@ -1256,8 +1237,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', @@ -1343,8 +1324,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', @@ -1367,8 +1348,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, @@ -1378,7 +1358,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, @@ -1401,17 +1381,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', @@ -1457,8 +1432,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?; @@ -1487,8 +1461,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', @@ -1516,8 +1490,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, @@ -1527,7 +1500,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, @@ -1585,8 +1558,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, @@ -1596,7 +1568,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, @@ -1713,8 +1685,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, @@ -1724,7 +1695,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, @@ -1747,17 +1718,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', @@ -1778,8 +1744,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', @@ -1827,8 +1793,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', @@ -1861,7 +1827,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); @@ -1879,14 +1845,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', @@ -1914,16 +1878,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', @@ -1951,16 +1911,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', @@ -1993,7 +1949,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); @@ -2006,8 +1962,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, @@ -2017,13 +1972,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?); @@ -2050,7 +2004,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); @@ -2061,13 +2015,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, @@ -2077,20 +2027,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; }); } @@ -2103,8 +2051,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, @@ -2114,7 +2061,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, @@ -2143,16 +2090,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', @@ -2169,14 +2112,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', @@ -2219,8 +2160,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', @@ -2309,8 +2250,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, @@ -2320,7 +2260,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, @@ -2341,8 +2281,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, @@ -2352,7 +2291,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, @@ -2383,7 +2322,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); @@ -2406,8 +2345,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', @@ -2446,13 +2384,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', @@ -2485,7 +2422,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); @@ -2498,8 +2435,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, @@ -2509,13 +2445,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!); @@ -2533,8 +2468,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, @@ -2544,7 +2478,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, @@ -2563,7 +2497,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, @@ -2644,8 +2578,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, @@ -2655,7 +2588,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, @@ -2682,8 +2615,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, @@ -2693,7 +2625,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, @@ -2707,8 +2639,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; }); } @@ -2734,9 +2665,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); @@ -2754,18 +2685,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', @@ -2782,13 +2707,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', @@ -2821,16 +2745,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', @@ -2862,8 +2782,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', @@ -2884,8 +2804,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', @@ -2902,14 +2822,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', @@ -2948,14 +2866,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', @@ -2978,8 +2894,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, @@ -2989,7 +2904,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, @@ -3017,7 +2932,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); @@ -3035,14 +2950,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, bool? arg_disableAutoCancel) 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, arg_disableAutoCancel]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3072,8 +2985,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?; @@ -3104,8 +3016,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, @@ -3115,7 +3026,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, @@ -3138,14 +3049,12 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, - double? arg_size, int arg_cameraInfoId) 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, arg_cameraInfoId]) - 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', @@ -3166,7 +3075,8 @@ 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', @@ -3222,19 +3132,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); @@ -3250,16 +3160,14 @@ 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', @@ -3287,14 +3195,12 @@ 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', @@ -3311,15 +3217,12 @@ 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/lib/src/focus_metering_action.dart b/packages/camera/camera_android_camerax/lib/src/focus_metering_action.dart index fe09ebc0443e..81fa6f5abf14 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 @@ -20,13 +20,14 @@ class FocusMeteringAction extends JavaObject { BinaryMessenger? binaryMessenger, InstanceManager? instanceManager, required this.meteringPointInfos, + this.disableAutoCancel, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, ) { _api = _FocusMeteringActionHostApiImpl( binaryMessenger: binaryMessenger, instanceManager: instanceManager); - _api.createFromInstance(this, meteringPointInfos); + _api.createFromInstance(this, meteringPointInfos, disableAutoCancel); } /// Creates a [FocusMeteringAction] that is not automatically attached to a @@ -35,6 +36,7 @@ class FocusMeteringAction extends JavaObject { BinaryMessenger? binaryMessenger, InstanceManager? instanceManager, required this.meteringPointInfos, + this.disableAutoCancel, }) : super.detached( binaryMessenger: binaryMessenger, instanceManager: instanceManager, @@ -50,6 +52,12 @@ class FocusMeteringAction extends JavaObject { final List<(MeteringPoint meteringPoint, int? meteringMode)> meteringPointInfos; + /// Disables the auto-cancel. + /// + /// By default (and if set to false), auto-cancel is enabled with 5 seconds + /// duration. + final bool? disableAutoCancel; + /// Flag for metering mode that indicates the auto focus region is enabled. /// /// An autofocus scan is also triggered when [flagAf] is assigned. @@ -97,8 +105,8 @@ class _FocusMeteringActionHostApiImpl extends FocusMeteringActionHostApi { /// [MeteringPoint]s and their modes in order of descending priority. void createFromInstance( FocusMeteringAction instance, - List<(MeteringPoint meteringPoint, int? meteringMode)> - meteringPointInfos) { + List<(MeteringPoint meteringPoint, int? meteringMode)> meteringPointInfos, + bool? disableAutoCancel) { final int identifier = instanceManager.addDartCreatedInstance(instance, onCopy: (FocusMeteringAction original) { return FocusMeteringAction.detached( @@ -118,6 +126,6 @@ class _FocusMeteringActionHostApiImpl extends FocusMeteringActionHostApi { meteringMode: meteringPointInfo.$2)); } - create(identifier, meteringPointInfosWithIds); + create(identifier, meteringPointInfosWithIds, disableAutoCancel); } } diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index fc78cae75d24..103c260c25c1 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -501,7 +501,8 @@ abstract class CameraControlFlutterApi { @HostApi(dartHostTestHandler: 'TestFocusMeteringActionHostApi') abstract class FocusMeteringActionHostApi { - void create(int identifier, List meteringPointInfos); + void create(int identifier, List meteringPointInfos, + bool? disableAutoCancel); } @HostApi(dartHostTestHandler: 'TestFocusMeteringResultHostApi') 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 c847327cce59..9ddbff7249a1 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,8 +1625,7 @@ 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); @@ -1904,21 +1638,17 @@ 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, @@ -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,37 +1773,31 @@ 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); + void create(int identifier, List meteringPointInfos, bool? disableAutoCancel); - 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!); + final bool? arg_disableAutoCancel = (args[2] as bool?); + api.create(arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); return []; }); } @@ -2099,28 +1806,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,30 +1835,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, int cameraInfoId); + void create(int identifier, double x, double y, double? size, int cameraInfoId); 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, @@ -2172,8 +1867,7 @@ abstract class TestMeteringPointHostApi { 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!); + api.create(arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); return []; }); } @@ -2183,12 +1877,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]; @@ -2231,19 +1922,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); @@ -2252,34 +1943,27 @@ 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!); @@ -2291,30 +1975,24 @@ 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, @@ -2329,18 +2007,14 @@ 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, @@ -2348,8 +2022,7 @@ 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 d4d15883dd31ef994d1e4c36424e064375b0a7bd Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 21 Feb 2024 15:48:18 -0800 Subject: [PATCH 07/27] Formatting --- .../FocusMeteringActionHostApiImpl.java | 8 +- .../camerax/GeneratedCameraXLibrary.java | 1165 +++++++++++------ .../lib/src/camerax_library.g.dart | 455 ++++--- .../test/test_camerax_library.g.dart | 1004 +++++++++----- 4 files changed, 1723 insertions(+), 909 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java index 1a7d51b94527..4bd5cdbffc20 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java @@ -29,7 +29,9 @@ public class FocusMeteringActionHostApiImpl implements FocusMeteringActionHostAp public static class FocusMeteringActionProxy { /** Creates an instance of {@link FocusMeteringAction}. */ public @NonNull FocusMeteringAction create( - @NonNull List meteringPoints, @NonNull List meteringPointModes, @Nullable Boolean disableAutoCancel) { + @NonNull List meteringPoints, + @NonNull List meteringPointModes, + @Nullable Boolean disableAutoCancel) { if (meteringPoints.size() >= 1 && meteringPoints.size() != meteringPointModes.size()) { throw new IllegalArgumentException( "One metering point must be specified and the number of specified metering points must match the number of specified metering point modes."); @@ -104,7 +106,9 @@ public FocusMeteringActionHostApiImpl(@NonNull InstanceManager instanceManager) @Override public void create( - @NonNull Long identifier, @NonNull List meteringPointInfos, @Nullable Boolean disableAutoCancel) { + @NonNull Long identifier, + @NonNull List meteringPointInfos, + @Nullable Boolean disableAutoCancel) { final List meteringPoints = new ArrayList(); final List meteringPointModes = new ArrayList(); for (MeteringPointInfo meteringPointInfo : meteringPointInfos) { 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 e34019800cf4..75b4a8c276bc 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 `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. + *

* 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. * - * 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 `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. + *

* 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: + *

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() {} @@ -3479,31 +3796,43 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringActionHostApi { - void create(@NonNull Long identifier, @NonNull List meteringPointInfos, @Nullable Boolean disableAutoCancel); + void create( + @NonNull Long identifier, + @NonNull List meteringPointInfos, + @Nullable Boolean disableAutoCancel); /** The codec used by 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); Boolean disableAutoCancelArg = (Boolean) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg, disableAutoCancelArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + meteringPointInfosArg, + disableAutoCancelArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3518,19 +3847,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) -> { @@ -3538,10 +3873,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; } @@ -3561,7 +3897,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); @@ -3570,10 +3906,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)); @@ -3582,17 +3921,26 @@ 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, @NonNull Long cameraInfoId); + void create( + @NonNull Long identifier, + @NonNull Double x, + @NonNull Double y, + @Nullable Double size, + @NonNull Long cameraInfoId); - @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<>( @@ -3608,10 +3956,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo Double sizeArg = (Double) args.get(3); Number cameraInfoIdArg = (Number) args.get(4); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg, (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + xArg, + yArg, + sizeArg, + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3624,7 +3976,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) -> { @@ -3632,8 +3986,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; } @@ -3647,7 +4000,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() {} @@ -3711,12 +4065,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) -> { @@ -3725,10 +4085,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; } @@ -3745,18 +4105,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) -> { @@ -3765,10 +4134,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; } @@ -3781,7 +4153,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) -> { @@ -3802,7 +4176,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/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index 44ea1664be07..78c167bc4a11 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,18 @@ class FocusMeteringActionHostApi { static const MessageCodec codec = _FocusMeteringActionHostApiCodec(); - Future create(int arg_identifier, List arg_meteringPointInfos, bool? arg_disableAutoCancel) async { + Future create( + int arg_identifier, + List arg_meteringPointInfos, + bool? arg_disableAutoCancel) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_meteringPointInfos, arg_disableAutoCancel]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_meteringPointInfos, + arg_disableAutoCancel + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2985,7 +3076,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 +3108,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 +3119,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 +3142,14 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size, int arg_cameraInfoId) 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, arg_cameraInfoId]) 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', @@ -3075,8 +3170,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 +3226,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 +3254,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 +3291,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 +3315,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 9ddbff7249a1..b69825928dd9 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,31 +2060,40 @@ 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, bool? disableAutoCancel); + void create(int identifier, List meteringPointInfos, + bool? disableAutoCancel); - 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.'); final bool? arg_disableAutoCancel = (args[2] as bool?); - api.create(arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); + api.create( + arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); return []; }); } @@ -1806,22 +2102,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, @@ -1835,24 +2137,30 @@ 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, int cameraInfoId); + void create( + int identifier, double x, double y, double? size, int cameraInfoId); 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, @@ -1867,7 +2175,8 @@ abstract class TestMeteringPointHostApi { 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!); + api.create( + arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); return []; }); } @@ -1877,9 +2186,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]; @@ -1922,19 +2234,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); @@ -1943,27 +2255,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!); @@ -1975,24 +2294,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, @@ -2007,14 +2332,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, @@ -2022,7 +2351,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 dd4f6b3f18b06ff23ede2bff00313d3ea32e68a9 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 22 Feb 2024 14:22:06 -0800 Subject: [PATCH 08/27] Add case logic --- .../camera/camera_android_camerax/README.md | 4 - .../camerax/CameraAndroidCameraxPlugin.java | 11 ++ .../CaptureRequestOptionsHostApiImpl.java | 4 +- .../FocusMeteringActionHostApiImpl.java | 5 +- .../example/lib/main.dart | 12 +- .../lib/src/android_camera_camerax.dart | 136 +++++++++++++----- .../lib/src/camerax_proxy.dart | 41 +++++- .../test/android_camera_camerax_test.dart | 11 +- .../focus_metering_action_test.mocks.dart | 2 + 9 files changed, 170 insertions(+), 56 deletions(-) diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index 48674de44cf8..807281ee078b 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -34,10 +34,6 @@ and thus, the plugin will fall back to 480p if configured with a `setExposureMode`is unimplemented. -### Focus mode configuration \[[Issue #120467][120467]\] - -`setFocusMode` is unimplemented. - ### Setting maximum duration and stream options for video capture Calling `startVideoCapturing` with `VideoCaptureOptions` configured with 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 ea9f3ed4d06c..23800430c3cc 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 @@ -37,6 +37,9 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting public @Nullable LiveDataHostApiImpl liveDataHostApiImpl; + @VisibleForTesting @Nullable + public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl; + /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. * @@ -126,6 +129,11 @@ public void setUp( binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); meteringPointHostApiImpl = new MeteringPointHostApiImpl(instanceManager); GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, meteringPointHostApiImpl); + camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context); + GeneratedCameraXLibrary.Camera2CameraControlHostApi.setup( + binaryMessenger, camera2CameraControlHostApiImpl); + GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup( + binaryMessenger, new CaptureRequestOptionsHostApiImpl(instanceManager)); } @Override @@ -217,6 +225,9 @@ public void updateContext(@NonNull Context context) { if (cameraControlHostApiImpl != null) { cameraControlHostApiImpl.setContext(context); } + if (camera2CameraControlHostApiImpl != null) { + camera2CameraControlHostApiImpl.setContext(context); + } } /** Sets {@code LifecycleOwner} that is used to control the lifecycle of the camera by CameraX. */ diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java index 6f8d8c91dda6..f76dd5422e72 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CaptureRequestOptionsHostApiImpl.java @@ -110,8 +110,8 @@ public void create(@NonNull Long identifier, @NonNull Map options) Map decodedOptions = new HashMap(); for (Map.Entry option : options.entrySet()) { - decodedOptions.put( - CaptureRequestKeySupportedType.values()[option.getKey().intValue()], option.getValue()); + Integer index = ((Number) option.getKey()).intValue(); + decodedOptions.put(CaptureRequestKeySupportedType.values()[index], option.getValue()); } instanceManager.addDartCreatedInstance(proxy.create(decodedOptions), identifier); } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java index 4bd5cdbffc20..dcda333c2e90 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java @@ -5,6 +5,7 @@ package io.flutter.plugins.camerax; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.camera.core.FocusMeteringAction; import androidx.camera.core.MeteringPoint; @@ -61,7 +62,7 @@ public static class FocusMeteringActionProxy { } } - if (disableAutoCancel == true) { + if (disableAutoCancel != null && disableAutoCancel == true) { focusMeteringActionBuilder.disableAutoCancel(); } @@ -118,6 +119,6 @@ public void create( } instanceManager.addDartCreatedInstance( - proxy.create(meteringPoints, meteringPointModes), identifier, disableAutoCancel); + proxy.create(meteringPoints, meteringPointModes, disableAutoCancel), identifier); } } diff --git a/packages/camera/camera_android_camerax/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index c57ca6491dc5..22221fd1de96 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -393,8 +393,10 @@ class _CameraExampleHomeState extends State children: [ TextButton( style: styleAuto, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => + onSetExposureModeButtonPressed(ExposureMode.auto) + : null, onLongPress: () { if (controller != null) { CameraPlatform.instance @@ -406,8 +408,10 @@ class _CameraExampleHomeState extends State ), TextButton( style: styleLocked, - onPressed: - () {}, // TODO(camsim99): Add functionality back here. + onPressed: controller != null + ? () => + onSetExposureModeButtonPressed(ExposureMode.locked) + : null, child: const Text('LOCKED'), ), 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 3d4e53c7694b..475a65c36433 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 @@ -14,12 +14,14 @@ import 'package:stream_transform/stream_transform.dart'; import 'analyzer.dart'; import 'camera.dart'; +import 'camera2_camera_control.dart'; import 'camera_control.dart'; import 'camera_info.dart'; import 'camera_selector.dart'; import 'camera_state.dart'; import 'camerax_library.g.dart'; import 'camerax_proxy.dart'; +import 'capture_request_options.dart'; import 'device_orientation_manager.dart'; import 'exposure_state.dart'; import 'fallback_strategy.dart'; @@ -192,6 +194,15 @@ class AndroidCameraCameraX extends CameraPlatform { @visibleForTesting FocusMeteringAction? currentFocusMeteringAction; + /// Current focus mode. + /// + /// CameraX defaults to autofocus. + FocusMode currentFocusMode = FocusMode.auto; + + /// Whether or not a default focus point of the dentire sensor area was added + /// to lock focus. + bool defaultFocusPointAdded = false; + /// Error code indicating that exposure compensation is not supported by /// CameraX for the device. static const String exposureCompensationNotSupported = @@ -455,8 +466,10 @@ class AndroidCameraCameraX extends CameraPlatform { /// [cameraId] is not used. @override Future setExposurePoint(int cameraId, Point? point) async { - await _startFocusAndMeteringFor( - point: point, meteringMode: FocusMeteringAction.flagAe); + await _startFocusAndMeteringForPoint( + point: point, + meteringMode: FocusMeteringAction.flagAe, + disableAutoCancel: currentFocusMode == FocusMode.locked); } /// Gets the minimum supported exposure offset for the selected camera in EV units. @@ -482,34 +495,73 @@ class AndroidCameraCameraX extends CameraPlatform { /// Sets the focus mode for taking pictures. @override Future setFocusMode(int cameraId, FocusMode mode) async { + // TODO(camsim99): deal with exposure mode. switch (mode) { case FocusMode.auto: - // CameraX defaults to auto mode, so simply ensure that focus points - // are cancelable? - // TODO(camsim99): If no AF point specified, we are good - // TODO(camsim99): If AF point specified, resubmit same action with auto-canceled enabled - break; + if (currentFocusMode == FocusMode.auto) { + return; + } + final MeteringPoint? autoAfPoint = defaultFocusPointAdded + ? null + : currentFocusMeteringAction!.meteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 != FocusMeteringAction.flagAf) + .toList() + .first + .$1; + defaultFocusPointAdded = false; + await _startFocusAndMeteringFor( + point: autoAfPoint, meteringMode: FocusMeteringAction.flagAf); case FocusMode.locked: - // TODO(camsim99): if AF point specified, lock it + handle exposure mode accordingly - // TODO(camsim99): if AF point not specified, set 0.5f, 0.5f + lock it + handle exposure mode accordingly + MeteringPoint? lockedAfPoint; if (currentFocusMeteringAction != null) { - final bool focusPointSpecified = currentFocusMeteringAction! - .meteringPointInfos - .where(((MeteringPoint, int?) meteringPointInfo) => - meteringPointInfo.$2 != FocusMeteringAction.flagAf) - .toList() - .isNotEmpty; + final List<(MeteringPoint, int?)> possibleCurrentAfPoints = + currentFocusMeteringAction!.meteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 == FocusMeteringAction.flagAf) + .toList(); + lockedAfPoint = possibleCurrentAfPoints.isEmpty + ? null + : possibleCurrentAfPoints.first.$1; + } + if (lockedAfPoint == null) { + lockedAfPoint = proxy.createMeteringPoint(0.5, 0.5, 1, cameraInfo!); + defaultFocusPointAdded = true; } - // this will construct an action with a MeteringRectangle that represents the whole FoV. - final MeteringPoint point = - MeteringPoint(x: 0.5, y: 0.5, size: 1, cameraInfo: cameraInfo!); - final FocusMeteringAction action = FocusMeteringAction( - meteringPointInfos: <( - MeteringPoint meteringPoint, - int? meteringMode - )>[(point, FocusMeteringAction.flagAf)]); - await cameraControl.startFocusAndMetering(action); + await _startFocusAndMeteringFor( + point: lockedAfPoint, + meteringMode: FocusMeteringAction.flagAf, + disableAutoCancel: true); } + currentFocusMode = mode; + if (currentExposureMode == ExposureMode.auto && + currentFocusMode == ExposureMode.locked || + currentExposureMode == ExposureMode.locked && + currentFocusMode == ExposureMode.auto) { + await setExposureMode(cameraId, currentExposureMode); + } + // setExposureMode(cameraId, mode) + } + + ExposureMode currentExposureMode = ExposureMode.auto; + + /// Sets the exposure mode for taking pictures. + /// + /// [cameraId] is not used. + @override + Future setExposureMode(int cameraId, ExposureMode mode) async { + final Camera2CameraControl camera2Control = + proxy.getCamera2CameraControl(cameraControl); + final bool lockExposureMode = mode == ExposureMode.locked; + + final CaptureRequestOptions captureRequestOptions = proxy + .createCaptureRequestOptions(<( + CaptureRequestKeySupportedType, + Object? + )>[(CaptureRequestKeySupportedType.controlAeLock, lockExposureMode)]); + + await camera2Control.addCaptureRequestOptions(captureRequestOptions); + currentExposureMode = mode; } /// Gets the supported step size for exposure offset for the selected camera in EV units. @@ -577,8 +629,10 @@ class AndroidCameraCameraX extends CameraPlatform { /// [cameraId] is not used. @override Future setFocusPoint(int cameraId, Point? point) async { - await _startFocusAndMeteringFor( - point: point, meteringMode: FocusMeteringAction.flagAf); + await _startFocusAndMeteringForPoint( + point: point, + meteringMode: FocusMeteringAction.flagAf, + disableAutoCancel: currentFocusMode == FocusMode.locked); } /// Gets the maximum supported zoom level for the selected camera. @@ -1101,6 +1155,20 @@ class AndroidCameraCameraX extends CameraPlatform { // Methods for configuring auto-focus and auto-exposure: + Future _startFocusAndMeteringForPoint( + {required Point? point, + required int meteringMode, + bool disableAutoCancel = false}) async { + await _startFocusAndMeteringFor( + point: point == null + ? null + : proxy.createMeteringPoint( + point.x, point.y, /* size */ null, cameraInfo!), + meteringMode: meteringMode, + disableAutoCancel: disableAutoCancel); + } + + // TODO(camsim99): Clarify behavior when there is no current action. /// Starts a focus and metering action. /// /// This method will modify and start the current action's metering points @@ -1120,7 +1188,9 @@ class AndroidCameraCameraX extends CameraPlatform { /// points, then the previously enabled focus and metering actions will be /// canceled. Future _startFocusAndMeteringFor( - {required Point? point, required int meteringMode}) async { + {required MeteringPoint? point, + required int meteringMode, + bool disableAutoCancel = false}) async { if (point == null) { // Try to clear any metering point from previous action with the specified // meteringMode. @@ -1150,8 +1220,8 @@ class AndroidCameraCameraX extends CameraPlatform { currentFocusMeteringAction = null; return; } - currentFocusMeteringAction = - proxy.createFocusMeteringAction(newMeteringPointInfos); + currentFocusMeteringAction = proxy.createFocusMeteringAction( + newMeteringPointInfos, disableAutoCancel); } 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.'); @@ -1172,11 +1242,9 @@ class AndroidCameraCameraX extends CameraPlatform { meteringPointInfo.$2 != meteringMode) .toList(); } - final MeteringPoint newMeteringPoint = - proxy.createMeteringPoint(point.x, point.y, cameraInfo!); - newMeteringPointInfos.add((newMeteringPoint, meteringMode)); - currentFocusMeteringAction = - proxy.createFocusMeteringAction(newMeteringPointInfos); + newMeteringPointInfos.add((point, meteringMode)); + currentFocusMeteringAction = proxy.createFocusMeteringAction( + newMeteringPointInfos, disableAutoCancel); } await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); 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 072a753d8b40..415d5918914d 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart @@ -5,10 +5,13 @@ import 'dart:ui' show Size; import 'analyzer.dart'; +import 'camera2_camera_control.dart'; +import 'camera_control.dart'; import 'camera_info.dart'; import 'camera_selector.dart'; import 'camera_state.dart'; import 'camerax_library.g.dart'; +import 'capture_request_options.dart'; import 'device_orientation_manager.dart'; import 'fallback_strategy.dart'; import 'focus_metering_action.dart'; @@ -54,6 +57,8 @@ class CameraXProxy { this.getDefaultDisplayRotation = _getDefaultDisplayRotation, this.createMeteringPoint = _createMeteringPoint, this.createFocusMeteringAction = _createFocusMeteringAction, + this.getCamera2CameraControl = _getCamera2CameraControl, + this.createCaptureRequestOptions = _createCaptureRequestOptions, }); /// Returns a [ProcessCameraProvider] instance. @@ -144,13 +149,23 @@ class CameraXProxy { /// Returns a [MeteringPoint] with the specified coordinates based on /// [cameraInfo]. - MeteringPoint Function(double x, double y, CameraInfo cameraInfo) + MeteringPoint Function( + double x, double y, double? size, CameraInfo cameraInfo) createMeteringPoint; /// Returns a [FocusMeteringAction] based on the specified metering points /// and their modes. - FocusMeteringAction Function(List<(MeteringPoint, int?)> meteringPointInfos) - createFocusMeteringAction; + FocusMeteringAction Function(List<(MeteringPoint, int?)> meteringPointInfos, + bool? disableAutoCancel) createFocusMeteringAction; + + /// Get [Camera2CameraControl] instance from [cameraControl]. + Camera2CameraControl Function(CameraControl cameraControl) + getCamera2CameraControl; + + /// Create [CapureRequestOptions] with specified options. + CaptureRequestOptions Function( + List<(CaptureRequestKeySupportedType, Object?)> options) + createCaptureRequestOptions; static Future _getProcessCameraProvider() { return ProcessCameraProvider.getInstance(); @@ -256,12 +271,24 @@ class CameraXProxy { } static MeteringPoint _createMeteringPoint( - double x, double y, CameraInfo cameraInfo) { - return MeteringPoint(x: x, y: y, cameraInfo: cameraInfo); + double x, double y, double? size, CameraInfo cameraInfo) { + return MeteringPoint(x: x, y: y, size: size, cameraInfo: cameraInfo); } static FocusMeteringAction _createFocusMeteringAction( - List<(MeteringPoint, int?)> meteringPointInfos) { - return FocusMeteringAction(meteringPointInfos: meteringPointInfos); + List<(MeteringPoint, int?)> meteringPointInfos, bool? disableAutoCancel) { + return FocusMeteringAction( + meteringPointInfos: meteringPointInfos, + disableAutoCancel: disableAutoCancel); + } + + static Camera2CameraControl _getCamera2CameraControl( + CameraControl cameraControl) { + return Camera2CameraControl(cameraControl: cameraControl); + } + + static CaptureRequestOptions _createCaptureRequestOptions( + List<(CaptureRequestKeySupportedType, Object?)> options) { + return CaptureRequestOptions(requestedOptions: options); } } 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 0868916f3bf3..5dd7d9265000 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 @@ -124,9 +124,12 @@ void main() { CameraXProxy getProxyForExposureAndFocus() => CameraXProxy( createMeteringPoint: (double x, double y, CameraInfo cameraInfo) => MeteringPoint.detached(x: x, y: y, cameraInfo: cameraInfo), - createFocusMeteringAction: (List<(MeteringPoint, int?)> - meteringPointInfos) => - FocusMeteringAction.detached(meteringPointInfos: meteringPointInfos)); + createFocusMeteringAction: + (List<(MeteringPoint, int?)> meteringPointInfos, + bool? disableAutoCancel) => + FocusMeteringAction.detached( + meteringPointInfos: meteringPointInfos, + disableAutoCancel: disableAutoCancel)); test('Should fetch CameraDescription instances for available cameras', () async { @@ -2087,6 +2090,7 @@ void main() { // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); camera.proxy = getProxyForExposureAndFocus(); @@ -2349,6 +2353,7 @@ void main() { // Set directly for test versus calling createCamera. camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); camera.proxy = getProxyForExposureAndFocus(); 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 d1ceef9daadd..3b0e4c824076 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 @@ -77,6 +77,7 @@ class MockTestFocusMeteringActionHostApi extends _i1.Mock void create( int? identifier, List<_i5.MeteringPointInfo?>? meteringPointInfos, + bool? disableAutoCancel, ) => super.noSuchMethod( Invocation.method( @@ -84,6 +85,7 @@ class MockTestFocusMeteringActionHostApi extends _i1.Mock [ identifier, meteringPointInfos, + disableAutoCancel, ], ), returnValueForMissingStub: null, From b902c048cb729a896e2e39829d7bedc3bd44b1d0 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 22 Feb 2024 14:22:56 -0800 Subject: [PATCH 09/27] Add todo for AWB --- .../camera_android_camerax/lib/src/android_camera_camerax.dart | 1 + 1 file changed, 1 insertion(+) 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 475a65c36433..f57f88e6a120 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 @@ -1169,6 +1169,7 @@ class AndroidCameraCameraX extends CameraPlatform { } // TODO(camsim99): Clarify behavior when there is no current action. + // TODO(camsim99): Throw exception for AWB because I'm not handling this at all. /// Starts a focus and metering action. /// /// This method will modify and start the current action's metering points From 72d2d5f5916c4ad9efb4b26cd03965ce84a2d203 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 26 Feb 2024 11:15:57 -0800 Subject: [PATCH 10/27] Manual testing --- .../lib/src/android_camera_camerax.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 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 f07d3122579a..797bef37c649 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 @@ -196,9 +196,14 @@ class AndroidCameraCameraX extends CameraPlatform { /// Current focus mode. /// - /// CameraX defaults to autofocus. + /// CameraX defaults to auto-focus mode. FocusMode currentFocusMode = FocusMode.auto; + /// Current exposure mode. + /// + /// CameraX defaults to auto-exposure mode. + ExposureMode currentExposureMode = ExposureMode.auto; + /// Whether or not a default focus point of the dentire sensor area was added /// to lock focus. bool defaultFocusPointAdded = false; @@ -492,7 +497,6 @@ class AndroidCameraCameraX extends CameraPlatform { /// Sets the focus mode for taking pictures. @override Future setFocusMode(int cameraId, FocusMode mode) async { - // TODO(camsim99): deal with exposure mode. switch (mode) { case FocusMode.auto: if (currentFocusMode == FocusMode.auto) { @@ -532,16 +536,11 @@ class AndroidCameraCameraX extends CameraPlatform { } currentFocusMode = mode; if (currentExposureMode == ExposureMode.auto && - currentFocusMode == ExposureMode.locked || - currentExposureMode == ExposureMode.locked && - currentFocusMode == ExposureMode.auto) { + currentFocusMode == FocusMode.locked) { await setExposureMode(cameraId, currentExposureMode); } - // setExposureMode(cameraId, mode) } - ExposureMode currentExposureMode = ExposureMode.auto; - /// Sets the exposure mode for taking pictures. /// /// [cameraId] is not used. From 32118bc7a31bf01d99a5671b8185aafbf3759dc4 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 26 Feb 2024 12:05:56 -0800 Subject: [PATCH 11/27] Self review --- .../FocusMeteringActionHostApiImpl.java | 1 + .../lib/src/android_camera_camerax.dart | 71 ++++++++++++++----- .../lib/src/camerax_proxy.dart | 16 ++--- 3 files changed, 62 insertions(+), 26 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java index dcda333c2e90..f26159ec47c8 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java @@ -62,6 +62,7 @@ public static class FocusMeteringActionProxy { } } + // Disable auto-cancel if specified. if (disableAutoCancel != null && disableAutoCancel == true) { focusMeteringActionBuilder.disableAutoCancel(); } 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 797bef37c649..15d392137aae 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 @@ -194,19 +194,23 @@ class AndroidCameraCameraX extends CameraPlatform { @visibleForTesting FocusMeteringAction? currentFocusMeteringAction; - /// Current focus mode. + /// Current focus mode set via [setFocusMode]. /// /// CameraX defaults to auto-focus mode. FocusMode currentFocusMode = FocusMode.auto; - /// Current exposure mode. + /// Current exposure mode set via [setExposureMode]. /// /// CameraX defaults to auto-exposure mode. ExposureMode currentExposureMode = ExposureMode.auto; - /// Whether or not a default focus point of the dentire sensor area was added - /// to lock focus. - bool defaultFocusPointAdded = false; + /// Whether or not a default focus point of the entire sensor area was focused + /// and locked. + /// + /// This should only be true if [setExposureMode] was called to set + /// [FocusMode.locked] and no previous focus point was set via + /// [setFocusPoint]. + bool defaultFocusPointLocked = false; /// Error code indicating that exposure compensation is not supported by /// CameraX for the device. @@ -468,10 +472,16 @@ class AndroidCameraCameraX extends CameraPlatform { /// [cameraId] is not used. @override Future setExposurePoint(int cameraId, Point? point) async { + // We lock the new focus and metering action if focus mode has been locked + // to ensure that the current focus point remains locked. Any exposure mode + // setting will not be impacted by this lock (setting an exposure mode + // is implemented with Camera2 interop that will override any settings + // to achieve the expected exposure mode as needed). + final bool disableAutoCancel = currentFocusMode == FocusMode.locked; await _startFocusAndMeteringForPoint( point: point, meteringMode: FocusMeteringAction.flagAe, - disableAutoCancel: currentFocusMode == FocusMode.locked); + disableAutoCancel: disableAutoCancel); } /// Gets the minimum supported exposure offset for the selected camera in EV units. @@ -495,14 +505,24 @@ class AndroidCameraCameraX extends CameraPlatform { } /// Sets the focus mode for taking pictures. + /// + /// Setting [FocusMode.locked] will lock current focus point if one exists or + /// center of entire sensor area if not and will stay locked until either: + /// * Another focus point is set via [setFocusPoint], or + /// * Locked focus mode is unset by setting [FocusMode.auto]. @override Future setFocusMode(int cameraId, FocusMode mode) async { switch (mode) { case FocusMode.auto: if (currentFocusMode == FocusMode.auto) { + // CameraX uses auto-focus mode by default, so no need to reconfigure + // auto-focus if already set. return; } - final MeteringPoint? autoAfPoint = defaultFocusPointAdded + + // Determine auto-focus point to restore, if any. We do not restore + // default auto-focus point if set previously to lock focus. + final MeteringPoint? autoAfPoint = defaultFocusPointLocked ? null : currentFocusMeteringAction!.meteringPointInfos .where(((MeteringPoint, int?) meteringPointInfo) => @@ -510,11 +530,14 @@ class AndroidCameraCameraX extends CameraPlatform { .toList() .first .$1; - defaultFocusPointAdded = false; + defaultFocusPointLocked = false; + await _startFocusAndMeteringFor( point: autoAfPoint, meteringMode: FocusMeteringAction.flagAf); case FocusMode.locked: MeteringPoint? lockedAfPoint; + + // Determine if there is an auto-focus point set currently to lock. if (currentFocusMeteringAction != null) { final List<(MeteringPoint, int?)> possibleCurrentAfPoints = currentFocusMeteringAction!.meteringPointInfos @@ -525,16 +548,24 @@ class AndroidCameraCameraX extends CameraPlatform { ? null : possibleCurrentAfPoints.first.$1; } + + // If there isn't, lock center of entire sensor area by default. if (lockedAfPoint == null) { lockedAfPoint = proxy.createMeteringPoint(0.5, 0.5, 1, cameraInfo!); - defaultFocusPointAdded = true; + defaultFocusPointLocked = true; } + await _startFocusAndMeteringFor( point: lockedAfPoint, meteringMode: FocusMeteringAction.flagAf, disableAutoCancel: true); } + // Update current focus mode. currentFocusMode = mode; + + // If focus mode was just locked and exposure mode is not, unlock exposure + // mode to ensure that disabling auto-cancel does not interfere with + // automatic exposure metering. if (currentExposureMode == ExposureMode.auto && currentFocusMode == FocusMode.locked) { await setExposureMode(cameraId, currentExposureMode); @@ -625,6 +656,11 @@ class AndroidCameraCameraX extends CameraPlatform { /// [cameraId] is not used. @override Future setFocusPoint(int cameraId, Point? point) async { + // We lock the new focus and metering action if focus mode has been locked + // to ensure that the current focus point remains locked. Any exposure mode + // setting will not be impacted by this lock (setting an exposure mode + // is implemented with Camera2 interop that will override any settings + // to achieve the expected exposure mode as needed). await _startFocusAndMeteringForPoint( point: point, meteringMode: FocusMeteringAction.flagAf, @@ -1164,26 +1200,25 @@ class AndroidCameraCameraX extends CameraPlatform { disableAutoCancel: disableAutoCancel); } - // TODO(camsim99): Clarify behavior when there is no current action. - // TODO(camsim99): Throw exception for AWB because I'm not handling this at all. /// Starts a focus and metering action. /// /// 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. + /// only, with all other points of other modes left untouched. If no current + /// action exists, only the specified [point] will be set. Thus, the focus + /// and metering action started will only contain at most the one most + /// recently set point for each metering mode: AF, AE, AWB. /// /// 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 - /// [point] and + /// [point] (if [currentFocusMeteringAction] is non-null) 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 [point]. If there are no such metering - /// points, then the previously enabled focus and metering actions will be - /// canceled. + /// share a metering mode with [point] (if [currentFocusMeteringAction] is + /// non-null). If there are no such metering points, then the previously + /// enabled focus and metering actions will be canceled. Future _startFocusAndMeteringFor( {required MeteringPoint? point, required int meteringMode, 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 415d5918914d..976d585a57c8 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart @@ -55,10 +55,10 @@ class CameraXProxy { _startListeningForDeviceOrientationChange, this.setPreviewSurfaceProvider = _setPreviewSurfaceProvider, this.getDefaultDisplayRotation = _getDefaultDisplayRotation, - this.createMeteringPoint = _createMeteringPoint, - this.createFocusMeteringAction = _createFocusMeteringAction, + this.createMeteringPoint = _createAttachedMeteringPoint, + this.createFocusMeteringAction = _createAttachedFocusMeteringAction, this.getCamera2CameraControl = _getCamera2CameraControl, - this.createCaptureRequestOptions = _createCaptureRequestOptions, + this.createCaptureRequestOptions = _createAttachedCaptureRequestOptions, }); /// Returns a [ProcessCameraProvider] instance. @@ -158,11 +158,11 @@ class CameraXProxy { FocusMeteringAction Function(List<(MeteringPoint, int?)> meteringPointInfos, bool? disableAutoCancel) createFocusMeteringAction; - /// Get [Camera2CameraControl] instance from [cameraControl]. + /// Retrieves [Camera2CameraControl] instance from [cameraControl]. Camera2CameraControl Function(CameraControl cameraControl) getCamera2CameraControl; - /// Create [CapureRequestOptions] with specified options. + /// Returns a [CapureRequestOptions] with specified options. CaptureRequestOptions Function( List<(CaptureRequestKeySupportedType, Object?)> options) createCaptureRequestOptions; @@ -270,12 +270,12 @@ class CameraXProxy { return DeviceOrientationManager.getDefaultDisplayRotation(); } - static MeteringPoint _createMeteringPoint( + static MeteringPoint _createAttachedMeteringPoint( double x, double y, double? size, CameraInfo cameraInfo) { return MeteringPoint(x: x, y: y, size: size, cameraInfo: cameraInfo); } - static FocusMeteringAction _createFocusMeteringAction( + static FocusMeteringAction _createAttachedFocusMeteringAction( List<(MeteringPoint, int?)> meteringPointInfos, bool? disableAutoCancel) { return FocusMeteringAction( meteringPointInfos: meteringPointInfos, @@ -287,7 +287,7 @@ class CameraXProxy { return Camera2CameraControl(cameraControl: cameraControl); } - static CaptureRequestOptions _createCaptureRequestOptions( + static CaptureRequestOptions _createAttachedCaptureRequestOptions( List<(CaptureRequestKeySupportedType, Object?)> options) { return CaptureRequestOptions(requestedOptions: options); } From da114abbe6c8e3b1248df82edcd838086d67d56c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 26 Feb 2024 16:59:03 -0800 Subject: [PATCH 12/27] Start adding tests --- .../camera_android_camerax/CHANGELOG.md | 4 + .../camerax/FocusMeteringActionTest.java | 48 +++- .../lib/src/android_camera_camerax.dart | 10 +- .../camera_android_camerax/pubspec.yaml | 2 +- .../test/android_camera_camerax_test.dart | 236 +++++++++++++++++- .../android_camera_camerax_test.mocks.dart | 131 ++++++---- .../test/focus_metering_action_test.dart | 9 +- 7 files changed, 371 insertions(+), 69 deletions(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 5c8002bae00f..42c3a0ab13fe 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.0 + +* Implements `setFocusMode`, reaching feature parity with `camera/camera_android_camerax`. + ## 0.5.0+35 * Modifies `CameraInitializedEvent` that is sent when the camera is initialized to indicate that the initial focus diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java index 64db80541619..d45696655d4b 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java @@ -6,6 +6,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -43,7 +44,7 @@ public void tearDown() { } @Test - public void hostApiCreatecreatesExpectedFocusMeteringActionWithInitialPointThatHasMode() { + public void hostApiCreate_createsExpectedFocusMeteringActionWithInitialPointThatHasMode() { FocusMeteringActionHostApiImpl.FocusMeteringActionProxy proxySpy = spy(new FocusMeteringActionHostApiImpl.FocusMeteringActionProxy()); FocusMeteringActionHostApiImpl hostApi = @@ -89,7 +90,7 @@ public void hostApiCreatecreatesExpectedFocusMeteringActionWithInitialPointThatH List mockMeteringPointInfos = Arrays.asList(fakeMeteringPointInfo1, fakeMeteringPointInfo2, fakeMeteringPointInfo3); - hostApi.create(focusMeteringActionIdentifier, mockMeteringPointInfos); + hostApi.create(focusMeteringActionIdentifier, mockMeteringPointInfos, null); verify(mockFocusMeteringActionBuilder).addPoint(mockMeteringPoint2, mockMeteringPoint2Mode); verify(mockFocusMeteringActionBuilder).addPoint(mockMeteringPoint3); @@ -98,7 +99,7 @@ public void hostApiCreatecreatesExpectedFocusMeteringActionWithInitialPointThatH } @Test - public void hostApiCreatecreatesExpectedFocusMeteringActionWithInitialPointThatDoesNotHaveMode() { + public void hostApiCreate_createsExpectedFocusMeteringActionWithInitialPointThatDoesNotHaveMode() { FocusMeteringActionHostApiImpl.FocusMeteringActionProxy proxySpy = spy(new FocusMeteringActionHostApiImpl.FocusMeteringActionProxy()); FocusMeteringActionHostApiImpl hostApi = @@ -142,11 +143,50 @@ public void hostApiCreatecreatesExpectedFocusMeteringActionWithInitialPointThatD List mockMeteringPointInfos = Arrays.asList(fakeMeteringPointInfo1, fakeMeteringPointInfo2, fakeMeteringPointInfo3); - hostApi.create(focusMeteringActionIdentifier, mockMeteringPointInfos); + hostApi.create(focusMeteringActionIdentifier, mockMeteringPointInfos, null); verify(mockFocusMeteringActionBuilder).addPoint(mockMeteringPoint2, mockMeteringPoint2Mode); verify(mockFocusMeteringActionBuilder).addPoint(mockMeteringPoint3); assertEquals( testInstanceManager.getInstance(focusMeteringActionIdentifier), focusMeteringAction); } + + @Test + public void hostApiCreate_disablesAutoCancelAsExpected() { + FocusMeteringActionHostApiImpl.FocusMeteringActionProxy proxySpy = + spy(new FocusMeteringActionHostApiImpl.FocusMeteringActionProxy()); + FocusMeteringActionHostApiImpl hostApi = + new FocusMeteringActionHostApiImpl(testInstanceManager, proxySpy); + + FocusMeteringAction.Builder mockFocusMeteringActionBuilder = + mock(FocusMeteringAction.Builder.class); + final MeteringPoint mockMeteringPoint = mock(MeteringPoint.class); + final Long mockMeteringPointId = 47L; + + MeteringPointInfo fakeMeteringPointInfo = + new MeteringPointInfo.Builder() + .setMeteringPointId(mockMeteringPointId) + .setMeteringMode(null) + .build(); + + testInstanceManager.addDartCreatedInstance(mockMeteringPoint, mockMeteringPointId); + + when(proxySpy.getFocusMeteringActionBuilder(mockMeteringPoint)) + .thenReturn(mockFocusMeteringActionBuilder); + when(mockFocusMeteringActionBuilder.build()).thenReturn(focusMeteringAction); + + List mockMeteringPointInfos = + Arrays.asList(fakeMeteringPointInfo); + + // Test not disabling auto cancel. + hostApi.create(73L, mockMeteringPointInfos, /* disableAutoCancel */ null); + verify(mockFocusMeteringActionBuilder, never()).disableAutoCancel(); + + hostApi.create(74L, mockMeteringPointInfos, /* disableAutoCancel */ false); + verify(mockFocusMeteringActionBuilder, never()).disableAutoCancel(); + + // Test disabling auto cancel. + hostApi.create(75L, mockMeteringPointInfos, /* disableAutoCancel */ true); + verify(mockFocusMeteringActionBuilder).disableAutoCancel(); + } } 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 15d392137aae..a06ffaf3b3fd 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 @@ -210,7 +210,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// This should only be true if [setExposureMode] was called to set /// [FocusMode.locked] and no previous focus point was set via /// [setFocusPoint]. - bool defaultFocusPointLocked = false; + bool _defaultFocusPointLocked = false; /// Error code indicating that exposure compensation is not supported by /// CameraX for the device. @@ -522,15 +522,15 @@ class AndroidCameraCameraX extends CameraPlatform { // Determine auto-focus point to restore, if any. We do not restore // default auto-focus point if set previously to lock focus. - final MeteringPoint? autoAfPoint = defaultFocusPointLocked + final MeteringPoint? autoAfPoint = _defaultFocusPointLocked ? null : currentFocusMeteringAction!.meteringPointInfos .where(((MeteringPoint, int?) meteringPointInfo) => - meteringPointInfo.$2 != FocusMeteringAction.flagAf) + meteringPointInfo.$2 == FocusMeteringAction.flagAf) .toList() .first .$1; - defaultFocusPointLocked = false; + _defaultFocusPointLocked = false; await _startFocusAndMeteringFor( point: autoAfPoint, meteringMode: FocusMeteringAction.flagAf); @@ -552,7 +552,7 @@ class AndroidCameraCameraX extends CameraPlatform { // If there isn't, lock center of entire sensor area by default. if (lockedAfPoint == null) { lockedAfPoint = proxy.createMeteringPoint(0.5, 0.5, 1, cameraInfo!); - defaultFocusPointLocked = true; + _defaultFocusPointLocked = true; } await _startFocusAndMeteringFor( diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 9e151c368ef6..cb3db87bc5e1 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+35 +version: 1.0.0 environment: sdk: ^3.1.0 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 02ddb2231806..c4797489cdaa 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 @@ -9,6 +9,7 @@ import 'package:async/async.dart'; import 'package:camera_android_camerax/camera_android_camerax.dart'; import 'package:camera_android_camerax/src/analyzer.dart'; import 'package:camera_android_camerax/src/camera.dart'; +import 'package:camera_android_camerax/src/camera2_camera_control.dart'; import 'package:camera_android_camerax/src/camera_control.dart'; import 'package:camera_android_camerax/src/camera_info.dart'; import 'package:camera_android_camerax/src/camera_selector.dart'; @@ -16,6 +17,7 @@ import 'package:camera_android_camerax/src/camera_state.dart'; import 'package:camera_android_camerax/src/camera_state_error.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; import 'package:camera_android_camerax/src/camerax_proxy.dart'; +import 'package:camera_android_camerax/src/capture_request_options.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'; @@ -56,6 +58,7 @@ import 'test_camerax_library.g.dart'; MockSpec(), MockSpec(), MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), @@ -122,14 +125,39 @@ void main() { /// Modifies the creation of MeteringPoints and FocusMeteringActions to return /// objects detached from a native object. CameraXProxy getProxyForExposureAndFocus() => CameraXProxy( - createMeteringPoint: (double x, double y, CameraInfo cameraInfo) => - MeteringPoint.detached(x: x, y: y, cameraInfo: cameraInfo), - createFocusMeteringAction: - (List<(MeteringPoint, int?)> meteringPointInfos, - bool? disableAutoCancel) => - FocusMeteringAction.detached( - meteringPointInfos: meteringPointInfos, - disableAutoCancel: disableAutoCancel)); + createMeteringPoint: + (double x, double y, double? size, CameraInfo cameraInfo) => + MeteringPoint.detached( + x: x, y: y, size: size, cameraInfo: cameraInfo), + createFocusMeteringAction: + (List<(MeteringPoint, int?)> meteringPointInfos, + bool? disableAutoCancel) => + FocusMeteringAction.detached( + meteringPointInfos: meteringPointInfos, + disableAutoCancel: disableAutoCancel), + ); + + /// CameraXProxy for testing setting focus mode. + /// + /// Modifies the retrieval of a [Camera2CameraControl] instance to depend on + /// interaction with expected [cameraControl] instance and modifies creation + /// of [CaptureRequestOptions to return objects detached from a native object. + CameraXProxy getProxyForSettingFocusPoint( + CameraControl cameraControlForComparison, + Camera2CameraControl camera2cameraControl) { + final CameraXProxy proxy = getProxyForExposureAndFocus(); + + proxy.getCamera2CameraControl = (CameraControl cameraControl) => + cameraControl == cameraControlForComparison + ? camera2cameraControl + : Camera2CameraControl.detached(cameraControl: cameraControl); + + proxy.createCaptureRequestOptions = + (List<(CaptureRequestKeySupportedType, Object?)> options) => + CaptureRequestOptions.detached(requestedOptions: options); + + return proxy; + } test('Should fetch CameraDescription instances for available cameras', () async { @@ -2201,6 +2229,39 @@ void main() { equals(FocusMeteringAction.flagAe)); }); + test( + 'setExposurePoint disables auto-cancel for focus and metering as expected', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 2; + final MockCameraControl mockCameraControl = MockCameraControl(); + const Point exposurePoint = Point(0.1, 0.2); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForExposureAndFocus(); + + // Test not disabling auto cancel. + camera.currentFocusMode = FocusMode.auto; + await camera.setExposurePoint(cameraId, exposurePoint); + VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isFalse); + + clearInteractions(mockCameraControl); + + // Test disabling auto cancel. + camera.currentFocusMode = FocusMode.locked; + await camera.setExposurePoint(cameraId, exposurePoint); + verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + capturedAction = verificationResult.captured.single as FocusMeteringAction; + }); + test( 'setExposureOffset throws exception if exposure compensation not supported', () async { @@ -2462,4 +2523,163 @@ void main() { expect(capturedMeteringPointInfos.first.$2, equals(FocusMeteringAction.flagAf)); }); + + test('setFocusPoint disables auto-cancel for focus and metering as expected', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 2; + final MockCameraControl mockCameraControl = MockCameraControl(); + const Point exposurePoint = Point(0.1, 0.2); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForExposureAndFocus(); + + // Test not disabling auto cancel. + camera.currentFocusMode = FocusMode.auto; + await camera.setFocusPoint(cameraId, exposurePoint); + VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isFalse); + + clearInteractions(mockCameraControl); + + // Test disabling auto cancel. + camera.currentFocusMode = FocusMode.locked; + await camera.setFocusPoint(cameraId, exposurePoint); + verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + capturedAction = verificationResult.captured.single as FocusMeteringAction; + }); + + test( + 'setFocusMode does nothing if setting auto-focus mode and is already using auto-focus mode', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 4; + final MockCameraControl mockCameraControl = MockCameraControl(); + + // Set directly for test versus calling createCamera. + camera.currentFocusMode = FocusMode.auto; + + await camera.setFocusMode(cameraId, FocusMode.auto); + + verifyNoMoreInteractions(mockCameraControl); + }); + + test( + 'setFocusMode removes default auto-focus point if previously set and setting auto-focus mode', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 5; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + // const double defaultFocusPointX = 0.5; + // const double defaultFocusPointY = 0.5; + // const double defaultFocusPointSize = 1; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Lock focus default focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + // Test removal of default focus point. + await camera.setFocusMode(cameraId, FocusMode.auto); + + verify(mockCameraControl.cancelFocusAndMetering()); + + // 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(defaultFocusPointX)); + // expect(capturedMeteringPointInfos.first.$1.y, equals(defaultFocusPointY)); + // expect(capturedMeteringPointInfos.first.$1.size, + // equals(defaultFocusPointSize)); + // expect(capturedMeteringPointInfos.first.$2, + // equals(FocusMeteringAction.flagAf)); + }); + + test( + 'setFocusMode re-focuses on previously set auto-focus point with auto-canceled enabled if setting auto-focus mode', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 6; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + const double focusPointX = 0.1; + const double focusPointY = 0.2; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Lock focus a focus point. + await camera.setFocusPoint( + cameraId, const Point(focusPointX, focusPointY)); + await camera.setFocusMode(cameraId, FocusMode.locked); + + clearInteractions(mockCameraControl); + + // Test re-focusing on previously set auto-focus point with auto-cancel enabled. + await camera.setFocusMode(cameraId, FocusMode.auto); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isFalse); + 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)); + }); + + test( + 'setFocusMode starts expected focus and metering action if setting locked focus mode and current focus and metering action has auto-focus point', + () async {}); + + test( + 'setFocusMode starts expected focus and metering action if setting locked focus mode and current focus and metering action does not auto-focus point', + () async {}); + + test( + 'setFocusMode starts expected focus and metering action if there is no current focus and metering action', + () async {}); + + test( + 'setFocusMode re-sets exposure mode if setting locked focus mode while using auto exposure mode', + () {}); } diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart index 4c90e940e71c..4ed047ae3770 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart @@ -4,36 +4,39 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i16; -import 'dart:typed_data' as _i29; +import 'dart:typed_data' as _i31; import 'package:camera_android_camerax/src/analyzer.dart' as _i15; import 'package:camera_android_camerax/src/camera.dart' as _i9; +import 'package:camera_android_camerax/src/camera2_camera_control.dart' as _i22; import 'package:camera_android_camerax/src/camera_control.dart' as _i3; import 'package:camera_android_camerax/src/camera_info.dart' as _i2; -import 'package:camera_android_camerax/src/camera_selector.dart' as _i22; +import 'package:camera_android_camerax/src/camera_selector.dart' as _i24; import 'package:camera_android_camerax/src/camera_state.dart' as _i18; import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i7; +import 'package:camera_android_camerax/src/capture_request_options.dart' + as _i23; import 'package:camera_android_camerax/src/exposure_state.dart' as _i5; -import 'package:camera_android_camerax/src/fallback_strategy.dart' as _i23; +import 'package:camera_android_camerax/src/fallback_strategy.dart' as _i25; import 'package:camera_android_camerax/src/focus_metering_action.dart' as _i21; import 'package:camera_android_camerax/src/focus_metering_result.dart' as _i20; -import 'package:camera_android_camerax/src/image_analysis.dart' as _i24; -import 'package:camera_android_camerax/src/image_capture.dart' as _i25; +import 'package:camera_android_camerax/src/image_analysis.dart' as _i26; +import 'package:camera_android_camerax/src/image_capture.dart' as _i27; import 'package:camera_android_camerax/src/image_proxy.dart' as _i17; import 'package:camera_android_camerax/src/live_data.dart' as _i4; -import 'package:camera_android_camerax/src/observer.dart' as _i28; +import 'package:camera_android_camerax/src/observer.dart' as _i30; import 'package:camera_android_camerax/src/pending_recording.dart' as _i10; -import 'package:camera_android_camerax/src/plane_proxy.dart' as _i27; -import 'package:camera_android_camerax/src/preview.dart' as _i30; +import 'package:camera_android_camerax/src/plane_proxy.dart' as _i29; +import 'package:camera_android_camerax/src/preview.dart' as _i32; import 'package:camera_android_camerax/src/process_camera_provider.dart' - as _i31; -import 'package:camera_android_camerax/src/quality_selector.dart' as _i33; + as _i33; +import 'package:camera_android_camerax/src/quality_selector.dart' as _i35; import 'package:camera_android_camerax/src/recorder.dart' as _i11; import 'package:camera_android_camerax/src/recording.dart' as _i8; -import 'package:camera_android_camerax/src/resolution_selector.dart' as _i34; -import 'package:camera_android_camerax/src/resolution_strategy.dart' as _i35; -import 'package:camera_android_camerax/src/use_case.dart' as _i32; -import 'package:camera_android_camerax/src/video_capture.dart' as _i36; +import 'package:camera_android_camerax/src/resolution_selector.dart' as _i36; +import 'package:camera_android_camerax/src/resolution_strategy.dart' as _i37; +import 'package:camera_android_camerax/src/use_case.dart' as _i34; +import 'package:camera_android_camerax/src/video_capture.dart' as _i38; import 'package:camera_android_camerax/src/zoom_state.dart' as _i19; import 'package:camera_platform_interface/camera_platform_interface.dart' as _i6; @@ -41,9 +44,9 @@ import 'package:flutter/foundation.dart' as _i14; import 'package:flutter/services.dart' as _i13; import 'package:flutter/widgets.dart' as _i12; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i26; +import 'package:mockito/src/dummies.dart' as _i28; -import 'test_camerax_library.g.dart' as _i37; +import 'test_camerax_library.g.dart' as _i39; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -440,6 +443,38 @@ class MockCameraControl extends _i1.Mock implements _i3.CameraControl { ) as _i16.Future); } +/// A class which mocks [Camera2CameraControl]. +/// +/// See the documentation for Mockito's code generation for more information. +// ignore: must_be_immutable +class MockCamera2CameraControl extends _i1.Mock + implements _i22.Camera2CameraControl { + @override + _i3.CameraControl get cameraControl => (super.noSuchMethod( + Invocation.getter(#cameraControl), + returnValue: _FakeCameraControl_1( + this, + Invocation.getter(#cameraControl), + ), + returnValueForMissingStub: _FakeCameraControl_1( + this, + Invocation.getter(#cameraControl), + ), + ) as _i3.CameraControl); + + @override + _i16.Future addCaptureRequestOptions( + _i23.CaptureRequestOptions? captureRequestOptions) => + (super.noSuchMethod( + Invocation.method( + #addCaptureRequestOptions, + [captureRequestOptions], + ), + returnValue: _i16.Future.value(), + returnValueForMissingStub: _i16.Future.value(), + ) as _i16.Future); +} + /// A class which mocks [CameraImageData]. /// /// See the documentation for Mockito's code generation for more information. @@ -484,7 +519,7 @@ class MockCameraImageData extends _i1.Mock implements _i6.CameraImageData { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockCameraSelector extends _i1.Mock implements _i22.CameraSelector { +class MockCameraSelector extends _i1.Mock implements _i24.CameraSelector { @override _i16.Future> filter(List<_i2.CameraInfo>? cameraInfos) => (super.noSuchMethod( @@ -530,7 +565,7 @@ class MockExposureState extends _i1.Mock implements _i5.ExposureState { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockFallbackStrategy extends _i1.Mock implements _i23.FallbackStrategy { +class MockFallbackStrategy extends _i1.Mock implements _i25.FallbackStrategy { @override _i7.VideoQuality get quality => (super.noSuchMethod( Invocation.getter(#quality), @@ -551,7 +586,7 @@ class MockFallbackStrategy extends _i1.Mock implements _i23.FallbackStrategy { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockImageAnalysis extends _i1.Mock implements _i24.ImageAnalysis { +class MockImageAnalysis extends _i1.Mock implements _i26.ImageAnalysis { @override _i16.Future setTargetRotation(int? rotation) => (super.noSuchMethod( Invocation.method( @@ -587,7 +622,7 @@ class MockImageAnalysis extends _i1.Mock implements _i24.ImageAnalysis { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockImageCapture extends _i1.Mock implements _i25.ImageCapture { +class MockImageCapture extends _i1.Mock implements _i27.ImageCapture { @override _i16.Future setTargetRotation(int? rotation) => (super.noSuchMethod( Invocation.method( @@ -614,7 +649,7 @@ class MockImageCapture extends _i1.Mock implements _i25.ImageCapture { #takePicture, [], ), - returnValue: _i16.Future.value(_i26.dummyValue( + returnValue: _i16.Future.value(_i28.dummyValue( this, Invocation.method( #takePicture, @@ -622,7 +657,7 @@ class MockImageCapture extends _i1.Mock implements _i25.ImageCapture { ), )), returnValueForMissingStub: - _i16.Future.value(_i26.dummyValue( + _i16.Future.value(_i28.dummyValue( this, Invocation.method( #takePicture, @@ -659,16 +694,16 @@ class MockImageProxy extends _i1.Mock implements _i17.ImageProxy { ) as int); @override - _i16.Future> getPlanes() => (super.noSuchMethod( + _i16.Future> getPlanes() => (super.noSuchMethod( Invocation.method( #getPlanes, [], ), returnValue: - _i16.Future>.value(<_i27.PlaneProxy>[]), + _i16.Future>.value(<_i29.PlaneProxy>[]), returnValueForMissingStub: - _i16.Future>.value(<_i27.PlaneProxy>[]), - ) as _i16.Future>); + _i16.Future>.value(<_i29.PlaneProxy>[]), + ) as _i16.Future>); @override _i16.Future close() => (super.noSuchMethod( @@ -685,7 +720,7 @@ class MockImageProxy extends _i1.Mock implements _i17.ImageProxy { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockObserver extends _i1.Mock implements _i28.Observer<_i18.CameraState> { +class MockObserver extends _i1.Mock implements _i30.Observer<_i18.CameraState> { @override void Function(Object) get onChanged => (super.noSuchMethod( Invocation.getter(#onChanged), @@ -736,13 +771,13 @@ class MockPendingRecording extends _i1.Mock implements _i10.PendingRecording { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockPlaneProxy extends _i1.Mock implements _i27.PlaneProxy { +class MockPlaneProxy extends _i1.Mock implements _i29.PlaneProxy { @override - _i29.Uint8List get buffer => (super.noSuchMethod( + _i31.Uint8List get buffer => (super.noSuchMethod( Invocation.getter(#buffer), - returnValue: _i29.Uint8List(0), - returnValueForMissingStub: _i29.Uint8List(0), - ) as _i29.Uint8List); + returnValue: _i31.Uint8List(0), + returnValueForMissingStub: _i31.Uint8List(0), + ) as _i31.Uint8List); @override int get pixelStride => (super.noSuchMethod( @@ -763,7 +798,7 @@ class MockPlaneProxy extends _i1.Mock implements _i27.PlaneProxy { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockPreview extends _i1.Mock implements _i30.Preview { +class MockPreview extends _i1.Mock implements _i32.Preview { @override _i16.Future setTargetRotation(int? rotation) => (super.noSuchMethod( Invocation.method( @@ -823,7 +858,7 @@ class MockPreview extends _i1.Mock implements _i30.Preview { /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockProcessCameraProvider extends _i1.Mock - implements _i31.ProcessCameraProvider { + implements _i33.ProcessCameraProvider { @override _i16.Future> getAvailableCameraInfos() => (super.noSuchMethod( @@ -839,8 +874,8 @@ class MockProcessCameraProvider extends _i1.Mock @override _i16.Future<_i9.Camera> bindToLifecycle( - _i22.CameraSelector? cameraSelector, - List<_i32.UseCase>? useCases, + _i24.CameraSelector? cameraSelector, + List<_i34.UseCase>? useCases, ) => (super.noSuchMethod( Invocation.method( @@ -873,7 +908,7 @@ class MockProcessCameraProvider extends _i1.Mock ) as _i16.Future<_i9.Camera>); @override - _i16.Future isBound(_i32.UseCase? useCase) => (super.noSuchMethod( + _i16.Future isBound(_i34.UseCase? useCase) => (super.noSuchMethod( Invocation.method( #isBound, [useCase], @@ -883,7 +918,7 @@ class MockProcessCameraProvider extends _i1.Mock ) as _i16.Future); @override - void unbind(List<_i32.UseCase>? useCases) => super.noSuchMethod( + void unbind(List<_i34.UseCase>? useCases) => super.noSuchMethod( Invocation.method( #unbind, [useCases], @@ -905,7 +940,7 @@ class MockProcessCameraProvider extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockQualitySelector extends _i1.Mock implements _i33.QualitySelector { +class MockQualitySelector extends _i1.Mock implements _i35.QualitySelector { @override List<_i7.VideoQualityData> get qualityList => (super.noSuchMethod( Invocation.getter(#qualityList), @@ -950,14 +985,14 @@ class MockRecorder extends _i1.Mock implements _i11.Recorder { /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockResolutionSelector extends _i1.Mock - implements _i34.ResolutionSelector {} + implements _i36.ResolutionSelector {} /// A class which mocks [ResolutionStrategy]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockResolutionStrategy extends _i1.Mock - implements _i35.ResolutionStrategy {} + implements _i37.ResolutionStrategy {} /// A class which mocks [Recording]. /// @@ -1009,7 +1044,7 @@ class MockRecording extends _i1.Mock implements _i8.Recording { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockVideoCapture extends _i1.Mock implements _i36.VideoCapture { +class MockVideoCapture extends _i1.Mock implements _i38.VideoCapture { @override _i16.Future setTargetRotation(int? rotation) => (super.noSuchMethod( Invocation.method( @@ -1232,7 +1267,7 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i37.TestInstanceManagerHostApi { + implements _i39.TestInstanceManagerHostApi { @override void clear() => super.noSuchMethod( Invocation.method( @@ -1247,7 +1282,7 @@ class MockTestInstanceManagerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestSystemServicesHostApi extends _i1.Mock - implements _i37.TestSystemServicesHostApi { + implements _i39.TestSystemServicesHostApi { @override _i16.Future<_i7.CameraPermissionsErrorData?> requestCameraPermissions( bool? enableAudio) => @@ -1274,7 +1309,7 @@ class MockTestSystemServicesHostApi extends _i1.Mock suffix, ], ), - returnValue: _i26.dummyValue( + returnValue: _i28.dummyValue( this, Invocation.method( #getTempFilePath, @@ -1284,7 +1319,7 @@ class MockTestSystemServicesHostApi extends _i1.Mock ], ), ), - returnValueForMissingStub: _i26.dummyValue( + returnValueForMissingStub: _i28.dummyValue( this, Invocation.method( #getTempFilePath, @@ -1328,7 +1363,7 @@ class MockLiveCameraState extends _i1.Mock } @override - _i16.Future observe(_i28.Observer<_i18.CameraState>? observer) => + _i16.Future observe(_i30.Observer<_i18.CameraState>? observer) => (super.noSuchMethod( Invocation.method( #observe, @@ -1360,7 +1395,7 @@ class MockLiveZoomState extends _i1.Mock } @override - _i16.Future observe(_i28.Observer<_i19.ZoomState>? observer) => + _i16.Future observe(_i30.Observer<_i19.ZoomState>? observer) => (super.noSuchMethod( Invocation.method( #observe, 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 a74338e2735c..8a7dcdc6c117 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 @@ -43,8 +43,8 @@ void main() { instanceManager: instanceManager, ); - verifyNever( - mockApi.create(argThat(isA()), argThat(isA>()))); + verifyNever(mockApi.create(argThat(isA()), argThat(isA>()), + argThat(isA()))); }); test('create calls create on the Java side', () { final MockTestFocusMeteringActionHostApi mockApi = @@ -67,6 +67,7 @@ void main() { (mockMeteringPoint1, mockMeteringPoint1Mode), (mockMeteringPoint2, mockMeteringPoint2Mode) ]; + const bool disableAutoCancel = true; instanceManager .addHostCreatedInstance(mockMeteringPoint1, mockMeteringPoint1Id, @@ -81,12 +82,14 @@ void main() { final FocusMeteringAction instance = FocusMeteringAction( meteringPointInfos: meteringPointInfos, + disableAutoCancel: disableAutoCancel, instanceManager: instanceManager, ); final VerificationResult verificationResult = verify(mockApi.create( argThat(equals(instanceManager.getIdentifier(instance))), - captureAny)); + captureAny, + argThat(equals(disableAutoCancel)))); final List captureMeteringPointInfos = verificationResult.captured.single as List; expect(captureMeteringPointInfos.length, equals(2)); From 29659297bcbb3387be257fc3ff499b4a1e1fc956 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 12:59:41 -0800 Subject: [PATCH 13/27] Add more tests --- .../test/android_camera_camerax_test.dart | 250 ++++++++++++++++-- 1 file changed, 227 insertions(+), 23 deletions(-) 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 c4797489cdaa..217e28f90070 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 @@ -2579,9 +2579,6 @@ void main() { final MockCameraControl mockCameraControl = MockCameraControl(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); - // const double defaultFocusPointX = 0.5; - // const double defaultFocusPointY = 0.5; - // const double defaultFocusPointSize = 1; // Set directly for test versus calling createCamera. camera.cameraInfo = MockCameraInfo(); @@ -2603,22 +2600,10 @@ void main() { await camera.setFocusMode(cameraId, FocusMode.auto); verify(mockCameraControl.cancelFocusAndMetering()); - - // 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(defaultFocusPointX)); - // expect(capturedMeteringPointInfos.first.$1.y, equals(defaultFocusPointY)); - // expect(capturedMeteringPointInfos.first.$1.size, - // equals(defaultFocusPointSize)); - // expect(capturedMeteringPointInfos.first.$2, - // equals(FocusMeteringAction.flagAf)); }); + // TODO(camsim99): Add different test for canceling f and m + test( 'setFocusMode re-focuses on previously set auto-focus point with auto-canceled enabled if setting auto-focus mode', () async { @@ -2643,7 +2628,7 @@ void main() { // Tell plugin that there is no current focus and metering action. camera.currentFocusMeteringAction = null; - // Lock focus a focus point. + // Lock a focus point. await camera.setFocusPoint( cameraId, const Point(focusPointX, focusPointY)); await camera.setFocusMode(cameraId, FocusMode.locked); @@ -2668,16 +2653,235 @@ void main() { }); test( - 'setFocusMode starts expected focus and metering action if setting locked focus mode and current focus and metering action has auto-focus point', - () async {}); + 'setFocusMode starts expected focus and metering action with default auto-focus point if setting locked focus mode and current focus and metering action has auto-focus point', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 7; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + const double focusPointX = 0.88; + const double focusPointY = 0.33; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Set a focus point. + await camera.setFocusPoint( + cameraId, const Point(focusPointX, focusPointY)); + clearInteractions(mockCameraControl); + + // Lock focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); + + // We expect the set focus point to be locked. + 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.$1.size, isNull); + expect(capturedMeteringPointInfos.first.$2, + equals(FocusMeteringAction.flagAf)); + }); + + test( + 'setFocusMode starts expected focus and metering action with default auto-focus point if setting locked focus mode and current focus and metering action has auto-focus point amongst others', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 8; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + const double focusPointX = 0.38; + const double focusPointY = 0.38; + const double exposurePointX = 0.54; + const double exposurePointY = 0.45; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Set a focus point. + await camera.setFocusPoint( + cameraId, const Point(focusPointX, focusPointY)); + await camera.setExposurePoint( + cameraId, const Point(exposurePointX, exposurePointY)); + clearInteractions(mockCameraControl); + + // Lock focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); + + // We expect two MeteringPoints, the set focus point and the set exposure + // point. + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(2)); + + final List<(MeteringPoint, int?)> focusPoints = capturedMeteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 == FocusMeteringAction.flagAf) + .toList(); + expect(focusPoints.length, equals(1)); + expect(focusPoints.first.$1.x, equals(focusPointX)); + expect(focusPoints.first.$1.y, equals(focusPointY)); + expect(focusPoints.first.$1.size, isNull); + + final List<(MeteringPoint, int?)> exposurePoints = + capturedMeteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 == FocusMeteringAction.flagAe) + .toList(); + expect(exposurePoints.length, equals(1)); + expect(exposurePoints.first.$1.x, equals(exposurePointX)); + expect(exposurePoints.first.$1.y, equals(exposurePointY)); + }); test( - 'setFocusMode starts expected focus and metering action if setting locked focus mode and current focus and metering action does not auto-focus point', - () async {}); + 'setFocusMode starts expected focus and metering action if setting locked focus mode and current focus and metering action does not contain an auto-focus point', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 9; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + const double exposurePointX = 0.8; + const double exposurePointY = 0.3; + const double defaultFocusPointX = 0.5; + const double defaultFocusPointY = 0.5; + const double defaultFocusPointSize = 1; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Set an exposure point (creates a current focus and metering action + // without a focus point). + await camera.setExposurePoint( + cameraId, const Point(exposurePointX, exposurePointY)); + clearInteractions(mockCameraControl); + + // Lock focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); + + // We expect two MeteringPoints, the default focus point and the set + //exposure point. + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(2)); + + final List<(MeteringPoint, int?)> focusPoints = capturedMeteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 == FocusMeteringAction.flagAf) + .toList(); + expect(focusPoints.length, equals(1)); + expect(focusPoints.first.$1.x, equals(defaultFocusPointX)); + expect(focusPoints.first.$1.y, equals(defaultFocusPointY)); + expect(focusPoints.first.$1.size, equals(defaultFocusPointSize)); + + final List<(MeteringPoint, int?)> exposurePoints = + capturedMeteringPointInfos + .where(((MeteringPoint, int?) meteringPointInfo) => + meteringPointInfo.$2 == FocusMeteringAction.flagAe) + .toList(); + expect(exposurePoints.length, equals(1)); + expect(exposurePoints.first.$1.x, equals(exposurePointX)); + expect(exposurePoints.first.$1.y, equals(exposurePointY)); + expect(exposurePoints.first.$1.size, isNull); + }); test( 'setFocusMode starts expected focus and metering action if there is no current focus and metering action', - () async {}); + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 10; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + const double defaultFocusPointX = 0.5; + const double defaultFocusPointY = 0.5; + const double defaultFocusPointSize = 1; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Lock focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); + + // We expect only the default focus point to be set. + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.first.$1.x, equals(defaultFocusPointX)); + expect(capturedMeteringPointInfos.first.$1.y, equals(defaultFocusPointY)); + expect(capturedMeteringPointInfos.first.$1.size, + equals(defaultFocusPointSize)); + expect(capturedMeteringPointInfos.first.$2, + equals(FocusMeteringAction.flagAf)); + }); test( 'setFocusMode re-sets exposure mode if setting locked focus mode while using auto exposure mode', From 861ae642708083c19c8285ff3168fc6196da580a Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 13:51:05 -0800 Subject: [PATCH 14/27] Adding more tests --- .../lib/src/android_camera_camerax.dart | 20 +++---- .../test/android_camera_camerax_test.dart | 53 +++++++++++++++---- 2 files changed, 53 insertions(+), 20 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 a06ffaf3b3fd..ee84c27ba399 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 @@ -197,12 +197,12 @@ class AndroidCameraCameraX extends CameraPlatform { /// Current focus mode set via [setFocusMode]. /// /// CameraX defaults to auto-focus mode. - FocusMode currentFocusMode = FocusMode.auto; + FocusMode _currentFocusMode = FocusMode.auto; /// Current exposure mode set via [setExposureMode]. /// /// CameraX defaults to auto-exposure mode. - ExposureMode currentExposureMode = ExposureMode.auto; + ExposureMode _currentExposureMode = ExposureMode.auto; /// Whether or not a default focus point of the entire sensor area was focused /// and locked. @@ -477,7 +477,7 @@ class AndroidCameraCameraX extends CameraPlatform { // setting will not be impacted by this lock (setting an exposure mode // is implemented with Camera2 interop that will override any settings // to achieve the expected exposure mode as needed). - final bool disableAutoCancel = currentFocusMode == FocusMode.locked; + final bool disableAutoCancel = _currentFocusMode == FocusMode.locked; await _startFocusAndMeteringForPoint( point: point, meteringMode: FocusMeteringAction.flagAe, @@ -514,7 +514,7 @@ class AndroidCameraCameraX extends CameraPlatform { Future setFocusMode(int cameraId, FocusMode mode) async { switch (mode) { case FocusMode.auto: - if (currentFocusMode == FocusMode.auto) { + if (_currentFocusMode == FocusMode.auto) { // CameraX uses auto-focus mode by default, so no need to reconfigure // auto-focus if already set. return; @@ -561,14 +561,14 @@ class AndroidCameraCameraX extends CameraPlatform { disableAutoCancel: true); } // Update current focus mode. - currentFocusMode = mode; + _currentFocusMode = mode; // If focus mode was just locked and exposure mode is not, unlock exposure // mode to ensure that disabling auto-cancel does not interfere with // automatic exposure metering. - if (currentExposureMode == ExposureMode.auto && - currentFocusMode == FocusMode.locked) { - await setExposureMode(cameraId, currentExposureMode); + if (_currentExposureMode == ExposureMode.auto && + _currentFocusMode == FocusMode.locked) { + await setExposureMode(cameraId, _currentExposureMode); } } @@ -588,7 +588,7 @@ class AndroidCameraCameraX extends CameraPlatform { )>[(CaptureRequestKeySupportedType.controlAeLock, lockExposureMode)]); await camera2Control.addCaptureRequestOptions(captureRequestOptions); - currentExposureMode = mode; + _currentExposureMode = mode; } /// Gets the supported step size for exposure offset for the selected camera in EV units. @@ -664,7 +664,7 @@ class AndroidCameraCameraX extends CameraPlatform { await _startFocusAndMeteringForPoint( point: point, meteringMode: FocusMeteringAction.flagAf, - disableAutoCancel: currentFocusMode == FocusMode.locked); + disableAutoCancel: _currentFocusMode == FocusMode.locked); } /// Gets the maximum supported zoom level for the selected camera. 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 217e28f90070..95d7d4255eda 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 @@ -2241,10 +2241,12 @@ void main() { camera.cameraControl = mockCameraControl; camera.cameraInfo = MockCameraInfo(); - camera.proxy = getProxyForExposureAndFocus(); + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, MockCamera2CameraControl()); // Test not disabling auto cancel. - camera.currentFocusMode = FocusMode.auto; + await camera.setFocusMode(cameraId, FocusMode.auto); + clearInteractions(mockCameraControl); await camera.setExposurePoint(cameraId, exposurePoint); VerificationResult verificationResult = verify(mockCameraControl.startFocusAndMetering(captureAny)); @@ -2255,7 +2257,8 @@ void main() { clearInteractions(mockCameraControl); // Test disabling auto cancel. - camera.currentFocusMode = FocusMode.locked; + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); await camera.setExposurePoint(cameraId, exposurePoint); verificationResult = verify(mockCameraControl.startFocusAndMetering(captureAny)); @@ -2535,10 +2538,13 @@ void main() { camera.cameraControl = mockCameraControl; camera.cameraInfo = MockCameraInfo(); - camera.proxy = getProxyForExposureAndFocus(); + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, MockCamera2CameraControl()); // Test not disabling auto cancel. - camera.currentFocusMode = FocusMode.auto; + await camera.setFocusMode(cameraId, FocusMode.auto); + clearInteractions(mockCameraControl); + await camera.setFocusPoint(cameraId, exposurePoint); VerificationResult verificationResult = verify(mockCameraControl.startFocusAndMetering(captureAny)); @@ -2549,7 +2555,9 @@ void main() { clearInteractions(mockCameraControl); // Test disabling auto cancel. - camera.currentFocusMode = FocusMode.locked; + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); + await camera.setFocusPoint(cameraId, exposurePoint); verificationResult = verify(mockCameraControl.startFocusAndMetering(captureAny)); @@ -2563,9 +2571,7 @@ void main() { const int cameraId = 4; final MockCameraControl mockCameraControl = MockCameraControl(); - // Set directly for test versus calling createCamera. - camera.currentFocusMode = FocusMode.auto; - + // Camera uses auto-focus by default, so try setting auto mode again. await camera.setFocusMode(cameraId, FocusMode.auto); verifyNoMoreInteractions(mockCameraControl); @@ -2885,5 +2891,32 @@ void main() { test( 'setFocusMode re-sets exposure mode if setting locked focus mode while using auto exposure mode', - () {}); + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 10; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Tell plugin that there is no current focus and metering action. + camera.currentFocusMeteringAction = null; + + // Set auto exposure mode. + await camera.setExposureMode(cameraId, ExposureMode.auto); + + // Lock focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + // TODO(camsim99): Add test here. + }); } From 23d23ed1d64a66ce071048116e87eb0e780529b7 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 14:08:19 -0800 Subject: [PATCH 15/27] Finish adding tests --- .../lib/src/android_camera_camerax.dart | 19 ------ .../test/android_camera_camerax_test.dart | 65 ++++++++++++++++++- 2 files changed, 62 insertions(+), 22 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 2ba4c23e79da..c70bff6442a3 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 @@ -572,25 +572,6 @@ class AndroidCameraCameraX extends CameraPlatform { } } - /// Sets the exposure mode for taking pictures. - /// - /// [cameraId] is not used. - @override - Future setExposureMode(int cameraId, ExposureMode mode) async { - final Camera2CameraControl camera2Control = - proxy.getCamera2CameraControl(cameraControl); - final bool lockExposureMode = mode == ExposureMode.locked; - - final CaptureRequestOptions captureRequestOptions = proxy - .createCaptureRequestOptions(<( - CaptureRequestKeySupportedType, - Object? - )>[(CaptureRequestKeySupportedType.controlAeLock, lockExposureMode)]); - - await camera2Control.addCaptureRequestOptions(captureRequestOptions); - _currentExposureMode = mode; - } - /// Gets the supported step size for exposure offset for the selected camera in EV units. /// /// Returns -1 if exposure compensation is not supported for the device. 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 09016003c96b..810831936eca 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 @@ -2636,6 +2636,57 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 5; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockCamera2CameraControl mockCamera2CameraControl = + MockCamera2CameraControl(); + const double exposurePointX = 0.2; + const double exposurePointY = 0.7; + + // Set directly for test versus calling createCamera. + camera.cameraInfo = MockCameraInfo(); + camera.cameraControl = mockCameraControl; + + when(mockCamera2CameraControl.addCaptureRequestOptions(any)) + .thenAnswer((_) async => Future.value()); + + camera.proxy = getProxyForSettingFocusPoint( + mockCameraControl, mockCamera2CameraControl); + + // Set exposure points. + await camera.setExposurePoint( + cameraId, const Point(exposurePointX, exposurePointY)); + + // Lock focus default focus point. + await camera.setFocusMode(cameraId, FocusMode.locked); + + clearInteractions(mockCameraControl); + + // Test removal of default focus point. + await camera.setFocusMode(cameraId, FocusMode.auto); + + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isFalse); + + // We expect only the previously set exposure point to be re-set. + final List<(MeteringPoint, int?)> capturedMeteringPointInfos = + capturedAction.meteringPointInfos; + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.length, equals(1)); + expect(capturedMeteringPointInfos.first.$1.x, equals(exposurePointX)); + expect(capturedMeteringPointInfos.first.$1.y, equals(exposurePointY)); + expect(capturedMeteringPointInfos.first.$1.size, isNull); + expect(capturedMeteringPointInfos.first.$2, + equals(FocusMeteringAction.flagAe)); + }); + + test( + 'setFocusMode cancels focus and metering if only focus point previously set is a focus point', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 5; + final MockCameraControl mockCameraControl = MockCameraControl(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); @@ -2661,8 +2712,6 @@ void main() { verify(mockCameraControl.cancelFocusAndMetering()); }); - // TODO(camsim99): Add different test for canceling f and m - test( 'setFocusMode re-focuses on previously set auto-focus point with auto-canceled enabled if setting auto-focus mode', () async { @@ -2966,10 +3015,20 @@ void main() { // Set auto exposure mode. await camera.setExposureMode(cameraId, ExposureMode.auto); + clearInteractions(mockCamera2CameraControl); // Lock focus point. await camera.setFocusMode(cameraId, FocusMode.locked); - // TODO(camsim99): Add test here. + final VerificationResult verificationResult = + verify(mockCamera2CameraControl.addCaptureRequestOptions(captureAny)); + final CaptureRequestOptions capturedCaptureRequestOptions = + verificationResult.captured.single as CaptureRequestOptions; + final List<(CaptureRequestKeySupportedType, Object?)> requestedOptions = + capturedCaptureRequestOptions.requestedOptions; + expect(requestedOptions.length, equals(1)); + expect(requestedOptions.first.$1, + equals(CaptureRequestKeySupportedType.controlAeLock)); + expect(requestedOptions.first.$2, equals(false)); }); } From 49392ae4315ea7954d319216fd8307aff8ef2e43 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 14:40:31 -0800 Subject: [PATCH 16/27] Self review 2 --- .../camera_android_camerax/CHANGELOG.md | 2 +- .../lib/src/android_camera_camerax.dart | 66 +++++++++++-------- .../test/android_camera_camerax_test.dart | 65 +++++++----------- 3 files changed, 61 insertions(+), 72 deletions(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index f5e4b89594f5..2184b151e355 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.5.0+37 -* Implements `setFocusMode`, reaching feature parity with `camera/camera_android_camerax`. +* Implements `setFocusMode`. ## 0.5.0+36 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 c70bff6442a3..3b50a9cdb405 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 @@ -196,12 +196,12 @@ class AndroidCameraCameraX extends CameraPlatform { /// Current focus mode set via [setFocusMode]. /// - /// CameraX defaults to auto-focus mode. + /// CameraX defaults to auto focus mode. FocusMode _currentFocusMode = FocusMode.auto; /// Current exposure mode set via [setExposureMode]. /// - /// CameraX defaults to auto-exposure mode. + /// CameraX defaults to auto exposure mode. ExposureMode _currentExposureMode = ExposureMode.auto; /// Whether or not a default focus point of the entire sensor area was focused @@ -475,8 +475,8 @@ class AndroidCameraCameraX extends CameraPlatform { // We lock the new focus and metering action if focus mode has been locked // to ensure that the current focus point remains locked. Any exposure mode // setting will not be impacted by this lock (setting an exposure mode - // is implemented with Camera2 interop that will override any settings - // to achieve the expected exposure mode as needed). + // is implemented with Camera2 interop that will override settings to + // achieve the expected exposure mode as needed). final bool disableAutoCancel = _currentFocusMode == FocusMode.locked; await _startFocusAndMeteringForPoint( point: point, @@ -508,7 +508,8 @@ class AndroidCameraCameraX extends CameraPlatform { /// /// Setting [FocusMode.locked] will lock current focus point if one exists or /// center of entire sensor area if not and will stay locked until either: - /// * Another focus point is set via [setFocusPoint], or + /// * Another focus point is set via [setFocusPoint] (which will then become + /// the locked focus point), or /// * Locked focus mode is unset by setting [FocusMode.auto]. @override Future setFocusMode(int cameraId, FocusMode mode) async { @@ -533,7 +534,8 @@ class AndroidCameraCameraX extends CameraPlatform { _defaultFocusPointLocked = false; await _startFocusAndMeteringFor( - point: autoAfPoint, meteringMode: FocusMeteringAction.flagAf); + meteringPoint: autoAfPoint, + meteringMode: FocusMeteringAction.flagAf); case FocusMode.locked: MeteringPoint? lockedAfPoint; @@ -556,14 +558,14 @@ class AndroidCameraCameraX extends CameraPlatform { } await _startFocusAndMeteringFor( - point: lockedAfPoint, + meteringPoint: lockedAfPoint, meteringMode: FocusMeteringAction.flagAf, disableAutoCancel: true); } // Update current focus mode. _currentFocusMode = mode; - // If focus mode was just locked and exposure mode is not, unlock exposure + // If focus mode was just locked and exposure mode is not, set auto exposure // mode to ensure that disabling auto-cancel does not interfere with // automatic exposure metering. if (_currentExposureMode == ExposureMode.auto && @@ -640,8 +642,8 @@ class AndroidCameraCameraX extends CameraPlatform { // We lock the new focus and metering action if focus mode has been locked // to ensure that the current focus point remains locked. Any exposure mode // setting will not be impacted by this lock (setting an exposure mode - // is implemented with Camera2 interop that will override any settings - // to achieve the expected exposure mode as needed). + // is implemented with Camera2 interop that will override settings to + // achieve the expected exposure mode as needed). await _startFocusAndMeteringForPoint( point: point, meteringMode: FocusMeteringAction.flagAf, @@ -667,6 +669,7 @@ class AndroidCameraCameraX extends CameraPlatform { )>[(CaptureRequestKeySupportedType.controlAeLock, lockExposureMode)]); await camera2Control.addCaptureRequestOptions(captureRequestOptions); + _currentExposureMode = mode; } /// Gets the maximum supported zoom level for the selected camera. @@ -1194,7 +1197,7 @@ class AndroidCameraCameraX extends CameraPlatform { required int meteringMode, bool disableAutoCancel = false}) async { await _startFocusAndMeteringFor( - point: point == null + meteringPoint: point == null ? null : proxy.createMeteringPoint( point.x, point.y, /* size */ null, cameraInfo!), @@ -1204,28 +1207,30 @@ class AndroidCameraCameraX extends CameraPlatform { /// Starts a focus and metering action. /// - /// 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. If no current - /// action exists, only the specified [point] will be set. Thus, the focus - /// and metering action started will only contain at most the one most - /// recently set point for each metering mode: AF, AE, AWB. + /// This method will modify and start the current action's [MeteringPoint]s + /// overriden with the [meteringPoint] provided for the specified + /// [meteringMode] type only, with all other metering points of other modes + /// left untouched. If no current action exists, only the specified + /// [meteringPoint] will be set. Thus, the focus and metering action started + /// will only contain at most the one most recently set metering point for + /// each metering mode: AF, AE, AWB. /// - /// Thus, if [point] is non-null, this action includes: + /// 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 - /// [point] (if [currentFocusMeteringAction] is non-null) and - /// * [point] with the specified [meteringMode]. - /// If [point] is null, this action includes only metering points and + /// [meteringPoint] (if [currentFocusMeteringAction] is non-null) 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 [point] (if [currentFocusMeteringAction] is - /// non-null). If there are no such metering points, then the previously - /// enabled focus and metering actions will be canceled. + /// share a metering mode with [meteringPoint] (if + /// [currentFocusMeteringAction] is non-null). If there are no such metering + /// points, then the previously enabled focus and metering actions will be + /// canceled. Future _startFocusAndMeteringFor( - {required MeteringPoint? point, + {required MeteringPoint? meteringPoint, required int meteringMode, bool disableAutoCancel = false}) async { - if (point == null) { + if (meteringPoint == null) { // Try to clear any metering point from previous action with the specified // meteringMode. if (currentFocusMeteringAction == null) { @@ -1256,9 +1261,12 @@ class AndroidCameraCameraX extends CameraPlatform { } currentFocusMeteringAction = proxy.createFocusMeteringAction( newMeteringPointInfos, disableAutoCancel); - } else if (point.x < 0 || point.x > 1 || point.y < 0 || point.y > 1) { + } else if (meteringPoint.x < 0 || + meteringPoint.x > 1 || + meteringPoint.y < 0 || + meteringPoint.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.'); + 'The coordinates of a metering point for an auto-focus or auto-exposure action must be within (0,0) and (1,1), but a point with coordinates (${meteringPoint.x}, ${meteringPoint.y}) 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 @@ -1276,7 +1284,7 @@ class AndroidCameraCameraX extends CameraPlatform { meteringPointInfo.$2 != meteringMode) .toList(); } - newMeteringPointInfos.add((point, meteringMode)); + newMeteringPointInfos.add((meteringPoint, meteringMode)); currentFocusMeteringAction = proxy.createFocusMeteringAction( newMeteringPointInfos, disableAutoCancel); } 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 810831936eca..ba3d14b16550 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 @@ -122,8 +122,8 @@ void main() { /// CameraXProxy for testing exposure and focus related controls. /// - /// Modifies the creation of MeteringPoints and FocusMeteringActions to return - /// objects detached from a native object. + /// Modifies the creation of [MeteringPoint]s and [FocusMeteringAction]s to + /// return objects detached from a native object. CameraXProxy getProxyForExposureAndFocus() => CameraXProxy( createMeteringPoint: (double x, double y, double? size, CameraInfo cameraInfo) => @@ -137,12 +137,12 @@ void main() { disableAutoCancel: disableAutoCancel), ); - /// CameraXProxy for testing setting focus mode. + /// CameraXProxy for testing setting focus and exposure points. /// /// Modifies the retrieval of a [Camera2CameraControl] instance to depend on /// interaction with expected [cameraControl] instance and modifies creation - /// of [CaptureRequestOptions to return objects detached from a native object. - CameraXProxy getProxyForSettingFocusPoint( + /// of [CaptureRequestOptions] to return objects detached from a native object. + CameraXProxy getProxyForSettingFocusandExposurePoints( CameraControl cameraControlForComparison, Camera2CameraControl camera2cameraControl) { final CameraXProxy proxy = getProxyForExposureAndFocus(); @@ -2294,7 +2294,7 @@ void main() { camera.cameraControl = mockCameraControl; camera.cameraInfo = MockCameraInfo(); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, MockCamera2CameraControl()); // Test not disabling auto cancel. @@ -2316,6 +2316,7 @@ void main() { verificationResult = verify(mockCameraControl.startFocusAndMetering(captureAny)); capturedAction = verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); }); test( @@ -2591,7 +2592,7 @@ void main() { camera.cameraControl = mockCameraControl; camera.cameraInfo = MockCameraInfo(); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, MockCamera2CameraControl()); // Test not disabling auto cancel. @@ -2615,6 +2616,7 @@ void main() { verificationResult = verify(mockCameraControl.startFocusAndMetering(captureAny)); capturedAction = verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); }); test( @@ -2648,7 +2650,7 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); // Set exposure points. @@ -2673,7 +2675,6 @@ void main() { final List<(MeteringPoint, int?)> capturedMeteringPointInfos = capturedAction.meteringPointInfos; expect(capturedMeteringPointInfos.length, equals(1)); - expect(capturedMeteringPointInfos.length, equals(1)); expect(capturedMeteringPointInfos.first.$1.x, equals(exposurePointX)); expect(capturedMeteringPointInfos.first.$1.y, equals(exposurePointY)); expect(capturedMeteringPointInfos.first.$1.size, isNull); @@ -2697,12 +2698,9 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - // Lock focus default focus point. await camera.setFocusMode(cameraId, FocusMode.locked); @@ -2730,12 +2728,9 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - // Lock a focus point. await camera.setFocusPoint( cameraId, const Point(focusPointX, focusPointY)); @@ -2756,12 +2751,13 @@ void main() { expect(capturedMeteringPointInfos.length, equals(1)); expect(capturedMeteringPointInfos.first.$1.x, equals(focusPointX)); expect(capturedMeteringPointInfos.first.$1.y, equals(focusPointY)); + expect(capturedMeteringPointInfos.first.$1.size, isNull); expect(capturedMeteringPointInfos.first.$2, equals(FocusMeteringAction.flagAf)); }); test( - 'setFocusMode starts expected focus and metering action with default auto-focus point if setting locked focus mode and current focus and metering action has auto-focus point', + 'setFocusMode starts expected focus and metering action with previously set auto-focus point if setting locked focus mode and current focus and metering action has auto-focus point', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 7; @@ -2778,12 +2774,9 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - // Set a focus point. await camera.setFocusPoint( cameraId, const Point(focusPointX, focusPointY)); @@ -2810,7 +2803,7 @@ void main() { }); test( - 'setFocusMode starts expected focus and metering action with default auto-focus point if setting locked focus mode and current focus and metering action has auto-focus point amongst others', + 'setFocusMode starts expected focus and metering action with previously set auto-focus point if setting locked focus mode and current focus and metering action has auto-focus point amongst others', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 8; @@ -2829,13 +2822,10 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - - // Set a focus point. + // Set focus and exposure points. await camera.setFocusPoint( cameraId, const Point(focusPointX, focusPointY)); await camera.setExposurePoint( @@ -2874,6 +2864,7 @@ void main() { expect(exposurePoints.length, equals(1)); expect(exposurePoints.first.$1.x, equals(exposurePointX)); expect(exposurePoints.first.$1.y, equals(exposurePointY)); + expect(exposurePoints.first.$1.size, isNull); }); test( @@ -2897,12 +2888,9 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - // Set an exposure point (creates a current focus and metering action // without a focus point). await camera.setExposurePoint( @@ -2963,12 +2951,9 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - // Lock focus point. await camera.setFocusMode(cameraId, FocusMode.locked); @@ -2982,7 +2967,6 @@ void main() { final List<(MeteringPoint, int?)> capturedMeteringPointInfos = capturedAction.meteringPointInfos; expect(capturedMeteringPointInfos.length, equals(1)); - expect(capturedMeteringPointInfos.length, equals(1)); expect(capturedMeteringPointInfos.first.$1.x, equals(defaultFocusPointX)); expect(capturedMeteringPointInfos.first.$1.y, equals(defaultFocusPointY)); expect(capturedMeteringPointInfos.first.$1.size, @@ -2995,7 +2979,7 @@ void main() { 'setFocusMode re-sets exposure mode if setting locked focus mode while using auto exposure mode', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); - const int cameraId = 10; + const int cameraId = 11; final MockCameraControl mockCameraControl = MockCameraControl(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); @@ -3007,12 +2991,9 @@ void main() { when(mockCamera2CameraControl.addCaptureRequestOptions(any)) .thenAnswer((_) async => Future.value()); - camera.proxy = getProxyForSettingFocusPoint( + camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); - // Tell plugin that there is no current focus and metering action. - camera.currentFocusMeteringAction = null; - // Set auto exposure mode. await camera.setExposureMode(cameraId, ExposureMode.auto); clearInteractions(mockCamera2CameraControl); From faa61c569300b34edf00f03e77d08499e8c702ce Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 14:44:14 -0800 Subject: [PATCH 17/27] Java fixes --- .../flutter/plugins/camerax/CameraAndroidCameraxPlugin.java | 3 --- .../io/flutter/plugins/camerax/FocusMeteringActionTest.java | 6 +++--- 2 files changed, 3 insertions(+), 6 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 fa8d672356f0..42f6106d255c 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 @@ -40,9 +40,6 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity @VisibleForTesting public @Nullable LiveDataHostApiImpl liveDataHostApiImpl; - @VisibleForTesting @Nullable - public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl; - /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. * diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java index d45696655d4b..6d96d3036cd7 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/FocusMeteringActionTest.java @@ -99,7 +99,8 @@ public void hostApiCreate_createsExpectedFocusMeteringActionWithInitialPointThat } @Test - public void hostApiCreate_createsExpectedFocusMeteringActionWithInitialPointThatDoesNotHaveMode() { + public void + hostApiCreate_createsExpectedFocusMeteringActionWithInitialPointThatDoesNotHaveMode() { FocusMeteringActionHostApiImpl.FocusMeteringActionProxy proxySpy = spy(new FocusMeteringActionHostApiImpl.FocusMeteringActionProxy()); FocusMeteringActionHostApiImpl hostApi = @@ -175,8 +176,7 @@ public void hostApiCreate_disablesAutoCancelAsExpected() { .thenReturn(mockFocusMeteringActionBuilder); when(mockFocusMeteringActionBuilder.build()).thenReturn(focusMeteringAction); - List mockMeteringPointInfos = - Arrays.asList(fakeMeteringPointInfo); + List mockMeteringPointInfos = Arrays.asList(fakeMeteringPointInfo); // Test not disabling auto cancel. hostApi.create(73L, mockMeteringPointInfos, /* disableAutoCancel */ null); From d025a7969b89c3d359751f89dfde0628bac1609d Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 14:59:01 -0800 Subject: [PATCH 18/27] Nits --- .../plugins/camerax/CameraAndroidCameraxPlugin.java | 5 ----- .../lib/src/android_camera_camerax.dart | 11 +++++------ 2 files changed, 5 insertions(+), 11 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 42f6106d255c..6a30074a2f87 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 @@ -134,11 +134,6 @@ public void setUp( binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager)); meteringPointHostApiImpl = new MeteringPointHostApiImpl(instanceManager); GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, meteringPointHostApiImpl); - camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context); - GeneratedCameraXLibrary.Camera2CameraControlHostApi.setup( - binaryMessenger, camera2CameraControlHostApiImpl); - GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup( - binaryMessenger, new CaptureRequestOptionsHostApiImpl(instanceManager)); } @Override 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 3b50a9cdb405..b611360bb1ec 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 @@ -1220,12 +1220,11 @@ class AndroidCameraCameraX extends CameraPlatform { /// [currentFocusMeteringAction] that do not share a metering mode with /// [meteringPoint] (if [currentFocusMeteringAction] is non-null) 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 - /// [currentFocusMeteringAction] is non-null). If there are no such metering - /// points, then the previously enabled focus and metering actions will be - /// canceled. + /// If [meteringPoint] is null and [currentFocusMeteringAction] is non-null, + /// this action includes only metering points and their modes previously added + /// to [currentFocusMeteringAction] that do not share a metering mode with + /// [meteringPoint]. If [meteringPoint] and [currentFocusMeteringAction] are + /// null, then focus and metering will be canceled. Future _startFocusAndMeteringFor( {required MeteringPoint? meteringPoint, required int meteringMode, From f8d1a6dfbf86f9c3a3c999be7803317bd4f81e95 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 27 Feb 2024 15:17:27 -0800 Subject: [PATCH 19/27] Add scott warning --- .../lib/src/android_camera_camerax.dart | 6 ++++++ 1 file changed, 6 insertions(+) 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 b611360bb1ec..48cc635799f0 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 @@ -469,6 +469,9 @@ class AndroidCameraCameraX extends CameraPlatform { /// Supplying `null` for the [point] argument will result in resetting to the /// original exposure point value. /// + /// Supplied non-null point must be mapped to the entire un-altered preview + /// surface for the exposure point to be applied accurately. + /// /// [cameraId] is not used. @override Future setExposurePoint(int cameraId, Point? point) async { @@ -636,6 +639,9 @@ class AndroidCameraCameraX extends CameraPlatform { /// Supplying `null` for the [point] argument will result in resetting to the /// original focus point value. /// + /// Supplied non-null point must be mapped to the entire un-altered preview + /// surface for the focus point to be applied accurately. + /// /// [cameraId] is not used. @override Future setFocusPoint(int cameraId, Point? point) async { From 7b2fb39b7cdbcddcc2faadcb51bd0853769415f6 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 6 Mar 2024 09:52:02 -0800 Subject: [PATCH 20/27] Address part of review + bump version to 0.6.0 --- .../camera_android_camerax/CHANGELOG.md | 4 ++-- .../FocusMeteringActionHostApiImpl.java | 1 - .../lib/src/android_camera_camerax.dart | 20 ++++++++++--------- .../camera_android_camerax/pubspec.yaml | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 2184b151e355..810e83b850fe 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,6 +1,6 @@ -## 0.5.0+37 +## 0.6.0 -* Implements `setFocusMode`. +* Implements `setFocusMode`, which makes plugin reach feature parity with camera_android. ## 0.5.0+36 diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java index f26159ec47c8..dcda333c2e90 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/FocusMeteringActionHostApiImpl.java @@ -62,7 +62,6 @@ public static class FocusMeteringActionProxy { } } - // Disable auto-cancel if specified. if (disableAutoCancel != null && disableAutoCancel == true) { focusMeteringActionBuilder.disableAutoCancel(); } 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 48cc635799f0..6fc72c5edcef 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 @@ -509,8 +509,9 @@ class AndroidCameraCameraX extends CameraPlatform { /// Sets the focus mode for taking pictures. /// - /// Setting [FocusMode.locked] will lock current focus point if one exists or - /// center of entire sensor area if not and will stay locked until either: + /// Setting [FocusMode.locked] will lock the current focus point if one exists + /// or the center of entire sensor area if not, and will stay locked until + /// either: /// * Another focus point is set via [setFocusPoint] (which will then become /// the locked focus point), or /// * Locked focus mode is unset by setting [FocusMode.auto]. @@ -526,7 +527,7 @@ class AndroidCameraCameraX extends CameraPlatform { // Determine auto-focus point to restore, if any. We do not restore // default auto-focus point if set previously to lock focus. - final MeteringPoint? autoAfPoint = _defaultFocusPointLocked + final MeteringPoint? autoFocusPoint = _defaultFocusPointLocked ? null : currentFocusMeteringAction!.meteringPointInfos .where(((MeteringPoint, int?) meteringPointInfo) => @@ -537,10 +538,10 @@ class AndroidCameraCameraX extends CameraPlatform { _defaultFocusPointLocked = false; await _startFocusAndMeteringFor( - meteringPoint: autoAfPoint, + meteringPoint: autoFocusPoint, meteringMode: FocusMeteringAction.flagAf); case FocusMode.locked: - MeteringPoint? lockedAfPoint; + MeteringPoint? lockedFocusPoint; // Determine if there is an auto-focus point set currently to lock. if (currentFocusMeteringAction != null) { @@ -549,19 +550,20 @@ class AndroidCameraCameraX extends CameraPlatform { .where(((MeteringPoint, int?) meteringPointInfo) => meteringPointInfo.$2 == FocusMeteringAction.flagAf) .toList(); - lockedAfPoint = possibleCurrentAfPoints.isEmpty + lockedFocusPoint = possibleCurrentAfPoints.isEmpty ? null : possibleCurrentAfPoints.first.$1; } // If there isn't, lock center of entire sensor area by default. - if (lockedAfPoint == null) { - lockedAfPoint = proxy.createMeteringPoint(0.5, 0.5, 1, cameraInfo!); + if (lockedFocusPoint == null) { + lockedFocusPoint = + proxy.createMeteringPoint(0.5, 0.5, 1, cameraInfo!); _defaultFocusPointLocked = true; } await _startFocusAndMeteringFor( - meteringPoint: lockedAfPoint, + meteringPoint: lockedFocusPoint, meteringMode: FocusMeteringAction.flagAf, disableAutoCancel: true); } diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 3e65612b83ff..a1a44f06f366 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+37 +version: 0.6.0 environment: sdk: ^3.1.0 From 7ff3bc6c491d04a8d457b582f7443acac942936a Mon Sep 17 00:00:00 2001 From: camsim99 Date: Fri, 8 Mar 2024 15:22:59 -0800 Subject: [PATCH 21/27] Use results --- .../lib/src/android_camera_camerax.dart | 45 ++++++++++++------- .../lib/src/camera_control.dart | 4 +- 2 files changed, 32 insertions(+), 17 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 6fc72c5edcef..f4c58158e4d4 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 @@ -26,6 +26,7 @@ import 'device_orientation_manager.dart'; import 'exposure_state.dart'; import 'fallback_strategy.dart'; import 'focus_metering_action.dart'; +import 'focus_metering_result.dart'; import 'image_analysis.dart'; import 'image_capture.dart'; import 'image_proxy.dart'; @@ -517,6 +518,8 @@ class AndroidCameraCameraX extends CameraPlatform { /// * Locked focus mode is unset by setting [FocusMode.auto]. @override Future setFocusMode(int cameraId, FocusMode mode) async { + MeteringPoint? autoFocusPoint; + bool? disableAutoCancel; switch (mode) { case FocusMode.auto: if (_currentFocusMode == FocusMode.auto) { @@ -527,7 +530,7 @@ class AndroidCameraCameraX extends CameraPlatform { // Determine auto-focus point to restore, if any. We do not restore // default auto-focus point if set previously to lock focus. - final MeteringPoint? autoFocusPoint = _defaultFocusPointLocked + final MeteringPoint? unLockedFocusPoint = _defaultFocusPointLocked ? null : currentFocusMeteringAction!.meteringPointInfos .where(((MeteringPoint, int?) meteringPointInfo) => @@ -536,10 +539,8 @@ class AndroidCameraCameraX extends CameraPlatform { .first .$1; _defaultFocusPointLocked = false; - - await _startFocusAndMeteringFor( - meteringPoint: autoFocusPoint, - meteringMode: FocusMeteringAction.flagAf); + autoFocusPoint = unLockedFocusPoint; + disableAutoCancel = false; case FocusMode.locked: MeteringPoint? lockedFocusPoint; @@ -562,11 +563,20 @@ class AndroidCameraCameraX extends CameraPlatform { _defaultFocusPointLocked = true; } - await _startFocusAndMeteringFor( - meteringPoint: lockedFocusPoint, - meteringMode: FocusMeteringAction.flagAf, - disableAutoCancel: true); + autoFocusPoint = lockedFocusPoint; + disableAutoCancel = true; } + // Start appropriate focus and metering action. + final bool focusAndMeteringWasSuccessful = await _startFocusAndMeteringFor( + meteringPoint: autoFocusPoint, + meteringMode: FocusMeteringAction.flagAf, + disableAutoCancel: disableAutoCancel); + + if (!focusAndMeteringWasSuccessful) { + // Do not update current focus mode. + return; + } + // Update current focus mode. _currentFocusMode = mode; @@ -1200,11 +1210,11 @@ class AndroidCameraCameraX extends CameraPlatform { // Methods for configuring auto-focus and auto-exposure: - Future _startFocusAndMeteringForPoint( + Future _startFocusAndMeteringForPoint( {required Point? point, required int meteringMode, bool disableAutoCancel = false}) async { - await _startFocusAndMeteringFor( + return _startFocusAndMeteringFor( meteringPoint: point == null ? null : proxy.createMeteringPoint( @@ -1213,7 +1223,8 @@ class AndroidCameraCameraX extends CameraPlatform { disableAutoCancel: disableAutoCancel); } - /// Starts a focus and metering action. + /// Starts a focus and metering action and returns whether or not it was + /// successful. /// /// This method will modify and start the current action's [MeteringPoint]s /// overriden with the [meteringPoint] provided for the specified @@ -1233,7 +1244,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// to [currentFocusMeteringAction] that do not share a metering mode with /// [meteringPoint]. If [meteringPoint] and [currentFocusMeteringAction] are /// null, then focus and metering will be canceled. - Future _startFocusAndMeteringFor( + Future _startFocusAndMeteringFor( {required MeteringPoint? meteringPoint, required int meteringMode, bool disableAutoCancel = false}) async { @@ -1243,7 +1254,7 @@ class AndroidCameraCameraX extends CameraPlatform { if (currentFocusMeteringAction == null) { // Attempting to clear a metering point from a previous action, but no // such action exists. - return; + return false; } // Remove metering point with specified meteringMode from current focus @@ -1264,7 +1275,7 @@ class AndroidCameraCameraX extends CameraPlatform { // started focus and metering actions. await cameraControl.cancelFocusAndMetering(); currentFocusMeteringAction = null; - return; + return true; } currentFocusMeteringAction = proxy.createFocusMeteringAction( newMeteringPointInfos, disableAutoCancel); @@ -1296,6 +1307,8 @@ class AndroidCameraCameraX extends CameraPlatform { newMeteringPointInfos, disableAutoCancel); } - await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); + final FocusMeteringResult? result = + await cameraControl.startFocusAndMetering(currentFocusMeteringAction!); + return await result?.isFocusSuccessful() ?? false; } } 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 a233011975f0..0a307f3afc4a 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -153,7 +153,9 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { } on PlatformException catch (e) { SystemServices.cameraErrorStreamController .add(e.message ?? 'Starting focus and metering failed.'); - return Future.value(); + // Surfacing error to differentiate an operation cancellation from an + // illegal argument exception at a plugin layer. + rethrow; } } From 81d045305233c961fd06f206a341bf26a0508ec9 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 11 Mar 2024 09:07:48 -0700 Subject: [PATCH 22/27] Add todo fix resetting mode --- .../lib/src/android_camera_camerax.dart | 11 +++++------ .../lib/src/camera_control.dart | 2 +- 2 files changed, 6 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 f4c58158e4d4..49c2eb011b94 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 @@ -518,16 +518,15 @@ class AndroidCameraCameraX extends CameraPlatform { /// * Locked focus mode is unset by setting [FocusMode.auto]. @override Future setFocusMode(int cameraId, FocusMode mode) async { + if (_currentFocusMode == mode) { + // Desired focus mode is already set. + return; + } + MeteringPoint? autoFocusPoint; bool? disableAutoCancel; switch (mode) { case FocusMode.auto: - if (_currentFocusMode == FocusMode.auto) { - // CameraX uses auto-focus mode by default, so no need to reconfigure - // auto-focus if already set. - return; - } - // Determine auto-focus point to restore, if any. We do not restore // default auto-focus point if set previously to lock focus. final MeteringPoint? unLockedFocusPoint = _defaultFocusPointLocked 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 0a307f3afc4a..b0afe6a6f34f 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -155,7 +155,7 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { .add(e.message ?? 'Starting focus and metering failed.'); // Surfacing error to differentiate an operation cancellation from an // illegal argument exception at a plugin layer. - rethrow; + rethrow; // TODO(camsim99): determine if I want to do this or do similar thing for other methods } } From 1ec2045e8795f03af435d78db3263c6806333413 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 11 Mar 2024 10:29:18 -0700 Subject: [PATCH 23/27] Final fixes --- packages/camera/camera_android_camerax/CHANGELOG.md | 1 + .../lib/src/android_camera_camerax.dart | 12 ++++++++++-- .../lib/src/camera_control.dart | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 810e83b850fe..02a8e6c74f92 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.6.0 * Implements `setFocusMode`, which makes plugin reach feature parity with camera_android. +* Fixes `setExposureCompensationIndex` return value to use index returned by CameraX. ## 0.5.0+36 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 49c2eb011b94..bf975d7923f7 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 @@ -190,6 +190,10 @@ class AndroidCameraCameraX extends CameraPlatform { /// for an example on how setting target rotations for [UseCase]s works. bool shouldSetDefaultRotation = false; + /// Error code indicating that an exposure offset value failed to be set. + static const String setExposureOffsetFailedErrorCode = + 'setExposureOffsetFailed'; + /// The currently set [FocusMeteringAction] used to enable auto-focus and /// auto-exposure. @visibleForTesting @@ -634,11 +638,15 @@ class AndroidCameraCameraX extends CameraPlatform { (offset / exposureOffsetStepSize).round(); try { - await cameraControl + final int? newIndex = await cameraControl .setExposureCompensationIndex(roundedExposureCompensationIndex); + if (newIndex == null) { + throw CameraException(setExposureOffsetFailedErrorCode, + 'Setting exposure compensation index was canceled due to the camera being closed or a new request being submitted.'); + } } on PlatformException catch (e) { throw CameraException( - 'setExposureOffsetFailed', + setExposureOffsetFailedErrorCode, e.message ?? 'Setting the camera exposure compensation index failed.'); } 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 b0afe6a6f34f..0a307f3afc4a 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_control.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_control.dart @@ -155,7 +155,7 @@ class _CameraControlHostApiImpl extends CameraControlHostApi { .add(e.message ?? 'Starting focus and metering failed.'); // Surfacing error to differentiate an operation cancellation from an // illegal argument exception at a plugin layer. - rethrow; // TODO(camsim99): determine if I want to do this or do similar thing for other methods + rethrow; } } From 92123c38451521961dddae4ab447f03f6033357c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 11 Mar 2024 11:20:06 -0700 Subject: [PATCH 24/27] Fix tests --- .../lib/src/android_camera_camerax.dart | 3 +- .../test/android_camera_camerax_test.dart | 58 +++++++++++++++++++ .../android_camera_camerax_test.mocks.dart | 17 ++++++ 3 files changed, 77 insertions(+), 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 bf975d7923f7..2ec30585ed6c 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 @@ -644,13 +644,14 @@ class AndroidCameraCameraX extends CameraPlatform { throw CameraException(setExposureOffsetFailedErrorCode, 'Setting exposure compensation index was canceled due to the camera being closed or a new request being submitted.'); } + + return newIndex.toDouble(); } on PlatformException catch (e) { throw CameraException( setExposureOffsetFailedErrorCode, e.message ?? 'Setting the camera exposure compensation index failed.'); } - return roundedExposureCompensationIndex * exposureOffsetStepSize; } /// Sets the focus point for automatically determining the focus values. 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 ba3d14b16550..33727d6d20ab 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 @@ -22,6 +22,7 @@ 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/focus_metering_result.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'; @@ -63,6 +64,7 @@ import 'test_camerax_library.g.dart'; MockSpec(), MockSpec(), MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), @@ -2288,6 +2290,8 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 2; final MockCameraControl mockCameraControl = MockCameraControl(); + final FocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); const Point exposurePoint = Point(0.1, 0.2); // Set directly for test versus calling createCamera. @@ -2297,6 +2301,12 @@ void main() { camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, MockCamera2CameraControl()); + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + // Test not disabling auto cancel. await camera.setFocusMode(cameraId, FocusMode.auto); clearInteractions(mockCameraControl); @@ -2382,6 +2392,8 @@ void main() { exposureCompensationRange: ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), exposureCompensationStep: 0.2); + final int expectedExposureCompensationIndex = + (offset / exposureState.exposureCompensationStep).round(); // Set directly for test versus calling createCamera. camera.cameraInfo = mockCameraInfo; @@ -2389,6 +2401,12 @@ void main() { when(mockCameraInfo.getExposureState()) .thenAnswer((_) async => exposureState); + when(mockCameraControl + .setExposureCompensationIndex(expectedExposureCompensationIndex)) + .thenAnswer((_) async => Future.value( + (expectedExposureCompensationIndex * + exposureState.exposureCompensationStep) + .round())); // Exposure index * exposure offset step size = exposure offset, i.e. // 15 * 0.2 = 3. @@ -2586,6 +2604,8 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 2; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); const Point exposurePoint = Point(0.1, 0.2); // Set directly for test versus calling createCamera. @@ -2595,6 +2615,12 @@ void main() { camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, MockCamera2CameraControl()); + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + // Test not disabling auto cancel. await camera.setFocusMode(cameraId, FocusMode.auto); clearInteractions(mockCameraControl); @@ -2638,6 +2664,8 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 5; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); const double exposurePointX = 0.2; @@ -2653,6 +2681,12 @@ void main() { camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + // Set exposure points. await camera.setExposurePoint( cameraId, const Point(exposurePointX, exposurePointY)); @@ -2688,6 +2722,8 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 5; final MockCameraControl mockCameraControl = MockCameraControl(); + final FocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); @@ -2701,6 +2737,12 @@ void main() { camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + // Lock focus default focus point. await camera.setFocusMode(cameraId, FocusMode.locked); @@ -2716,6 +2758,8 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 6; final MockCameraControl mockCameraControl = MockCameraControl(); + final FocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); const double focusPointX = 0.1; @@ -2731,6 +2775,12 @@ void main() { camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + // Lock a focus point. await camera.setFocusPoint( cameraId, const Point(focusPointX, focusPointY)); @@ -2981,6 +3031,8 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 11; final MockCameraControl mockCameraControl = MockCameraControl(); + final FocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); final MockCamera2CameraControl mockCamera2CameraControl = MockCamera2CameraControl(); @@ -2994,6 +3046,12 @@ void main() { camera.proxy = getProxyForSettingFocusandExposurePoints( mockCameraControl, mockCamera2CameraControl); + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + // Set auto exposure mode. await camera.setExposureMode(cameraId, ExposureMode.auto); clearInteractions(mockCamera2CameraControl); diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart index 4ed047ae3770..80d76d8339ca 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart @@ -582,6 +582,23 @@ class MockFallbackStrategy extends _i1.Mock implements _i25.FallbackStrategy { ) as _i7.VideoResolutionFallbackRule); } +/// A class which mocks [FocusMeteringResult]. +/// +/// See the documentation for Mockito's code generation for more information. +// ignore: must_be_immutable +class MockFocusMeteringResult extends _i1.Mock + implements _i20.FocusMeteringResult { + @override + _i16.Future isFocusSuccessful() => (super.noSuchMethod( + Invocation.method( + #isFocusSuccessful, + [], + ), + returnValue: _i16.Future.value(false), + returnValueForMissingStub: _i16.Future.value(false), + ) as _i16.Future); +} + /// A class which mocks [ImageAnalysis]. /// /// See the documentation for Mockito's code generation for more information. From b3d72cb4f99e8edb6a573fd43fd62710757c7318 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 11 Mar 2024 14:55:01 -0700 Subject: [PATCH 25/27] Add additional tests --- .../lib/src/android_camera_camerax.dart | 3 +- .../test/android_camera_camerax_test.dart | 242 +++++++++++++++++- 2 files changed, 242 insertions(+), 3 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 2ec30585ed6c..1612ab512d32 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 @@ -485,11 +485,10 @@ class AndroidCameraCameraX extends CameraPlatform { // setting will not be impacted by this lock (setting an exposure mode // is implemented with Camera2 interop that will override settings to // achieve the expected exposure mode as needed). - final bool disableAutoCancel = _currentFocusMode == FocusMode.locked; await _startFocusAndMeteringForPoint( point: point, meteringMode: FocusMeteringAction.flagAe, - disableAutoCancel: disableAutoCancel); + disableAutoCancel: _currentFocusMode == FocusMode.locked); } /// Gets the minimum supported exposure offset for the selected camera in EV units. 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 33727d6d20ab..d9ff081383e9 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 @@ -2352,7 +2352,7 @@ void main() { }); test( - 'setExposureOffset throws exception if exposure compensation could not be set', + 'setExposureOffset throws exception if exposure compensation could not be set for unknown reason', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 11; @@ -2380,6 +2380,35 @@ void main() { throwsA(isA())); }); + test( + 'setExposureOffset throws exception if exposure compensation could not be set due to camera being closed or newer value being set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 21; + const double offset = 5; + final MockCameraInfo mockCameraInfo = MockCameraInfo(); + final CameraControl mockCameraControl = MockCameraControl(); + final ExposureState exposureState = ExposureState.detached( + exposureCompensationRange: + ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), + exposureCompensationStep: 0.1); + final int expectedExposureCompensationIndex = + (offset / exposureState.exposureCompensationStep).round(); + + // Set directly for test versus calling createCamera. + camera.cameraInfo = mockCameraInfo; + camera.cameraControl = mockCameraControl; + + when(mockCameraInfo.getExposureState()) + .thenAnswer((_) async => exposureState); + when(mockCameraControl + .setExposureCompensationIndex(expectedExposureCompensationIndex)) + .thenAnswer((_) async => Future.value()); + + expect(() => camera.setExposureOffset(cameraId, offset), + throwsA(isA())); + }); + test( 'setExposureOffset behaves as expected to successful attempt to set exposure compensation index', () async { @@ -2651,6 +2680,36 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const int cameraId = 4; final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForSettingFocusandExposurePoints( + mockCameraControl, MockCamera2CameraControl()); + + // Make setting focus and metering action successful for test. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + + // Set locked focus mode and then try to re-set it. + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); + + await camera.setFocusMode(cameraId, FocusMode.locked); + verifyNoMoreInteractions(mockCameraControl); + }); + + test( + 'setFocusMode does nothing if setting locked focus mode and is already using locked focus mode', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 4; + final MockCameraControl mockCameraControl = MockCameraControl(); // Camera uses auto-focus by default, so try setting auto mode again. await camera.setFocusMode(cameraId, FocusMode.auto); @@ -3070,4 +3129,185 @@ void main() { equals(CaptureRequestKeySupportedType.controlAeLock)); expect(requestedOptions.first.$2, equals(false)); }); + + test( + 'setFocusPoint disables auto-cancel if auto focus mode fails to be set after locked focus mode is set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 22; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); + const Point focusPoint = Point(0.21, 0.21); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForSettingFocusandExposurePoints( + mockCameraControl, MockCamera2CameraControl()); + + // Make setting focus and metering action successful to set locked focus + // mode. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + + // Set exposure point to later mock failed call to set an exposure point ( + // otherwise, focus and metering will be canceled altogether, which is + //considered a successful call). + await camera.setExposurePoint(cameraId, const Point(0.3, 0.4)); + + // Set locked focus mode so we can set auto mode (cannot set auto mode + // directly since it is the default). + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); + + // Make setting focus and metering action fail to test that auto-cancel is + // still disabled. + reset(mockFocusMeteringResult); + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(false)); + + // Test disabling auto cancel. + await camera.setFocusMode(cameraId, FocusMode.auto); + clearInteractions(mockCameraControl); + + await camera.setFocusPoint(cameraId, focusPoint); + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); + }); + + test( + 'setExposurePoint disables auto-cancel if auto focus mode fails to be set after locked focus mode is set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 342; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); + const Point exposurePoint = Point(0.23, 0.32); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForSettingFocusandExposurePoints( + mockCameraControl, MockCamera2CameraControl()); + + // Make setting focus and metering action successful to set locked focus + // mode. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(true)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + + // Set exposure point to later mock failed call to set an exposure point ( + // otherwise, focus and metering will be canceled altogether, which is + //considered a successful call). + await camera.setExposurePoint(cameraId, const Point(0.4, 0.3)); + + // Set locked focus mode so we can set auto mode (cannot set auto mode + // directly since it is the default). + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); + + // Make setting focus and metering action fail to test that auto-cancel is + // still disabled. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(false)); + + // Test disabling auto cancel. + await camera.setFocusMode(cameraId, FocusMode.auto); + clearInteractions(mockCameraControl); + + await camera.setExposurePoint(cameraId, exposurePoint); + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isTrue); + }); + + test( + 'setFocusPoint enables auto-cancel if locked focus mode fails to be set after auto focus mode is set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 232; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); + const Point focusPoint = Point(0.221, 0.211); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForSettingFocusandExposurePoints( + mockCameraControl, MockCamera2CameraControl()); + + // Make setting focus and metering action fail to test auto-cancel is not + // disabled. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(false)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + + // Set exposure point to later mock failed call to set an exposure point. + await camera.setExposurePoint(cameraId, const Point(0.43, 0.34)); + + // Test failing to set locked focus mode. + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); + + await camera.setFocusPoint(cameraId, focusPoint); + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isFalse); + }); + + test( + 'setExposurePoint enables auto-cancel if locked focus mode fails to be set after auto focus mode is set', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + const int cameraId = 323; + final MockCameraControl mockCameraControl = MockCameraControl(); + final MockFocusMeteringResult mockFocusMeteringResult = + MockFocusMeteringResult(); + const Point exposurePoint = Point(0.223, 0.332); + + // Set directly for test versus calling createCamera. + camera.cameraControl = mockCameraControl; + camera.cameraInfo = MockCameraInfo(); + + camera.proxy = getProxyForSettingFocusandExposurePoints( + mockCameraControl, MockCamera2CameraControl()); + + // Make setting focus and metering action fail to test auto-cancel is not + // disabled. + when(mockFocusMeteringResult.isFocusSuccessful()) + .thenAnswer((_) async => Future.value(false)); + when(mockCameraControl.startFocusAndMetering(any)).thenAnswer((_) async => + Future.value(mockFocusMeteringResult)); + + // Set exposure point to later mock failed call to set an exposure point. + await camera.setExposurePoint(cameraId, const Point(0.5, 0.2)); + + // Test failing to set locked focus mode. + await camera.setFocusMode(cameraId, FocusMode.locked); + clearInteractions(mockCameraControl); + + await camera.setExposurePoint(cameraId, exposurePoint); + final VerificationResult verificationResult = + verify(mockCameraControl.startFocusAndMetering(captureAny)); + final FocusMeteringAction capturedAction = + verificationResult.captured.single as FocusMeteringAction; + expect(capturedAction.disableAutoCancel, isFalse); + }); } From 54e8fd3f54e9ee88f916541113f50409b543f12f Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 18 Mar 2024 16:26:26 -0700 Subject: [PATCH 26/27] Avoid breaking readme --- packages/camera/camera_android_camerax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index e0d5d8d6d6ab..d60a71a46c84 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -3,7 +3,7 @@ An Android implementation of [`camera`][1] that uses the [CameraX library][2]. *Note*: This package is under development, so please note the -[missing features and limitations](#missing-features-and-limitations), but +[missing features and limitations](#limitations), but otherwise feel free to try out the current implementation and provide any feedback by filing issues under [`flutter/flutter`][5] with `[camerax]` in the title, which will be actively triaged. From 95681900a49fba872f25bb1ff9190f76ce8ded66 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 19 Mar 2024 09:19:20 -0700 Subject: [PATCH 27/27] Update packages/camera/camera_android_camerax/CHANGELOG.md Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com> --- packages/camera/camera_android_camerax/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 02a8e6c74f92..2fd0eb9ed3d5 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.6.0 -* Implements `setFocusMode`, which makes plugin reach feature parity with camera_android. +* Implements `setFocusMode`, which makes this plugin reach feature parity with camera_android. * Fixes `setExposureCompensationIndex` return value to use index returned by CameraX. ## 0.5.0+36