From 7f55c0494cff36b6b35c49423bfac84bf376aa0f Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 14 Apr 2026 16:39:34 -0400 Subject: [PATCH 1/4] Update formatter version --- script/tool/lib/src/format_command.dart | 6 ++++-- script/tool/test/format_command_test.dart | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/script/tool/lib/src/format_command.dart b/script/tool/lib/src/format_command.dart index 87cc37cb411c..6da11fd2f810 100644 --- a/script/tool/lib/src/format_command.dart +++ b/script/tool/lib/src/format_command.dart @@ -39,9 +39,11 @@ const int _exitKotlinFormatFailed = 9; const int _exitSwiftLintFoundIssues = 10; const int _exitDartLanguageVersionIssue = 11; +// TODO(stuartmorgan): Update this once we require Java 21+. See +// https://github.com/google/google-java-format/releases/tag/v1.29.0. final Uri _javaFormatterUrl = Uri.https( 'github.com', - '/google/google-java-format/releases/download/google-java-format-1.3/google-java-format-1.3-all-deps.jar', + 'google/google-java-format/releases/download/v1.28.0/google-java-format-1.28.0-all-deps.jar', ); final Uri _kotlinFormatterUrl = Uri.https( 'maven.org', @@ -473,7 +475,7 @@ class FormatCommand extends PackageLoopingCommand { Future _getJavaFormatterPath() async { final String javaFormatterPath = path.join( path.dirname(path.fromUri(platform.script)), - 'google-java-format-1.3-all-deps.jar', + 'google-java-format-1.28.0-all-deps.jar', ); final File javaFormatterFile = packagesDir.fileSystem.file( javaFormatterPath, diff --git a/script/tool/test/format_command_test.dart b/script/tool/test/format_command_test.dart index c74140997e5b..aa7a7ccd6d2f 100644 --- a/script/tool/test/format_command_test.dart +++ b/script/tool/test/format_command_test.dart @@ -43,7 +43,7 @@ void main() { final p.Context path = analyzeCommand.path; javaFormatPath = path.join( path.dirname(path.fromUri(mockPlatform.script)), - 'google-java-format-1.3-all-deps.jar', + 'google-java-format-1.28.0-all-deps.jar', ); packagesDir.fileSystem.file(javaFormatPath).createSync(recursive: true); kotlinFormatPath = path.join( From 83238bba08471d63d15474c143b0ec571f5e078c Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 14 Apr 2026 16:41:17 -0400 Subject: [PATCH 2/4] Autoformat --- .../io/flutter/plugins/camera/Camera.java | 18 +- .../flutter/plugins/camera/CameraApiImpl.java | 6 +- .../io/flutter/plugins/camera/Messages.java | 37 ++++ .../plugins/camera/SdkCapabilityChecker.java | 9 +- .../features/autofocus/AutoFocusFeature.java | 3 +- .../exposurepoint/ExposurePointFeature.java | 4 +- .../focuspoint/FocusPointFeature.java | 3 +- .../resolution/ResolutionFeature.java | 36 ++-- .../DeviceOrientationManager.java | 4 +- .../features/zoomlevel/ZoomLevelFeature.java | 3 +- .../camera/media/MediaRecorderBuilder.java | 3 +- .../io/flutter/plugins/camera/CameraTest.java | 12 +- .../camerax/CameraControlProxyApi.java | 18 +- .../camerax/DeviceOrientationManager.java | 3 +- .../camerax/GeneratedCameraXLibrary.java | 98 +++++++++++ .../plugins/camerax/ImageCaptureProxyApi.java | 7 +- .../plugins/camerax/PreviewProxyApi.java | 6 +- .../VideoRecordEventListenerProxyApi.java | 1 + .../internal/protocol/impl/DartVmService.java | 9 +- .../espresso/flutter/model/WidgetInfo.java | 3 + .../file_selector_android/FileUtils.java | 9 +- .../GeneratedFileSelectorApi.java | 6 + .../FileSelectorAndroidPluginTest.java | 3 +- .../file_selector_android/FileUtilsTest.java | 6 +- .../MainActivity.java | 3 +- .../googlemaps/ClusterManagersController.java | 3 +- .../flutter/plugins/googlemaps/Convert.java | 6 +- .../googlemaps/HeatmapsController.java | 1 + .../flutter/plugins/googlemaps/Messages.java | 51 ++++++ .../googlemaps/TileProviderController.java | 3 +- .../googlemaps/GoogleMapControllerTest.java | 3 +- .../googlemaps/MarkersControllerTest.java | 12 +- .../plugins/imagepicker/FileUtils.java | 14 +- .../plugins/imagepicker/ImageResizer.java | 3 +- .../flutter/plugins/imagepicker/Messages.java | 7 + .../plugins/imagepicker/FileUtilTest.java | 3 +- .../plugins/imagepicker/ImageResizerTest.java | 3 +- .../inapppurchase/InAppPurchasePlugin.java | 5 +- .../plugins/inapppurchase/Messages.java | 21 +++ .../inapppurchase/MethodCallHandlerImpl.java | 15 +- .../plugins/inapppurchase/Translator.java | 2 +- .../InAppPurchasePluginTest.java | 21 ++- .../inapppurchase/MethodCallHandlerTest.java | 4 +- .../plugins/inapppurchase/TranslatorTest.java | 22 ++- .../java/io/flutter/plugins/Messages.java | 5 + .../CoreTests.java | 164 ++++++++++++++++++ .../NonNullFieldsTest.java | 1 - .../plugins/quickactions/Messages.java | 8 + .../plugins/quickactions/QuickActions.java | 6 +- .../quickactionsexample/QuickActionsTest.java | 6 +- .../LegacySharedPreferencesPlugin.java | 12 +- .../plugins/sharedpreferences/Messages.java | 9 + .../SharedPreferencesListEncoder.java | 1 + .../flutter/plugins/urllauncher/Messages.java | 4 + .../plugins/urllauncher/WebViewActivity.java | 3 +- .../plugins/videoplayer/VideoPlayer.java | 6 +- .../texture/TextureVideoPlayer.java | 4 +- .../webviewflutter/WebViewProxyApi.java | 3 +- .../plugins/webviewflutter/WebViewTest.java | 3 +- 59 files changed, 629 insertions(+), 115 deletions(-) diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java index b4f89adef9a3..d4cb02b1bd76 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java @@ -107,8 +107,10 @@ class Camera private CameraProperties cameraProperties; private final CameraFeatureFactory cameraFeatureFactory; private final Activity activity; + /** A {@link CameraCaptureSession.CaptureCallback} that handles events related to JPEG capture. */ private final CameraCaptureCallback cameraCaptureCallback; + /** A {@link Handler} for running tasks in the background. */ Handler backgroundHandler; @@ -119,12 +121,15 @@ class Camera CameraCaptureSession captureSession; @VisibleForTesting ImageReader pictureImageReader; ImageStreamReader imageStreamReader; + /** {@link CaptureRequest.Builder} for the camera preview */ CaptureRequest.Builder previewRequestBuilder; @VisibleForTesting MediaRecorder mediaRecorder; + /** True when recording video. */ boolean recordingVideo; + /** True when the preview is paused. */ @VisibleForTesting boolean pausedPreview; @@ -132,6 +137,7 @@ class Camera /** Holds the current capture timeouts */ private CaptureTimeoutsWrapper captureTimeouts; + /** Holds the last known capture properties */ private CameraCaptureProperties captureProps; @@ -271,8 +277,10 @@ private void prepareMediaRecorder(String outputFilePath) throws IOException { MediaRecorderBuilder mediaRecorderBuilder; - // TODO(camsim99): Revert changes that allow legacy code to be used when recordingProfile is null - // once this has largely been fixed on the Android side. https://github.com/flutter/flutter/issues/119668 + // TODO(camsim99): Revert changes that allow legacy code to be used when recordingProfile is + // null + // once this has largely been fixed on the Android side. + // https://github.com/flutter/flutter/issues/119668 if (SdkCapabilityChecker.supportsEncoderProfiles() && getRecordingProfile() != null) { mediaRecorderBuilder = new MediaRecorderBuilder( @@ -1157,7 +1165,8 @@ public void resumePreview() { public void startPreview(@Nullable Runnable onSuccessCallback) throws CameraAccessException, InterruptedException { - // If recording is already in progress, the camera is being flipped, so send it through the VideoRenderer to keep the correct orientation. + // If recording is already in progress, the camera is being flipped, so send it through the + // VideoRenderer to keep the correct orientation. if (recordingVideo) { startPreviewWithVideoRendererStream(onSuccessCallback); } else { @@ -1379,7 +1388,8 @@ public void setDescriptionWhileRecording(CameraProperties properties) { "setDescriptionWhileRecordingFailed", "Device was not recording", null); } - // See VideoRenderer.java; support for this EGL extension is required to switch camera while recording. + // See VideoRenderer.java; support for this EGL extension is required to switch camera while + // recording. if (!SdkCapabilityChecker.supportsEglRecordableAndroid()) { throw new Messages.FlutterError( "setDescriptionWhileRecordingFailed", diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java index a84c86516f37..b4632e984165 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java @@ -89,7 +89,8 @@ private Long instantiateCamera(String cameraName, Messages.PlatformMediaSettings @SuppressWarnings("ConstantConditions") private void handleException(Exception exception, Messages.Result result) { // The code below exactly preserves the format of the native exceptions generated by pre-Pigeon - // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be client + // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be + // client // code that relies on specific string values here, so these should not be changed. See // https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#platform-exception-handling // for longer-term solutions to this. @@ -102,7 +103,8 @@ private void handleException(Exception exception, Messages.Result result) private void handleException(Exception exception, Messages.VoidResult result) { // The code below exactly preserves the format of the native exceptions generated by pre-Pigeon - // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be client + // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be + // client // code that relies on specific string values here, so these should not be changed. See // https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#platform-exception-handling // for longer-term solutions to this. diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java index f0c3f2ff146f..e61e0c48c199 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java @@ -942,6 +942,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -950,6 +951,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -958,6 +960,7 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** * Handles calls from Dart to the native side. * @@ -967,81 +970,108 @@ public interface CameraApi { /** Returns the list of available cameras. */ @NonNull List getAvailableCameras(); + /** Creates a new camera with the given name and settings and returns its ID. */ void create( @NonNull String cameraName, @NonNull PlatformMediaSettings mediaSettings, @NonNull Result result); + /** Initializes the camera with the given ID for the given image format. */ void initialize(@NonNull PlatformImageFormatGroup imageFormat); + /** Disposes of the camera with the given ID. */ void dispose(); + /** Locks the camera with the given ID to the given orientation. */ void lockCaptureOrientation(@NonNull PlatformDeviceOrientation orientation); + /** Unlocks the orientation for the camera with the given ID. */ void unlockCaptureOrientation(); + /** Takes a picture on the camera with the given ID and returns a path to the resulting file. */ void takePicture(@NonNull Result result); + /** Starts recording a video on the camera with the given ID. */ void startVideoRecording(@NonNull Boolean enableStream); + /** * Ends video recording on the camera with the given ID and returns the path to the resulting * file. */ @NonNull String stopVideoRecording(); + /** Pauses video recording on the camera with the given ID. */ void pauseVideoRecording(); + /** Resumes previously paused video recording on the camera with the given ID. */ void resumeVideoRecording(); + /** Begins streaming frames from the camera. */ void startImageStream(); + /** Stops streaming frames from the camera. */ void stopImageStream(); + /** Sets the flash mode of the camera with the given ID. */ void setFlashMode(@NonNull PlatformFlashMode flashMode, @NonNull VoidResult result); + /** Sets the exposure mode of the camera with the given ID. */ void setExposureMode(@NonNull PlatformExposureMode exposureMode, @NonNull VoidResult result); + /** * Sets the exposure point of the camera with the given ID. * *

A null value resets to the default exposure point. */ void setExposurePoint(@Nullable PlatformPoint point, @NonNull VoidResult result); + /** Returns the minimum exposure offset of the camera with the given ID. */ @NonNull Double getMinExposureOffset(); + /** Returns the maximum exposure offset of the camera with the given ID. */ @NonNull Double getMaxExposureOffset(); + /** Returns the exposure step size of the camera with the given ID. */ @NonNull Double getExposureOffsetStepSize(); + /** * Sets the exposure offset of the camera with the given ID and returns the actual exposure * offset. */ void setExposureOffset(@NonNull Double offset, @NonNull Result result); + /** Sets the focus mode of the camera with the given ID. */ void setFocusMode(@NonNull PlatformFocusMode focusMode); + /** * Sets the focus point of the camera with the given ID. * *

A null value resets to the default focus point. */ void setFocusPoint(@Nullable PlatformPoint point, @NonNull VoidResult result); + /** Returns the maximum zoom level of the camera with the given ID. */ @NonNull Double getMaxZoomLevel(); + /** Returns the minimum zoom level of the camera with the given ID. */ @NonNull Double getMinZoomLevel(); + /** Sets the zoom level of the camera with the given ID. */ void setZoomLevel(@NonNull Double zoom, @NonNull VoidResult result); + /** Pauses streaming of preview frames. */ void pausePreview(); + /** Resumes previously paused streaming of preview frames. */ void resumePreview(); + /** * Changes the camera while recording video. * @@ -1053,6 +1083,7 @@ void create( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `CameraApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraApi api) { setUp(binaryMessenger, "", api); @@ -1780,6 +1811,7 @@ public void error(Throwable error) { } } } + /** * Handles calls from native side to Dart that are not camera-specific. * @@ -1803,6 +1835,7 @@ public CameraGlobalEventApi( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Called when the device's physical orientation changes. */ public void deviceOrientationChanged( @NonNull PlatformDeviceOrientation orientationArg, @NonNull VoidResult result) { @@ -1829,6 +1862,7 @@ public void deviceOrientationChanged( }); } } + /** * Handles device-specific calls from native side to Dart. * @@ -1852,6 +1886,7 @@ public CameraEventApi( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Called when the camera is initialized. */ public void initialized( @NonNull PlatformCameraState initialStateArg, @NonNull VoidResult result) { @@ -1876,6 +1911,7 @@ public void initialized( } }); } + /** Called when an error occurs in the camera. */ public void error(@NonNull String messageArg, @NonNull VoidResult result) { final String channelName = @@ -1899,6 +1935,7 @@ public void error(@NonNull String messageArg, @NonNull VoidResult result) { } }); } + /** Called when the camera closes. */ public void closed(@NonNull VoidResult result) { final String channelName = diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/SdkCapabilityChecker.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/SdkCapabilityChecker.java index a1a2a6e3608b..e183f8299bfe 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/SdkCapabilityChecker.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/SdkCapabilityChecker.java @@ -18,7 +18,8 @@ public class SdkCapabilityChecker { @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.P) public static boolean supportsDistortionCorrection() { - // See https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES + // See + // https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES return SDK_VERSION >= Build.VERSION_CODES.P; } @@ -36,13 +37,15 @@ public static boolean supportsEncoderProfiles() { @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.P) public static boolean supportsSessionConfiguration() { - // See https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration + // See + // https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration return SDK_VERSION >= Build.VERSION_CODES.P; } @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.R) public static boolean supportsZoomRatio() { - // See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_ZOOM_RATIO + // See + // https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_ZOOM_RATIO return SDK_VERSION >= Build.VERSION_CODES.R; } } diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/autofocus/AutoFocusFeature.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/autofocus/AutoFocusFeature.java index 55c291591e6b..ade73a36917b 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/autofocus/AutoFocusFeature.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/autofocus/AutoFocusFeature.java @@ -54,7 +54,8 @@ public boolean checkIsSupported() { final Float minFocus = cameraProperties.getLensInfoMinimumFocusDistance(); // Check if the focal length of the lens is fixed. If the minimum focus distance == 0, then the - // focal length is fixed. The minimum focus distance can be null on some devices: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE + // focal length is fixed. The minimum focus distance can be null on some devices: + // https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE boolean isFixedLength = minFocus == null || minFocus == 0; return !isFixedLength diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/exposurepoint/ExposurePointFeature.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/exposurepoint/ExposurePointFeature.java index 21005ff785df..b41f47e61f08 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/exposurepoint/ExposurePointFeature.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/exposurepoint/ExposurePointFeature.java @@ -98,7 +98,9 @@ public void updateBuilder(@NonNull CaptureRequest.Builder requestBuilder) { private void buildExposureRectangle() { if (this.cameraBoundaries == null) { throw new AssertionError( - "The cameraBoundaries should be set (using `ExposurePointFeature.setCameraBoundaries(Size)`) before updating the exposure point."); + "The cameraBoundaries should be set (using" + + " `ExposurePointFeature.setCameraBoundaries(Size)`) before updating the exposure" + + " point."); } if (this.exposurePoint == null) { this.exposureRectangle = null; diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/focuspoint/FocusPointFeature.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/focuspoint/FocusPointFeature.java index 90384e70981b..5b0866104263 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/focuspoint/FocusPointFeature.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/focuspoint/FocusPointFeature.java @@ -86,7 +86,8 @@ public void updateBuilder(@NonNull CaptureRequest.Builder requestBuilder) { private void buildFocusRectangle() { if (this.cameraBoundaries == null) { throw new AssertionError( - "The cameraBoundaries should be set (using `FocusPointFeature.setCameraBoundaries(Size)`) before updating the focus point."); + "The cameraBoundaries should be set (using `FocusPointFeature.setCameraBoundaries(Size)`)" + + " before updating the focus point."); } if (this.focusPoint == null) { this.focusRectangle = null; diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java index 9cc243fa1505..e07587e5fd87 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java @@ -138,8 +138,10 @@ static Size computeBestPreviewSize(int cameraId, ResolutionPreset preset) } } - // TODO(camsim99): Suppression is currently safe because legacy code is used as a fallback for SDK < S. - // This should be removed when reverting that fallback behavior: https://github.com/flutter/flutter/issues/119668. + // TODO(camsim99): Suppression is currently safe because legacy code is used as a fallback for + // SDK < S. + // This should be removed when reverting that fallback behavior: + // https://github.com/flutter/flutter/issues/119668. CamcorderProfile profile = getBestAvailableCamcorderProfileForResolutionPresetLegacy(cameraId, preset); return new Size(profile.videoFrameWidth, profile.videoFrameHeight); @@ -165,7 +167,8 @@ public static CamcorderProfile getBestAvailableCamcorderProfileForResolutionPres int cameraId, @NonNull ResolutionPreset preset) { if (cameraId < 0) { throw new AssertionError( - "getBestAvailableCamcorderProfileForResolutionPreset can only be used with valid (>=0) camera identifiers."); + "getBestAvailableCamcorderProfileForResolutionPreset can only be used with valid (>=0)" + + " camera identifiers."); } switch (preset) { @@ -173,32 +176,32 @@ public static CamcorderProfile getBestAvailableCamcorderProfileForResolutionPres if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_HIGH)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_HIGH); } - // fall through + // fall through case ultraHigh: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_2160P)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_2160P); } - // fall through + // fall through case veryHigh: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_1080P)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_1080P); } - // fall through + // fall through case high: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_720P)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_720P); } - // fall through + // fall through case medium: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_480P)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_480P); } - // fall through + // fall through case low: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_QVGA)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_QVGA); } - // fall through + // fall through default: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_LOW)) { return CamcorderProfile.get(cameraId, CamcorderProfile.QUALITY_LOW); @@ -218,7 +221,8 @@ public static EncoderProfiles getBestAvailableCamcorderProfileForResolutionPrese int cameraId, @NonNull ResolutionPreset preset) { if (cameraId < 0) { throw new AssertionError( - "getBestAvailableCamcorderProfileForResolutionPreset can only be used with valid (>=0) camera identifiers."); + "getBestAvailableCamcorderProfileForResolutionPreset can only be used with valid (>=0)" + + " camera identifiers."); } String cameraIdString = Integer.toString(cameraId); @@ -228,32 +232,32 @@ public static EncoderProfiles getBestAvailableCamcorderProfileForResolutionPrese if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_HIGH)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_HIGH); } - // fall through + // fall through case ultraHigh: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_2160P)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_2160P); } - // fall through + // fall through case veryHigh: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_1080P)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_1080P); } - // fall through + // fall through case high: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_720P)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_720P); } - // fall through + // fall through case medium: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_480P)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_480P); } - // fall through + // fall through case low: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_QVGA)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_QVGA); } - // fall through + // fall through default: if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_LOW)) { return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_LOW); diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java index cedd2d458c91..4156c18d7209 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java @@ -201,7 +201,9 @@ public int getVideoOrientation(@Nullable PlatformChannel.DeviceOrientation orien return (angle + sensorOrientation + 360) % 360; } - /** @return the last received UI orientation. */ + /** + * @return the last received UI orientation. + */ @Nullable public PlatformChannel.DeviceOrientation getLastUIOrientation() { return this.lastOrientation; diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/zoomlevel/ZoomLevelFeature.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/zoomlevel/ZoomLevelFeature.java index a6d51197412f..0d064bd3dbae 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/zoomlevel/ZoomLevelFeature.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/zoomlevel/ZoomLevelFeature.java @@ -36,7 +36,8 @@ public ZoomLevelFeature(@NonNull CameraProperties cameraProperties) { hasSupport = false; return; } - // On Android 11+ CONTROL_ZOOM_RATIO_RANGE should be use to get the zoom ratio directly as minimum zoom does not have to be 1.0f. + // On Android 11+ CONTROL_ZOOM_RATIO_RANGE should be use to get the zoom ratio directly as + // minimum zoom does not have to be 1.0f. if (SdkCapabilityChecker.supportsZoomRatio()) { minimumZoomLevel = cameraProperties.getScalerMinZoomRatio(); maximumZoomLevel = cameraProperties.getScalerMaxZoomRatio(); diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/media/MediaRecorderBuilder.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/media/MediaRecorderBuilder.java index 3062fa3c8066..521cb5f7835f 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/media/MediaRecorderBuilder.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/media/MediaRecorderBuilder.java @@ -97,7 +97,8 @@ public MediaRecorder build() throws IOException, NullPointerException, IndexOutO MediaRecorder mediaRecorder = recorderFactory.makeMediaRecorder(); // There's a fixed order that mediaRecorder expects. Only change these functions accordingly. - // You can find the specifics here: https://developer.android.com/reference/android/media/MediaRecorder. + // You can find the specifics here: + // https://developer.android.com/reference/android/media/MediaRecorder. if (enableAudio) mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE); diff --git a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java index 9b2b4ffeec81..85e317cd0c0b 100644 --- a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java +++ b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java @@ -1219,11 +1219,11 @@ public void startVideoRecording_shouldApplySettingsToMediaRecorder() final ResolutionPreset resolutionPreset = ResolutionPreset.high; final boolean enableAudio = true; - //region These parameters should be set in android MediaRecorder. + // region These parameters should be set in android MediaRecorder. final int fps = 15; final int videoBitrate = 200000; final int audioBitrate = 32000; - //endregion + // endregion when(mockCameraProperties.getCameraName()).thenReturn(cameraName); @@ -1303,7 +1303,7 @@ public void startVideoRecording_shouldApplySettingsToMediaRecorder() camera.startVideoRecording(null); - //region Check that FPS parameter affects AE range at which the camera captures frames. + // region Check that FPS parameter affects AE range at which the camera captures frames. assertEquals(camera.cameraFeatures.getFpsRange().getValue().getLower(), Integer.valueOf(fps)); assertEquals(camera.cameraFeatures.getFpsRange().getValue().getUpper(), Integer.valueOf(fps)); @@ -1312,15 +1312,15 @@ public void startVideoRecording_shouldApplySettingsToMediaRecorder() eq(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE), argThat( (Range range) -> range.getLower() == fps && range.getUpper() == fps)); - //endregion + // endregion final MediaRecorder recorder = camera.mediaRecorder; - //region Check that parameters affects movies, written by MediaRecorder. + // region Check that parameters affects movies, written by MediaRecorder. verify(recorder).setVideoFrameRate(fps); verify(recorder).setAudioEncodingBitRate(audioBitrate); verify(recorder).setVideoEncodingBitRate(videoBitrate); - //endregion + // endregion } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java index 633b99c2f300..3a00f91bec8a 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java @@ -74,8 +74,10 @@ public void onSuccess(Void voidResult) { @Override public void onFailure(@NonNull Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // Operation was canceled due to camera being closed or a new request was submitted, which - // is not actionable and should not block a new value from potentially being submitted. + // Operation was canceled due to camera being closed or a new request was submitted, + // which + // is not actionable and should not block a new value from potentially being + // submitted. ResultCompat.success(null, callback); return; } @@ -105,8 +107,10 @@ public void onSuccess(FocusMeteringResult focusMeteringResult) { @Override public void onFailure(@NonNull Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // Operation was canceled due to camera being closed or a new request was submitted, which - // is not actionable and should not block a new value from potentially being submitted. + // Operation was canceled due to camera being closed or a new request was submitted, + // which + // is not actionable and should not block a new value from potentially being + // submitted. ResultCompat.success(null, callback); return; } @@ -158,8 +162,10 @@ public void onSuccess(Integer integerResult) { @Override public void onFailure(@NonNull Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // Operation was canceled due to camera being closed or a new request was submitted, which - // is not actionable and should not block a new value from potentially being submitted. + // Operation was canceled due to camera being closed or a new request was submitted, + // which + // is not actionable and should not block a new value from potentially being + // submitted. ResultCompat.success(null, callback); return; } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/DeviceOrientationManager.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/DeviceOrientationManager.java index 01296bbdd678..83d8573cf2a8 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/DeviceOrientationManager.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/DeviceOrientationManager.java @@ -191,7 +191,8 @@ int getDefaultRotation() { // fallback and prevents crashes until a valid Activity is attached again. Log.w( "DeviceOrientationManager", - "Cannot get display: Activity may be null (destroyed or not yet attached) due to a race condition."); + "Cannot get display: Activity may be null (destroyed or not yet attached) due to a race" + + " condition."); return Surface.ROTATION_0; } 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 e282be75531d..62931dceea86 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 @@ -717,6 +717,7 @@ public interface Result { void error(@NonNull Throwable error); } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface InstanceManagerHostApi { /** @@ -730,6 +731,7 @@ public interface InstanceManagerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `InstanceManagerHostApi` to handle messages through the * `binaryMessenger`. @@ -759,6 +761,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface JavaObjectHostApi { @@ -768,6 +771,7 @@ public interface JavaObjectHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. */ @@ -797,6 +801,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObject } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class JavaObjectFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -810,6 +815,7 @@ public JavaObjectFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by JavaObjectFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -824,6 +830,7 @@ public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraInfoHostApi { @@ -843,6 +850,7 @@ public interface CameraInfoHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ @@ -952,6 +960,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class CameraInfoFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -965,6 +974,7 @@ public CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by CameraInfoFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -979,6 +989,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraSelectorHostApi { @@ -991,6 +1002,7 @@ public interface CameraSelectorHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `CameraSelectorHostApi` to handle messages through the * `binaryMessenger`. @@ -1052,6 +1064,7 @@ static void setup( } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class CameraSelectorFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -1065,6 +1078,7 @@ public CameraSelectorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by CameraSelectorFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -1080,6 +1094,7 @@ public void create( channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ProcessCameraProviderHostApi { @@ -1105,6 +1120,7 @@ Long bindToLifecycle( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the * `binaryMessenger`. @@ -1283,6 +1299,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class ProcessCameraProviderFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -1296,6 +1313,7 @@ public ProcessCameraProviderFlutterApi(@NonNull BinaryMessenger argBinaryMesseng public interface Reply { void reply(T reply); } + /** The codec used by ProcessCameraProviderFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -1312,6 +1330,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraHostApi { @@ -1325,6 +1344,7 @@ public interface CameraHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHostApi api) { { @@ -1378,6 +1398,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class CameraFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -1391,6 +1412,7 @@ public CameraFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by CameraFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -1445,6 +1467,7 @@ void requestCameraPermissions( static @NonNull MessageCodec getCodec() { return SystemServicesHostApiCodec.INSTANCE; } + /** * Sets up an instance of `SystemServicesHostApi` to handle messages through the * `binaryMessenger`. @@ -1510,6 +1533,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class SystemServicesFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -1523,6 +1547,7 @@ public SystemServicesFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by SystemServicesFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -1539,6 +1564,7 @@ public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface DeviceOrientationManagerHostApi { @@ -1557,6 +1583,7 @@ void startListeningForDeviceOrientationChange( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the * `binaryMessenger`. @@ -1662,6 +1689,7 @@ static void setup( } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class DeviceOrientationManagerFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -1675,6 +1703,7 @@ public DeviceOrientationManagerFlutterApi(@NonNull BinaryMessenger argBinaryMess public interface Reply { void reply(T reply); } + /** The codec used by DeviceOrientationManagerFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -1742,6 +1771,7 @@ void create( static @NonNull MessageCodec getCodec() { return PreviewHostApiCodec.INSTANCE; } + /** Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHostApi api) { { @@ -1900,6 +1930,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoCaptureHostApi { @@ -1915,6 +1946,7 @@ public interface VideoCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `VideoCaptureHostApi` to handle messages through the * `binaryMessenger`. @@ -1999,6 +2031,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class VideoCaptureFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -2012,6 +2045,7 @@ public VideoCaptureFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by VideoCaptureFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -2026,6 +2060,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface RecorderHostApi { @@ -2048,6 +2083,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. */ @@ -2162,6 +2198,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class RecorderFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -2175,6 +2212,7 @@ public RecorderFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by RecorderFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -2193,6 +2231,7 @@ public void create( channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PendingRecordingHostApi { @@ -2203,6 +2242,7 @@ public interface PendingRecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `PendingRecordingHostApi` to handle messages through the * `binaryMessenger`. @@ -2276,6 +2316,7 @@ public PendingRecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by PendingRecordingFlutterApi. */ static @NonNull MessageCodec getCodec() { return PendingRecordingFlutterApiCodec.INSTANCE; @@ -2302,6 +2343,7 @@ public void onVideoRecordingEvent( channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface RecordingHostApi { @@ -2317,6 +2359,7 @@ public interface RecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. */ @@ -2415,6 +2458,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class RecordingFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -2428,6 +2472,7 @@ public RecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by RecordingFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -2442,6 +2487,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageCaptureHostApi { @@ -2461,6 +2507,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `ImageCaptureHostApi` to handle messages through the * `binaryMessenger`. @@ -2622,6 +2669,7 @@ void create( static @NonNull MessageCodec getCodec() { return ResolutionStrategyHostApiCodec.INSTANCE; } + /** * Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the * `binaryMessenger`. @@ -2658,6 +2706,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionSelectorHostApi { @@ -2671,6 +2720,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the * `binaryMessenger`. @@ -2715,6 +2765,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AspectRatioStrategyHostApi { @@ -2725,6 +2776,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the * `binaryMessenger`. @@ -2805,6 +2857,7 @@ public CameraStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by CameraStateFlutterApi. */ static @NonNull MessageCodec getCodec() { return CameraStateFlutterApiCodec.INSTANCE; @@ -2863,6 +2916,7 @@ public ExposureStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by ExposureStateFlutterApi. */ static @NonNull MessageCodec getCodec() { return ExposureStateFlutterApiCodec.INSTANCE; @@ -2883,6 +2937,7 @@ public void create( channelReply -> callback.reply(null)); } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class ZoomStateFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -2896,6 +2951,7 @@ public ZoomStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by ZoomStateFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -2914,6 +2970,7 @@ public void create( channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageAnalysisHostApi { @@ -2932,6 +2989,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `ImageAnalysisHostApi` to handle messages through the * `binaryMessenger`. @@ -3049,6 +3107,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AnalyzerHostApi { @@ -3058,6 +3117,7 @@ public interface AnalyzerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. */ @@ -3087,6 +3147,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHo } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ObserverHostApi { @@ -3096,6 +3157,7 @@ public interface ObserverHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. */ @@ -3125,6 +3187,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHo } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class ObserverFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3138,6 +3201,7 @@ public ObserverFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by ObserverFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -3155,6 +3219,7 @@ public void onChanged( channelReply -> callback.reply(null)); } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class CameraStateErrorFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3168,6 +3233,7 @@ public CameraStateErrorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by CameraStateErrorFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -3224,6 +3290,7 @@ public interface LiveDataHostApi { static @NonNull MessageCodec getCodec() { return LiveDataHostApiCodec.INSTANCE; } + /** * Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. */ @@ -3345,6 +3412,7 @@ public LiveDataFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by LiveDataFlutterApi. */ static @NonNull MessageCodec getCodec() { return LiveDataFlutterApiCodec.INSTANCE; @@ -3362,6 +3430,7 @@ public void create( channelReply -> callback.reply(null)); } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class AnalyzerFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3375,6 +3444,7 @@ public AnalyzerFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by AnalyzerFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -3401,6 +3471,7 @@ public void analyze( channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageProxyHostApi { @@ -3413,6 +3484,7 @@ public interface ImageProxyHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. */ @@ -3466,6 +3538,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class ImageProxyFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3479,6 +3552,7 @@ public ImageProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by ImageProxyFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -3498,6 +3572,7 @@ public void create( channelReply -> callback.reply(null)); } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class PlaneProxyFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3511,6 +3586,7 @@ public PlaneProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by PlaneProxyFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -3578,6 +3654,7 @@ void create( static @NonNull MessageCodec getCodec() { return QualitySelectorHostApiCodec.INSTANCE; } + /** * Sets up an instance of `QualitySelectorHostApi` to handle messages through the * `binaryMessenger`. @@ -3645,6 +3722,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FallbackStrategyHostApi { @@ -3657,6 +3735,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `FallbackStrategyHostApi` to handle messages through the * `binaryMessenger`. @@ -3697,6 +3776,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraControlHostApi { @@ -3720,6 +3800,7 @@ void setExposureCompensationIndex( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `CameraControlHostApi` to handle messages through the * `binaryMessenger`. @@ -3900,6 +3981,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class CameraControlFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3913,6 +3995,7 @@ public CameraControlFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { public interface Reply { void reply(T reply); } + /** The codec used by CameraControlFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -3967,6 +4050,7 @@ void create( static @NonNull MessageCodec getCodec() { return FocusMeteringActionHostApiCodec.INSTANCE; } + /** * Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the * `binaryMessenger`. @@ -4006,6 +4090,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringResultHostApi { @@ -4016,6 +4101,7 @@ public interface FocusMeteringResultHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the * `binaryMessenger`. @@ -4051,6 +4137,7 @@ static void setup( } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class FocusMeteringResultFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -4064,6 +4151,7 @@ public FocusMeteringResultFlutterApi(@NonNull BinaryMessenger argBinaryMessenger public interface Reply { void reply(T reply); } + /** The codec used by FocusMeteringResultFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); @@ -4080,6 +4168,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { channelReply -> callback.reply(null)); } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MeteringPointHostApi { @@ -4097,6 +4186,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `MeteringPointHostApi` to handle messages through the * `binaryMessenger`. @@ -4232,6 +4322,7 @@ public interface CaptureRequestOptionsHostApi { static @NonNull MessageCodec getCodec() { return CaptureRequestOptionsHostApiCodec.INSTANCE; } + /** * Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the * `binaryMessenger`. @@ -4267,6 +4358,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface Camera2CameraControlHostApi { @@ -4281,6 +4373,7 @@ void addCaptureRequestOptions( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the * `binaryMessenger`. @@ -4393,6 +4486,7 @@ void createWithOnePreferredSize( static @NonNull MessageCodec getCodec() { return ResolutionFilterHostApiCodec.INSTANCE; } + /** * Sets up an instance of `ResolutionFilterHostApi` to handle messages through the * `binaryMessenger`. @@ -4429,6 +4523,7 @@ static void setup( } } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface Camera2CameraInfoHostApi { @@ -4448,6 +4543,7 @@ public interface Camera2CameraInfoHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + /** * Sets up an instance of `Camera2CameraInfoHostApi` to handle messages through the * `binaryMessenger`. @@ -4565,6 +4661,7 @@ static void setup( } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class Camera2CameraInfoFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -4578,6 +4675,7 @@ public Camera2CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) public interface Reply { void reply(T reply); } + /** The codec used by Camera2CameraInfoFlutterApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java index 7bf6bd508a25..5398dd148b05 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java @@ -156,9 +156,12 @@ String getImageCaptureExceptionDescription(int imageCaptureErrorCode) { case ImageCapture.ERROR_CAMERA_CLOSED: return "Image capture failed due to the camera being closed."; case ImageCapture.ERROR_INVALID_CAMERA: - return "The ImageCapture use case was bound to an invalid camera by the Flutter camera plugin. If you see this error, please file an issue if you cannot find one that already exists: https://github.com/flutter/flutter/issues/."; + return "The ImageCapture use case was bound to an invalid camera by the Flutter camera" + + " plugin. If you see this error, please file an issue if you cannot find one" + + " that already exists: https://github.com/flutter/flutter/issues/."; default: - return "An unknown error has occurred while attempting to take a picture. Check the logs for more details."; + return "An unknown error has occurred while attempting to take a picture. Check the logs" + + " for more details."; } } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewProxyApi.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewProxyApi.java index 56919b5a1567..990ac0e71daa 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewProxyApi.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewProxyApi.java @@ -88,7 +88,8 @@ public void releaseSurfaceProvider(@NonNull Preview pigeonInstance) { return; } throw new IllegalStateException( - "releaseFlutterSurfaceTexture() cannot be called if the flutterSurfaceProducer for the camera preview has not yet been initialized."); + "releaseFlutterSurfaceTexture() cannot be called if the flutterSurfaceProducer for the" + + " camera preview has not yet been initialized."); } @Override @@ -98,7 +99,8 @@ public boolean surfaceProducerHandlesCropAndRotation(@NonNull Preview pigeonInst return surfaceProducer.handlesCropAndRotation(); } throw new IllegalStateException( - "surfaceProducerHandlesCropAndRotation() cannot be called if the flutterSurfaceProducer for the camera preview has not yet been initialized."); + "surfaceProducerHandlesCropAndRotation() cannot be called if the flutterSurfaceProducer for" + + " the camera preview has not yet been initialized."); } @Nullable diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/VideoRecordEventListenerProxyApi.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/VideoRecordEventListenerProxyApi.java index 320e18a76529..8bb1e9e6991c 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/VideoRecordEventListenerProxyApi.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/VideoRecordEventListenerProxyApi.java @@ -17,6 +17,7 @@ class VideoRecordEventListenerProxyApi extends PigeonApiVideoRecordEventListener VideoRecordEventListenerProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { super(pigeonRegistrar); } + /** * Implementation of {@link VideoRecordEventListener} that passes arguments of callback methods to * Dart. diff --git a/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/internal/protocol/impl/DartVmService.java b/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/internal/protocol/impl/DartVmService.java index d4b7d168e8fd..d7b035481cb9 100644 --- a/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/internal/protocol/impl/DartVmService.java +++ b/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/internal/protocol/impl/DartVmService.java @@ -57,8 +57,10 @@ public final class DartVmService implements FlutterTestingProtocol { /** The JSON-RPC method for testing extension APIs. */ private static final String TESTING_EXTENSION_METHOD = "ext.flutter.driver"; + /** The JSON-RPC method for retrieving Dart isolate info. */ private static final String GET_ISOLATE_METHOD = "getIsolate"; + /** The JSON-RPC method for retrieving Dart VM info. */ private static final String GET_VM_METHOD = "getVM"; @@ -129,7 +131,8 @@ public Void apply(JsonRpcResponse response) { if (response.getError() == null) { return null; } else { - // TODO(https://github.com/android/android-test/issues/251): Update error case handling + // TODO(https://github.com/android/android-test/issues/251): Update error case + // handling // like // AmbiguousWidgetMatcherException, NoMatchingWidgetException after nailing down the // design with @@ -190,8 +193,8 @@ public Rect apply(List jsonResponses) { checkState( topLeft.getX() <= bottomRight.getX() && topLeft.getY() <= bottomRight.getY(), String.format( - "The coordinates of the bottom right vertex [%.1f, %.1f] are not actually to the" - + " bottom right of the top left vertex [%.1f, %.1f]!", + "The coordinates of the bottom right vertex [%.1f, %.1f] are not actually to" + + " the bottom right of the top left vertex [%.1f, %.1f]!", topLeft.getX(), topLeft.getY(), bottomRight.getX(), bottomRight.getY())); return new Rect( (int) topLeft.getX(), diff --git a/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/model/WidgetInfo.java b/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/model/WidgetInfo.java index 00d9f1493b90..439ad7c981e4 100644 --- a/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/model/WidgetInfo.java +++ b/packages/espresso/android/src/main/java/androidx/test/espresso/flutter/model/WidgetInfo.java @@ -27,10 +27,13 @@ public class WidgetInfo { /** A String representation of a Flutter widget's ValueKey. */ @Nullable private final String valueKey; + /** A String representation of the runtime type of the widget. */ private final String runtimeType; + /** The widget's text property. */ @Nullable private final String text; + /** The widget's tooltip property. */ @Nullable private final String tooltip; diff --git a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java index 605b28e02a96..ccfcb06cce92 100644 --- a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java +++ b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java @@ -66,9 +66,11 @@ public static String getPathFromUri(@NonNull Context context, @NonNull Uri uri) String[] uriDocumentIdSplit = uriDocumentId.split(":"); if (uriDocumentIdSplit.length < 2) { - // We expect the URI document ID to contain its storage volume and name to determine its path. + // We expect the URI document ID to contain its storage volume and name to determine its + // path. throw new UnsupportedOperationException( - "Retrieving the path of a document with an unknown storage volume or name is unsupported by this plugin."); + "Retrieving the path of a document with an unknown storage volume or name is" + + " unsupported by this plugin."); } String documentStorageVolume = uriDocumentIdSplit[0]; @@ -208,7 +210,8 @@ private static String getBaseName(String fileName) { return fileName.substring(0, lastDotIndex); } - // From https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#sanitize-provided-filenames. + // From + // https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#sanitize-provided-filenames. protected static @Nullable String sanitizeFilename(@Nullable String displayName) { if (displayName == null) { return null; diff --git a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java index 9f85509fb45a..885b1dbcf406 100644 --- a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java +++ b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java @@ -513,6 +513,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -521,6 +522,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -529,6 +531,7 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** * An API to call to native code to select files or directories. * @@ -544,6 +547,7 @@ void openFile( @Nullable String initialDirectory, @NonNull FileTypes allowedTypes, @NonNull NullableResult result); + /** * Opens a file dialog for loading files and returns a list of file responses chosen by the * user. @@ -552,6 +556,7 @@ void openFiles( @Nullable String initialDirectory, @NonNull FileTypes allowedTypes, @NonNull Result> result); + /** * Opens a file dialog for loading directories and returns a directory path. * @@ -564,6 +569,7 @@ void getDirectoryPath( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `FileSelectorApi` to handle messages through the `binaryMessenger`. */ diff --git a/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java b/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java index 21b6dc445dee..0bd8772f5544 100644 --- a/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java +++ b/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java @@ -214,7 +214,8 @@ public void openFilesReturnsSuccessfully() throws FileNotFoundException { } } - // This test was created when error handling was moved from FileUtils.java to FileSelectorApiImpl.java + // This test was created when error handling was moved from FileUtils.java to + // FileSelectorApiImpl.java // in https://github.com/flutter/packages/pull/8184, so as to maintain the existing test. // The behavior is actually an error case and should be fixed, // see: https://github.com/flutter/flutter/issues/159568. diff --git a/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileUtilsTest.java b/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileUtilsTest.java index ef640113fdbc..2f30e6499961 100644 --- a/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileUtilsTest.java +++ b/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileUtilsTest.java @@ -88,7 +88,8 @@ public void getPathFromUri_returnsExpectedPathForExternalDocumentUri() { @Test public void getPathFromUri_throwExceptionForExternalDocumentUriWithNonPrimaryStorageVolume() { - // Uri that represents Documents/test directory from some external storage volume ("external" for this test): + // Uri that represents Documents/test directory from some external storage volume ("external" + // for this test): Uri uri = Uri.parse( "content://com.android.externalstorage.documents/tree/external%3ADocuments%2Ftest"); @@ -255,7 +256,8 @@ public int update( // Mocks a malicious content provider attempting to use path indirection to modify files outside // of the intended directory. - // See https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#don%27t-trust-user-input. + // See + // https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#don%27t-trust-user-input. private static class MockMaliciousContentProvider extends ContentProvider { public static String PNG_URI = "content://dummy/a.png"; diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java index cb90b0913864..21f6953d449e 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java @@ -40,7 +40,8 @@ public void onAttachedToActivity(ActivityPluginBinding binding) { // TODO(amirh): make this throw once the lifecycle API is available on stable. // https://github.com/flutter/flutter/issues/42875 // throw new RuntimeException( - // "The FlutterLifecycleAdapter did not correctly provide a Lifecycle instance. Source reference: " + // "The FlutterLifecycleAdapter did not correctly provide a Lifecycle instance. Source + // reference: " // + flutterPluginBinding.getLifecycle()); } Log.d(TAG, "Successfully obtained Lifecycle: " + lifecycle); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java index 5921d690a0de..e179b77615cb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java @@ -217,7 +217,8 @@ void onClusterItemRendered(@NonNull MarkerBuilder item, @NonNull Marker marker) @SuppressWarnings("unchecked") private static String getClusterManagerId(Object clusterManagerData) { Map clusterMap = (Map) clusterManagerData; - // Ref: google_maps_flutter_platform_interface/lib/src/types/cluster_manager.dart ClusterManager.toJson() method. + // Ref: google_maps_flutter_platform_interface/lib/src/types/cluster_manager.dart + // ClusterManager.toJson() method. return (String) clusterMap.get("clusterManagerId"); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java index 364c0bd1f515..9872b19cd1f5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java @@ -391,7 +391,8 @@ static CameraUpdate cameraUpdateFromPigeon(Messages.PlatformCameraUpdate update, return (zoom.getOut()) ? CameraUpdateFactory.zoomOut() : CameraUpdateFactory.zoomIn(); } throw new IllegalArgumentException( - "PlatformCameraUpdate's cameraUpdate field must be one of the PlatformCameraUpdate... case classes."); + "PlatformCameraUpdate's cameraUpdate field must be one of the PlatformCameraUpdate... case" + + " classes."); } private static @Nullable Float nullableDoubleToFloat(@Nullable Double d) { @@ -1005,7 +1006,8 @@ static Tile tileFromPigeon(Messages.PlatformTile tile) { @NonNull GroundOverlay groundOverlay) { Messages.PlatformDoublePair.Builder anchorBuilder = new Messages.PlatformDoublePair.Builder(); - // Position is overlays anchor point. Calculate normalized anchor point based on position and bounds. + // Position is overlays anchor point. Calculate normalized anchor point based on position and + // bounds. LatLng position = groundOverlay.getPosition(); LatLngBounds bounds = groundOverlay.getBounds(); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/HeatmapsController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/HeatmapsController.java index 2f8f45ca6b52..18e72a726589 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/HeatmapsController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/HeatmapsController.java @@ -18,6 +18,7 @@ public class HeatmapsController { /** Mapping from Heatmap ID to HeatmapController. */ private final Map heatmapIdToController; + /** The GoogleMap to which the heatmaps are added. */ private GoogleMap googleMap; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 16c91b0196fe..5b476a99bbce 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -7200,6 +7200,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -7208,6 +7209,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -7216,6 +7218,7 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** * Interface for non-test interactions with the native SDK. * @@ -7226,6 +7229,7 @@ public interface VoidResult { public interface MapsApi { /** Returns once the map instance is available. */ void waitForMap(@NonNull VoidResult result); + /** * Updates the map's configuration options. * @@ -7233,71 +7237,89 @@ public interface MapsApi { * remain unchanged. */ void updateMapConfiguration(@NonNull PlatformMapConfiguration configuration); + /** Updates the set of circles on the map. */ void updateCircles( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Updates the set of heatmaps on the map. */ void updateHeatmaps( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Updates the set of custer managers for clusters on the map. */ void updateClusterManagers( @NonNull List toAdd, @NonNull List idsToRemove); + /** Updates the set of markers on the map. */ void updateMarkers( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Updates the set of polygonss on the map. */ void updatePolygons( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Updates the set of polylines on the map. */ void updatePolylines( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Updates the set of tile overlays on the map. */ void updateTileOverlays( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Updates the set of ground overlays on the map. */ void updateGroundOverlays( @NonNull List toAdd, @NonNull List toChange, @NonNull List idsToRemove); + /** Gets the screen coordinate for the given map location. */ @NonNull PlatformPoint getScreenCoordinate(@NonNull PlatformLatLng latLng); + /** Gets the map location for the given screen coordinate. */ @NonNull PlatformLatLng getLatLng(@NonNull PlatformPoint screenCoordinate); + /** Gets the map region currently displayed on the map. */ @NonNull PlatformLatLngBounds getVisibleRegion(); + /** Moves the camera according to [cameraUpdate] immediately, with no animation. */ void moveCamera(@NonNull PlatformCameraUpdate cameraUpdate); + /** * Moves the camera according to [cameraUpdate], animating the update using a duration in * milliseconds if provided. */ void animateCamera( @NonNull PlatformCameraUpdate cameraUpdate, @Nullable Long durationMilliseconds); + /** Gets the current map zoom level. */ @NonNull Double getZoomLevel(); + /** Show the info window for the marker with the given ID. */ void showInfoWindow(@NonNull String markerId); + /** Hide the info window for the marker with the given ID. */ void hideInfoWindow(@NonNull String markerId); + /** Returns true if the marker with the given ID is currently displaying its info window. */ @NonNull Boolean isInfoWindowShown(@NonNull String markerId); + /** * Sets the style to the given map style string, where an empty string indicates that the style * should be cleared. @@ -7306,6 +7328,7 @@ void animateCamera( */ @NonNull Boolean setStyle(@NonNull String style); + /** * Returns true if the last attempt to set a style, either via initial map style or setMapStyle, * succeeded. @@ -7315,6 +7338,7 @@ void animateCamera( */ @NonNull Boolean didLastStyleSucceed(); + /** * Returns true if this map supports advanced markers. * @@ -7322,8 +7346,10 @@ void animateCamera( */ @NonNull Boolean isAdvancedMarkersAvailable(); + /** Clears the cache of tiles previously requseted from the tile provider. */ void clearTileCache(@NonNull String tileOverlayId); + /** Takes a snapshot of the map and returns its image data. */ void takeSnapshot(@NonNull Result result); @@ -7331,6 +7357,7 @@ void animateCamera( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable MapsApi api) { setUp(binaryMessenger, "", api); @@ -7961,6 +7988,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class MapsCallbackApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -7980,6 +8008,7 @@ public MapsCallbackApi( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Called when the map camera starts moving. */ public void onCameraMoveStarted(@NonNull VoidResult result) { final String channelName = @@ -8004,6 +8033,7 @@ public void onCameraMoveStarted(@NonNull VoidResult result) { } }); } + /** Called when the map camera moves. */ public void onCameraMove( @NonNull PlatformCameraPosition cameraPositionArg, @NonNull VoidResult result) { @@ -8029,6 +8059,7 @@ public void onCameraMove( } }); } + /** Called when the map camera stops moving. */ public void onCameraIdle(@NonNull VoidResult result) { final String channelName = @@ -8053,6 +8084,7 @@ public void onCameraIdle(@NonNull VoidResult result) { } }); } + /** Called when the map, not a specifc map object, is tapped. */ public void onTap(@NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { final String channelName = @@ -8077,6 +8109,7 @@ public void onTap(@NonNull PlatformLatLng positionArg, @NonNull VoidResult resul } }); } + /** Called when the map, not a specifc map object, is long pressed. */ public void onLongPress(@NonNull PlatformLatLng positionArg, @NonNull VoidResult result) { final String channelName = @@ -8101,6 +8134,7 @@ public void onLongPress(@NonNull PlatformLatLng positionArg, @NonNull VoidResult } }); } + /** Called when a marker is tapped. */ public void onMarkerTap(@NonNull String markerIdArg, @NonNull VoidResult result) { final String channelName = @@ -8125,6 +8159,7 @@ public void onMarkerTap(@NonNull String markerIdArg, @NonNull VoidResult result) } }); } + /** Called when a marker drag starts. */ public void onMarkerDragStart( @NonNull String markerIdArg, @@ -8152,6 +8187,7 @@ public void onMarkerDragStart( } }); } + /** Called when a marker drag updates. */ public void onMarkerDrag( @NonNull String markerIdArg, @@ -8179,6 +8215,7 @@ public void onMarkerDrag( } }); } + /** Called when a marker drag ends. */ public void onMarkerDragEnd( @NonNull String markerIdArg, @@ -8206,6 +8243,7 @@ public void onMarkerDragEnd( } }); } + /** Called when a marker's info window is tapped. */ public void onInfoWindowTap(@NonNull String markerIdArg, @NonNull VoidResult result) { final String channelName = @@ -8230,6 +8268,7 @@ public void onInfoWindowTap(@NonNull String markerIdArg, @NonNull VoidResult res } }); } + /** Called when a circle is tapped. */ public void onCircleTap(@NonNull String circleIdArg, @NonNull VoidResult result) { final String channelName = @@ -8254,6 +8293,7 @@ public void onCircleTap(@NonNull String circleIdArg, @NonNull VoidResult result) } }); } + /** Called when a marker cluster is tapped. */ public void onClusterTap(@NonNull PlatformCluster clusterArg, @NonNull VoidResult result) { final String channelName = @@ -8278,6 +8318,7 @@ public void onClusterTap(@NonNull PlatformCluster clusterArg, @NonNull VoidResul } }); } + /** Called when a polygon is tapped. */ public void onPolygonTap(@NonNull String polygonIdArg, @NonNull VoidResult result) { final String channelName = @@ -8302,6 +8343,7 @@ public void onPolygonTap(@NonNull String polygonIdArg, @NonNull VoidResult resul } }); } + /** Called when a polyline is tapped. */ public void onPolylineTap(@NonNull String polylineIdArg, @NonNull VoidResult result) { final String channelName = @@ -8326,6 +8368,7 @@ public void onPolylineTap(@NonNull String polylineIdArg, @NonNull VoidResult res } }); } + /** Called when a ground overlay is tapped. */ public void onGroundOverlayTap(@NonNull String groundOverlayIdArg, @NonNull VoidResult result) { final String channelName = @@ -8350,6 +8393,7 @@ public void onGroundOverlayTap(@NonNull String groundOverlayIdArg, @NonNull Void } }); } + /** Called to get data for a map tile. */ public void getTileOverlayTile( @NonNull String tileOverlayIdArg, @@ -8387,6 +8431,7 @@ public void getTileOverlayTile( }); } } + /** * Interface for global SDK initialization. * @@ -8402,6 +8447,7 @@ public interface MapsInitializerApi { */ void initializeWithPreferredRenderer( @Nullable PlatformRendererType type, @NonNull Result result); + /** * Attempts to trigger any thread-blocking work the Google Maps SDK normally does when a map is * shown for the first time. @@ -8412,6 +8458,7 @@ void initializeWithPreferredRenderer( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `MapsInitializerApi` to handle messages through the `binaryMessenger`. */ @@ -8481,6 +8528,7 @@ public void error(Throwable error) { } } } + /** * Dummy interface to force generation of the platform view creation params, which are not used in * any Pigeon calls, only the platform view creation call made internally by Flutter. @@ -8495,6 +8543,7 @@ public interface MapsPlatformViewApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `MapsPlatformViewApi` to handle messages through the * `binaryMessenger`. @@ -8535,6 +8584,7 @@ static void setUp( } } } + /** * Inspector API only intended for use in integration tests. * @@ -8594,6 +8644,7 @@ public interface MapsInspectorApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. */ diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileProviderController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileProviderController.java index fea413dcb646..4e36d091ea56 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileProviderController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileProviderController.java @@ -54,7 +54,8 @@ Tile getTile() { new Messages.PlatformPoint.Builder().setX((long) x).setY((long) y).build(); handler.post(() -> flutterApi.getTileOverlayTile(tileOverlayId, location, (long) zoom, this)); try { - // `flutterApi.getTileOverlayTile` is async, so use a `countDownLatch` to make it synchronized. + // `flutterApi.getTileOverlayTile` is async, so use a `countDownLatch` to make it + // synchronized. countDownLatch.await(); } catch (InterruptedException e) { Log.e( diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java index d063cb17317a..140fe95c49ee 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java @@ -228,7 +228,8 @@ public void SetInitialClusterManagers() { googleMapController.setInitialClusterManagers(initialClusterManagers); googleMapController.onMapReady(mockGoogleMap); - // Verify if the ClusterManagersController.addClusterManagers method is called with initial cluster managers. + // Verify if the ClusterManagersController.addClusterManagers method is called with initial + // cluster managers. verify(mockClusterManagersController, times(1)).addClusterManagers(any()); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index aba30f67ed02..50b9a169b023 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -356,8 +356,7 @@ public void controller_BatchAddMultipleMarkersWithClusterManagerId() { Mockito.argThat( markerBuilders -> markerBuilders.size() == 5 - && markerBuilders - .stream() + && markerBuilders.stream() .allMatch(mb -> mb.clusterManagerId().equals(clusterManagerId)))); // Verify addItem is never called (we're using batch operation) @@ -398,8 +397,7 @@ public void controller_BatchRemoveMultipleMarkersWithClusterManagerId() { Mockito.argThat( markerBuilders -> markerBuilders.size() == 5 - && markerBuilders - .stream() + && markerBuilders.stream() .allMatch(mb -> mb.clusterManagerId().equals(clusterManagerId)))); // Verify removeItem is never called (we're using batch operation) @@ -453,8 +451,7 @@ public void controller_BatchChangeMarkersWithClusterManagerChange() { Mockito.argThat( markerBuilders -> markerBuilders.size() == 5 - && markerBuilders - .stream() + && markerBuilders.stream() .allMatch(mb -> mb.clusterManagerId().equals(clusterManagerId1)))); // Verify addItems is called exactly once for cluster manager 2 with all 5 markers @@ -464,8 +461,7 @@ public void controller_BatchChangeMarkersWithClusterManagerChange() { Mockito.argThat( markerBuilders -> markerBuilders.size() == 5 - && markerBuilders - .stream() + && markerBuilders.stream() .allMatch(mb -> mb.clusterManagerId().equals(clusterManagerId2)))); // Verify individual operations are never called (we're using batch operations) diff --git a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java index c19c4bbb6e05..f97167c4eb6c 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java @@ -64,7 +64,8 @@ String getPathFromUri(final Context context, final Uri uri) { String uuid = UUID.randomUUID().toString(); File targetDirectory = new File(context.getCacheDir(), uuid); targetDirectory.mkdir(); - // TODO(SynSzakala) according to the docs, `deleteOnExit` does not work reliably on Android; we should preferably + // TODO(SynSzakala) according to the docs, `deleteOnExit` does not work reliably on Android; + // we should preferably // just clear the picked files after the app startup. targetDirectory.deleteOnExit(); String fileName = getImageName(context, uri); @@ -102,7 +103,9 @@ String getPathFromUri(final Context context, final Uri uri) { } } - /** @return extension of image with dot, or null if it's empty. */ + /** + * @return extension of image with dot, or null if it's empty. + */ private static String getImageExtension(Context context, Uri uriImage) { String extension; @@ -126,7 +129,8 @@ private static String getImageExtension(Context context, Uri uriImage) { return "." + sanitizeFilename(extension); } - // From https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#sanitize-provided-filenames. + // From + // https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#sanitize-provided-filenames. protected static @Nullable String sanitizeFilename(@Nullable String displayName) { if (displayName == null) { return null; @@ -160,7 +164,9 @@ private static String getImageExtension(Context context, Uri uriImage) { return f; } - /** @return name of the image provided by ContentResolver; this may be null. */ + /** + * @return name of the image provided by ContentResolver; this may be null. + */ private static String getImageName(Context context, Uri uriImage) { try (Cursor cursor = queryImageName(context, uriImage)) { if (cursor == null || !cursor.moveToFirst() || cursor.getColumnCount() < 1) return null; diff --git a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java index 0b8299ba163d..0aa5bfbd4fda 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java @@ -182,7 +182,8 @@ private File createImageOnExternalDirectory(String name, Bitmap bitmap, int imag if (saveAsPNG) { Log.d( "ImageResizer", - "image_picker: compressing is not supported for type PNG. Returning the image with original quality"); + "image_picker: compressing is not supported for type PNG. Returning the image with" + + " original quality"); } bitmap.compress( saveAsPNG ? Bitmap.CompressFormat.PNG : Bitmap.CompressFormat.JPEG, diff --git a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java index bf582fa4d35b..9221e7d02809 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java @@ -870,6 +870,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -878,6 +879,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -886,6 +888,7 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImagePickerApi { /** Selects images and returns their paths. */ @@ -894,17 +897,20 @@ void pickImages( @NonNull ImageSelectionOptions options, @NonNull GeneralOptions generalOptions, @NonNull Result> result); + /** Selects video and returns their paths. */ void pickVideos( @NonNull SourceSpecification source, @NonNull VideoSelectionOptions options, @NonNull GeneralOptions generalOptions, @NonNull Result> result); + /** Selects images and videos and returns their paths. */ void pickMedia( @NonNull MediaSelectionOptions mediaSelectionOptions, @NonNull GeneralOptions generalOptions, @NonNull Result> result); + /** Returns results from a previous app session, if any. */ @Nullable CacheRetrievalResult retrieveLostResults(); @@ -913,6 +919,7 @@ void pickMedia( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `ImagePickerApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable ImagePickerApi api) { setUp(binaryMessenger, "", api); diff --git a/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/FileUtilTest.java b/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/FileUtilTest.java index 6d5336a75d8d..c0007be4ede6 100644 --- a/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/FileUtilTest.java +++ b/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/FileUtilTest.java @@ -217,7 +217,8 @@ public int update( // Mocks a malicious content provider attempting to use path indirection to modify files outside // of the intended directory. - // See https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#don%27t-trust-user-input. + // See + // https://developer.android.com/privacy-and-security/risks/untrustworthy-contentprovider-provided-filename#don%27t-trust-user-input. private static class MockMaliciousContentProvider extends ContentProvider { public static String PNG_URI = "content://dummy/a.png"; diff --git a/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java b/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java index f34f3e03b8b5..772c3981b4fe 100644 --- a/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java +++ b/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java @@ -33,7 +33,8 @@ import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; -// RobolectricTestRunner always creates a default mock bitmap when reading from file. So we cannot actually test the scaling. +// RobolectricTestRunner always creates a default mock bitmap when reading from file. So we cannot +// actually test the scaling. // But we can still test whether the original or scaled file is created. @RunWith(RobolectricTestRunner.class) public class ImageResizerTest { diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java index 40038b0df832..17693a1081fd 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java @@ -19,7 +19,8 @@ public class InAppPurchasePlugin implements FlutterPlugin, ActivityAware { static final String PROXY_PACKAGE_KEY = "PROXY_PACKAGE"; // The proxy value has to match the value in library's AndroidManifest.xml. // This is important that the is not changed, so we hard code the value here then having - // a unit test to make sure. If there is a strong reason to change the value, please inform the + // a unit test to make sure. If there is a strong reason to change the value, please + // inform the // code owner of this package. static final String PROXY_VALUE = "io.flutter.plugins.inapppurchase"; @@ -61,7 +62,7 @@ private void setUpMethodChannel(BinaryMessenger messenger, Context context) { Messages.InAppPurchaseCallbackApi handler = new Messages.InAppPurchaseCallbackApi(messenger); methodCallHandler = new MethodCallHandlerImpl( - /*activity=*/ null, context, handler, new BillingClientFactoryImpl()); + /* activity= */ null, context, handler, new BillingClientFactoryImpl()); Messages.InAppPurchaseApi.setUp(messenger, methodCallHandler); } diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java index fa1135fed036..5a9191c4e860 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java @@ -3304,6 +3304,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -3312,6 +3313,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -3320,39 +3322,48 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface InAppPurchaseApi { /** Wraps BillingClient#isReady. */ @NonNull Boolean isReady(); + /** Wraps BillingClient#startConnection(BillingClientStateListener). */ void startConnection( @NonNull Long callbackHandle, @NonNull PlatformBillingChoiceMode billingMode, @NonNull PlatformPendingPurchasesParams pendingPurchasesParams, @NonNull Result result); + /** Wraps BillingClient#endConnection(BillingClientStateListener). */ void endConnection(); + /** * Wraps BillingClient#getBillingConfigAsync(GetBillingConfigParams, * BillingConfigResponseListener). */ void getBillingConfigAsync(@NonNull Result result); + /** Wraps BillingClient#launchBillingFlow(Activity, BillingFlowParams). */ @NonNull PlatformBillingResult launchBillingFlow(@NonNull PlatformBillingFlowParams params); + /** * Wraps BillingClient#acknowledgePurchase(AcknowledgePurchaseParams, * AcknowledgePurchaseResponseListener). */ void acknowledgePurchase( @NonNull String purchaseToken, @NonNull Result result); + /** Wraps BillingClient#consumeAsync(ConsumeParams, ConsumeResponseListener). */ void consumeAsync(@NonNull String purchaseToken, @NonNull Result result); + /** Wraps BillingClient#queryPurchasesAsync(QueryPurchaseParams, PurchaseResponseListener). */ void queryPurchasesAsync( @NonNull PlatformProductType productType, @NonNull Result result); + /** * Wraps BillingClient#queryPurchaseHistoryAsync(QueryPurchaseHistoryParams, * PurchaseHistoryResponseListener). @@ -3360,6 +3371,7 @@ void queryPurchasesAsync( void queryPurchaseHistoryAsync( @NonNull PlatformProductType productType, @NonNull Result result); + /** * Wraps BillingClient#queryProductDetailsAsync(QueryProductDetailsParams, * ProductDetailsResponseListener). @@ -3367,13 +3379,17 @@ void queryPurchaseHistoryAsync( void queryProductDetailsAsync( @NonNull List products, @NonNull Result result); + /** Wraps BillingClient#isFeatureSupported(String). */ @NonNull Boolean isFeatureSupported(@NonNull PlatformBillingClientFeature feature); + /** Wraps BillingClient#isAlternativeBillingOnlyAvailableAsync(). */ void isAlternativeBillingOnlyAvailableAsync(@NonNull Result result); + /** Wraps BillingClient#showAlternativeBillingOnlyInformationDialog(). */ void showAlternativeBillingOnlyInformationDialog(@NonNull Result result); + /** * Wraps * BillingClient#createAlternativeBillingOnlyReportingDetailsAsync(AlternativeBillingOnlyReportingDetailsListener). @@ -3385,6 +3401,7 @@ void createAlternativeBillingOnlyReportingDetailsAsync( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `InAppPurchaseApi` to handle messages through the `binaryMessenger`. */ @@ -3813,6 +3830,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class InAppPurchaseCallbackApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -3832,6 +3850,7 @@ public InAppPurchaseCallbackApi( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Called for BillingClientStateListener#onBillingServiceDisconnected(). */ public void onBillingServiceDisconnected( @NonNull Long callbackHandleArg, @NonNull VoidResult result) { @@ -3857,6 +3876,7 @@ public void onBillingServiceDisconnected( } }); } + /** Called for PurchasesUpdatedListener#onPurchasesUpdated(BillingResult, List). */ public void onPurchasesUpdated( @NonNull PlatformPurchasesResponse updateArg, @NonNull VoidResult result) { @@ -3882,6 +3902,7 @@ public void onPurchasesUpdated( } }); } + /** Called for UserChoiceBillingListener#userSelectedAlternativeBilling(UserChoiceDetails). */ public void userSelectedalternativeBilling( @NonNull PlatformUserChoiceDetails detailsArg, @NonNull VoidResult result) { diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java index d496fb57b323..fe9a0cb1016f 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java @@ -255,7 +255,9 @@ public void queryProductDetailsAsync( "NOT_FOUND", "Details for product " + params.getProduct() - + " are not available. It might because products were not fetched prior to the call. Please fetch the products first. An example of how to fetch the products could be found here: " + + " are not available. It might because products were not fetched prior to the call." + + " Please fetch the products first. An example of how to fetch the products could be" + + " found here: " + LOAD_PRODUCT_DOC_URL, null); } @@ -279,7 +281,9 @@ public void queryProductDetailsAsync( + params.getOfferToken() + " for product " + params.getProduct() - + " is not valid. Make sure to only pass offer tokens that belong to the product. To obtain offer tokens for a product, fetch the products. An example of how to fetch the products could be found here: " + + " is not valid. Make sure to only pass offer tokens that belong to the product." + + " To obtain offer tokens for a product, fetch the products. An example of how to" + + " fetch the products could be found here: " + LOAD_PRODUCT_DOC_URL, null); } @@ -290,7 +294,8 @@ public void queryProductDetailsAsync( != REPLACEMENT_MODE_UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY)) { throw new FlutterError( "IN_APP_PURCHASE_REQUIRE_OLD_PRODUCT", - "launchBillingFlow failed because oldProduct is null. You must provide a valid oldProduct in order to use a replacement mode.", + "launchBillingFlow failed because oldProduct is null. You must provide a valid oldProduct" + + " in order to use a replacement mode.", null); } else if (params.getOldProduct() != null && !cachedProducts.containsKey(params.getOldProduct())) { @@ -298,7 +303,9 @@ public void queryProductDetailsAsync( "IN_APP_PURCHASE_INVALID_OLD_PRODUCT", "Details for product " + params.getOldProduct() - + " are not available. It might because products were not fetched prior to the call. Please fetch the products first. An example of how to fetch the products could be found here: " + + " are not available. It might because products were not fetched prior to the call." + + " Please fetch the products first. An example of how to fetch the products could be" + + " found here: " + LOAD_PRODUCT_DOC_URL, null); } diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java index a982964764dc..cba877cdc184 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java @@ -95,7 +95,7 @@ static PlatformProductType toPlatformProductType(@NonNull String typeString) { switch (typeString) { case BillingClient.ProductType.INAPP: - // Fallback handling to avoid throwing an exception if a new type is added in the future. + // Fallback handling to avoid throwing an exception if a new type is added in the future. default: return PlatformProductType.INAPP; case BillingClient.ProductType.SUBS: diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/InAppPurchasePluginTest.java b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/InAppPurchasePluginTest.java index 2e5fe6154abd..80a1018a96c9 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/InAppPurchasePluginTest.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/InAppPurchasePluginTest.java @@ -49,19 +49,26 @@ public void tearDown() throws Exception { mockCloseable.close(); } - // The PROXY_PACKAGE_KEY value of this test (io.flutter.plugins.inapppurchase) should never be changed. - // In case there's a strong reason to change it, please inform the current code owner of the plugin. + // The PROXY_PACKAGE_KEY value of this test (io.flutter.plugins.inapppurchase) should never be + // changed. + // In case there's a strong reason to change it, please inform the current code owner of the + // plugin. @Test public void attachToActivity_proxyIsSet_V2Embedding() { InAppPurchasePlugin plugin = new InAppPurchasePlugin(); plugin.onAttachedToEngine(flutterPluginBinding); plugin.onAttachedToActivity(activityPluginBinding); - // The `PROXY_PACKAGE_KEY` value is hard coded in the plugin code as "io.flutter.plugins.inapppurchase". - // We cannot use `BuildConfig.LIBRARY_PACKAGE_NAME` directly in the plugin code because whether to read BuildConfig.APPLICATION_ID or LIBRARY_PACKAGE_NAME - // depends on the "APP's" Android Gradle plugin version. Newer versions of AGP use LIBRARY_PACKAGE_NAME, whereas older ones use BuildConfig.APPLICATION_ID. + // The `PROXY_PACKAGE_KEY` value is hard coded in the plugin code as + // "io.flutter.plugins.inapppurchase". + // We cannot use `BuildConfig.LIBRARY_PACKAGE_NAME` directly in the plugin code because whether + // to read BuildConfig.APPLICATION_ID or LIBRARY_PACKAGE_NAME + // depends on the "APP's" Android Gradle plugin version. Newer versions of AGP use + // LIBRARY_PACKAGE_NAME, whereas older ones use BuildConfig.APPLICATION_ID. Mockito.verify(mockIntent).putExtra(PROXY_PACKAGE_KEY, "io.flutter.plugins.inapppurchase"); assertEquals("io.flutter.plugins.inapppurchase", BuildConfig.LIBRARY_PACKAGE_NAME); } } -// We cannot use `BuildConfig.LIBRARY_PACKAGE_NAME` directly in the plugin code because whether to read BuildConfig.APPLICATION_ID or LIBRARY_PACKAGE_NAME -// depends on the "APP's" Android Gradle plugin version. Newer versions of AGP use LIBRARY_PACKAGE_NAME, whereas older ones use BuildConfig.APPLICATION_ID. +// We cannot use `BuildConfig.LIBRARY_PACKAGE_NAME` directly in the plugin code because whether to +// read BuildConfig.APPLICATION_ID or LIBRARY_PACKAGE_NAME +// depends on the "APP's" Android Gradle plugin version. Newer versions of AGP use +// LIBRARY_PACKAGE_NAME, whereas older ones use BuildConfig.APPLICATION_ID. diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java index d4cfeda77d0d..e48f2d14b71b 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java @@ -1194,7 +1194,9 @@ private List buildProductList( private ProductDetails buildProductDetails(String id) { String json = String.format( - "{\"title\":\"Example title\",\"description\":\"Example description\",\"productId\":\"%s\",\"type\":\"inapp\",\"name\":\"Example name\",\"oneTimePurchaseOfferDetails\":{\"priceAmountMicros\":990000,\"priceCurrencyCode\":\"USD\",\"formattedPrice\":\"$0.99\"}}", + "{\"title\":\"Example title\",\"description\":\"Example" + + " description\",\"productId\":\"%s\",\"type\":\"inapp\",\"name\":\"Example" + + " name\",\"oneTimePurchaseOfferDetails\":{\"priceAmountMicros\":990000,\"priceCurrencyCode\":\"USD\",\"formattedPrice\":\"$0.99\"}}", id); try { diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/TranslatorTest.java b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/TranslatorTest.java index b8c7fb4e8ccb..6d6f60904dcd 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/TranslatorTest.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/TranslatorTest.java @@ -30,11 +30,21 @@ public class TranslatorTest { private static final String PURCHASE_EXAMPLE_JSON = - "{\"orderId\":\"foo\",\"packageName\":\"bar\",\"productId\":\"consumable\",\"purchaseTime\":11111111,\"purchaseState\":0,\"purchaseToken\":\"baz\",\"developerPayload\":\"dummy payload\",\"isAcknowledged\":\"true\", \"obfuscatedAccountId\":\"Account101\", \"obfuscatedProfileId\":\"Profile105\"}"; + "{\"orderId\":\"foo\",\"packageName\":\"bar\",\"productId\":\"consumable\",\"purchaseTime\":11111111,\"purchaseState\":0,\"purchaseToken\":\"baz\",\"developerPayload\":\"dummy" + + " payload\",\"isAcknowledged\":\"true\", \"obfuscatedAccountId\":\"Account101\"," + + " \"obfuscatedProfileId\":\"Profile105\"}"; private static final String IN_APP_PRODUCT_DETAIL_EXAMPLE_JSON = - "{\"title\":\"Example title\",\"description\":\"Example description\",\"productId\":\"Example id\",\"type\":\"inapp\",\"name\":\"Example name\",\"oneTimePurchaseOfferDetails\":{\"priceAmountMicros\":990000,\"priceCurrencyCode\":\"USD\",\"formattedPrice\":\"$0.99\"}}"; + "{\"title\":\"Example title\",\"description\":\"Example description\",\"productId\":\"Example" + + " id\",\"type\":\"inapp\",\"name\":\"Example" + + " name\",\"oneTimePurchaseOfferDetails\":{\"priceAmountMicros\":990000,\"priceCurrencyCode\":\"USD\",\"formattedPrice\":\"$0.99\"}}"; private static final String SUBS_PRODUCT_DETAIL_EXAMPLE_JSON = - "{\"title\":\"Example title 2\",\"description\":\"Example description 2\",\"productId\":\"Example id 2\",\"type\":\"subs\",\"name\":\"Example name 2\",\"subscriptionOfferDetails\":[{\"offerId\":\"Example offer id\",\"basePlanId\":\"Example base plan id\",\"offerTags\":[\"Example offer tag\"],\"offerIdToken\":\"Example offer token\",\"pricingPhases\":[{\"formattedPrice\":\"$0.99\",\"priceCurrencyCode\":\"USD\",\"priceAmountMicros\":990000,\"billingCycleCount\":4,\"billingPeriod\":\"Example billing period\",\"recurrenceMode\":1}]}]}"; + "{\"title\":\"Example title 2\",\"description\":\"Example description" + + " 2\",\"productId\":\"Example id 2\",\"type\":\"subs\",\"name\":\"Example name" + + " 2\",\"subscriptionOfferDetails\":[{\"offerId\":\"Example offer" + + " id\",\"basePlanId\":\"Example base plan id\",\"offerTags\":[\"Example offer" + + " tag\"],\"offerIdToken\":\"Example offer" + + " token\",\"pricingPhases\":[{\"formattedPrice\":\"$0.99\",\"priceCurrencyCode\":\"USD\",\"priceAmountMicros\":990000,\"billingCycleCount\":4,\"billingPeriod\":\"Example" + + " billing period\",\"recurrenceMode\":1}]}]}"; Constructor productDetailsConstructor; @@ -115,7 +125,8 @@ public void fromPurchaseHistoryRecord() throws JSONException { @Test public void fromPurchasesHistoryRecordList() throws JSONException { final String purchase2Json = - "{\"orderId\":\"foo2\",\"packageName\":\"bar\",\"productId\":\"consumable\",\"purchaseTime\":11111111,\"purchaseState\":0,\"purchaseToken\":\"baz\",\"developerPayload\":\"dummy payload\",\"isAcknowledged\":\"true\"}"; + "{\"orderId\":\"foo2\",\"packageName\":\"bar\",\"productId\":\"consumable\",\"purchaseTime\":11111111,\"purchaseState\":0,\"purchaseToken\":\"baz\",\"developerPayload\":\"dummy" + + " payload\",\"isAcknowledged\":\"true\"}"; final String signature = "signature"; final List expected = Arrays.asList( @@ -138,7 +149,8 @@ public void fromPurchasesHistoryRecordList_null() { @Test public void fromPurchasesList() throws JSONException { final String purchase2Json = - "{\"orderId\":\"foo2\",\"packageName\":\"bar\",\"productId\":\"consumable\",\"purchaseTime\":11111111,\"purchaseState\":0,\"purchaseToken\":\"baz\",\"developerPayload\":\"dummy payload\",\"isAcknowledged\":\"true\"}"; + "{\"orderId\":\"foo2\",\"packageName\":\"bar\",\"productId\":\"consumable\",\"purchaseTime\":11111111,\"purchaseState\":0,\"purchaseToken\":\"baz\",\"developerPayload\":\"dummy" + + " payload\",\"isAcknowledged\":\"true\"}"; final String signature = "signature"; final List expected = Arrays.asList( diff --git a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java index 751c1f5dc3b0..b649738648ab 100644 --- a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java +++ b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java @@ -421,6 +421,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -429,6 +430,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -437,6 +439,7 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ExampleHostApi { @@ -452,6 +455,7 @@ public interface ExampleHostApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable ExampleHostApi api) { setUp(binaryMessenger, "", api); @@ -545,6 +549,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class MessageFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index 8b3825849e95..a21588a5c9df 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java @@ -3012,6 +3012,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -3020,6 +3021,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -3028,6 +3030,7 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** * The core interface that each host language plugin must implement in platform_test integration * tests. @@ -3039,191 +3042,250 @@ public interface HostIntegrationCoreApi { * A no-op function taking no arguments and returning no value, to sanity test basic calling. */ void noop(); + /** Returns the passed object, to test serialization and deserialization. */ @NonNull AllTypes echoAllTypes(@NonNull AllTypes everything); + /** Returns an error, to test error handling. */ @Nullable Object throwError(); + /** Returns an error from a void function, to test error handling. */ void throwErrorFromVoid(); + /** Returns a Flutter error, to test error handling. */ @Nullable Object throwFlutterError(); + /** Returns passed in int. */ @NonNull Long echoInt(@NonNull Long anInt); + /** Returns passed in double. */ @NonNull Double echoDouble(@NonNull Double aDouble); + /** Returns the passed in boolean. */ @NonNull Boolean echoBool(@NonNull Boolean aBool); + /** Returns the passed in string. */ @NonNull String echoString(@NonNull String aString); + /** Returns the passed in Uint8List. */ @NonNull byte[] echoUint8List(@NonNull byte[] aUint8List); + /** Returns the passed in generic Object. */ @NonNull Object echoObject(@NonNull Object anObject); + /** Returns the passed list, to test serialization and deserialization. */ @NonNull List echoList(@NonNull List list); + /** Returns the passed list, to test serialization and deserialization. */ @NonNull List echoEnumList(@NonNull List enumList); + /** Returns the passed list, to test serialization and deserialization. */ @NonNull List echoClassList(@NonNull List classList); + /** Returns the passed list, to test serialization and deserialization. */ @NonNull List echoNonNullEnumList(@NonNull List enumList); + /** Returns the passed list, to test serialization and deserialization. */ @NonNull List echoNonNullClassList(@NonNull List classList); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoMap(@NonNull Map map); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoStringMap(@NonNull Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoIntMap(@NonNull Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoEnumMap(@NonNull Map enumMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoClassMap(@NonNull Map classMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoNonNullStringMap(@NonNull Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoNonNullIntMap(@NonNull Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoNonNullEnumMap(@NonNull Map enumMap); + /** Returns the passed map, to test serialization and deserialization. */ @NonNull Map echoNonNullClassMap(@NonNull Map classMap); + /** Returns the passed class to test nested class serialization and deserialization. */ @NonNull AllClassesWrapper echoClassWrapper(@NonNull AllClassesWrapper wrapper); + /** Returns the passed enum to test serialization and deserialization. */ @NonNull AnEnum echoEnum(@NonNull AnEnum anEnum); + /** Returns the passed enum to test serialization and deserialization. */ @NonNull AnotherEnum echoAnotherEnum(@NonNull AnotherEnum anotherEnum); + /** Returns the default string. */ @NonNull String echoNamedDefaultString(@NonNull String aString); + /** Returns passed in double. */ @NonNull Double echoOptionalDefaultDouble(@NonNull Double aDouble); + /** Returns passed in int. */ @NonNull Long echoRequiredInt(@NonNull Long anInt); + /** Returns the result of platform-side equality check. */ @NonNull Boolean areAllNullableTypesEqual(@NonNull AllNullableTypes a, @NonNull AllNullableTypes b); + /** Returns the platform-side hash code for the given object. */ @NonNull Long getAllNullableTypesHash(@NonNull AllNullableTypes value); + /** Returns the platform-side hash code for the given object. */ @NonNull Long getAllNullableTypesWithoutRecursionHash(@NonNull AllNullableTypesWithoutRecursion value); + /** Returns the passed object, to test serialization and deserialization. */ @Nullable AllNullableTypes echoAllNullableTypes(@Nullable AllNullableTypes everything); + /** Returns the passed object, to test serialization and deserialization. */ @Nullable AllNullableTypesWithoutRecursion echoAllNullableTypesWithoutRecursion( @Nullable AllNullableTypesWithoutRecursion everything); + /** * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. */ @Nullable String extractNestedNullableString(@NonNull AllClassesWrapper wrapper); + /** * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. */ @NonNull AllClassesWrapper createNestedNullableString(@Nullable String nullableString); + /** Returns passed in arguments of multiple types. */ @NonNull AllNullableTypes sendMultipleNullableTypes( @Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString); + /** Returns passed in arguments of multiple types. */ @NonNull AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( @Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString); + /** Returns passed in int. */ @Nullable Long echoNullableInt(@Nullable Long aNullableInt); + /** Returns passed in double. */ @Nullable Double echoNullableDouble(@Nullable Double aNullableDouble); + /** Returns the passed in boolean. */ @Nullable Boolean echoNullableBool(@Nullable Boolean aNullableBool); + /** Returns the passed in string. */ @Nullable String echoNullableString(@Nullable String aNullableString); + /** Returns the passed in Uint8List. */ @Nullable byte[] echoNullableUint8List(@Nullable byte[] aNullableUint8List); + /** Returns the passed in generic Object. */ @Nullable Object echoNullableObject(@Nullable Object aNullableObject); + /** Returns the passed list, to test serialization and deserialization. */ @Nullable List echoNullableList(@Nullable List aNullableList); + /** Returns the passed list, to test serialization and deserialization. */ @Nullable List echoNullableEnumList(@Nullable List enumList); + /** Returns the passed list, to test serialization and deserialization. */ @Nullable List echoNullableClassList(@Nullable List classList); + /** Returns the passed list, to test serialization and deserialization. */ @Nullable List echoNullableNonNullEnumList(@Nullable List enumList); + /** Returns the passed list, to test serialization and deserialization. */ @Nullable List echoNullableNonNullClassList(@Nullable List classList); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableMap(@Nullable Map map); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableStringMap(@Nullable Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableIntMap(@Nullable Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableEnumMap(@Nullable Map enumMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableClassMap( @Nullable Map classMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableNonNullStringMap(@Nullable Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableNonNullIntMap(@Nullable Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableNonNullEnumMap(@Nullable Map enumMap); + /** Returns the passed map, to test serialization and deserialization. */ @Nullable Map echoNullableNonNullClassMap( @@ -3234,122 +3296,165 @@ Map echoNullableNonNullClassMap( @Nullable AnotherEnum echoAnotherNullableEnum(@Nullable AnotherEnum anotherEnum); + /** Returns passed in int. */ @Nullable Long echoOptionalNullableInt(@Nullable Long aNullableInt); + /** Returns the passed in string. */ @Nullable String echoNamedNullableString(@Nullable String aNullableString); + /** * A no-op function taking no arguments and returning no value, to sanity test basic * asynchronous calling. */ void noopAsync(@NonNull VoidResult result); + /** Returns passed in int asynchronously. */ void echoAsyncInt(@NonNull Long anInt, @NonNull Result result); + /** Returns passed in double asynchronously. */ void echoAsyncDouble(@NonNull Double aDouble, @NonNull Result result); + /** Returns the passed in boolean asynchronously. */ void echoAsyncBool(@NonNull Boolean aBool, @NonNull Result result); + /** Returns the passed string asynchronously. */ void echoAsyncString(@NonNull String aString, @NonNull Result result); + /** Returns the passed in Uint8List asynchronously. */ void echoAsyncUint8List(@NonNull byte[] aUint8List, @NonNull Result result); + /** Returns the passed in generic Object asynchronously. */ void echoAsyncObject(@NonNull Object anObject, @NonNull Result result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncList(@NonNull List list, @NonNull Result> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncEnumList(@NonNull List enumList, @NonNull Result> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncClassList( @NonNull List classList, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncMap( @NonNull Map map, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncStringMap( @NonNull Map stringMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncIntMap(@NonNull Map intMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncEnumMap( @NonNull Map enumMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncClassMap( @NonNull Map classMap, @NonNull Result> result); + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncEnum(@NonNull AnEnum anEnum, @NonNull Result result); + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAnotherAsyncEnum( @NonNull AnotherEnum anotherEnum, @NonNull Result result); + /** Responds with an error from an async function returning a value. */ void throwAsyncError(@NonNull NullableResult result); + /** Responds with an error from an async void function. */ void throwAsyncErrorFromVoid(@NonNull VoidResult result); + /** Responds with a Flutter error from an async function returning a value. */ void throwAsyncFlutterError(@NonNull NullableResult result); + /** Returns the passed object, to test async serialization and deserialization. */ void echoAsyncAllTypes(@NonNull AllTypes everything, @NonNull Result result); + /** Returns the passed object, to test serialization and deserialization. */ void echoAsyncNullableAllNullableTypes( @Nullable AllNullableTypes everything, @NonNull NullableResult result); + /** Returns the passed object, to test serialization and deserialization. */ void echoAsyncNullableAllNullableTypesWithoutRecursion( @Nullable AllNullableTypesWithoutRecursion everything, @NonNull NullableResult result); + /** Returns passed in int asynchronously. */ void echoAsyncNullableInt(@Nullable Long anInt, @NonNull NullableResult result); + /** Returns passed in double asynchronously. */ void echoAsyncNullableDouble(@Nullable Double aDouble, @NonNull NullableResult result); + /** Returns the passed in boolean asynchronously. */ void echoAsyncNullableBool(@Nullable Boolean aBool, @NonNull NullableResult result); + /** Returns the passed string asynchronously. */ void echoAsyncNullableString(@Nullable String aString, @NonNull NullableResult result); + /** Returns the passed in Uint8List asynchronously. */ void echoAsyncNullableUint8List( @Nullable byte[] aUint8List, @NonNull NullableResult result); + /** Returns the passed in generic Object asynchronously. */ void echoAsyncNullableObject(@Nullable Object anObject, @NonNull NullableResult result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncNullableList( @Nullable List list, @NonNull NullableResult> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnumList( @Nullable List enumList, @NonNull NullableResult> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncNullableClassList( @Nullable List classList, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableMap( @Nullable Map map, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableStringMap( @Nullable Map stringMap, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableIntMap( @Nullable Map intMap, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnumMap( @Nullable Map enumMap, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableClassMap( @Nullable Map classMap, @NonNull NullableResult> result); + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAnotherAsyncNullableEnum( @Nullable AnotherEnum anotherEnum, @NonNull NullableResult result); + /** * Returns true if the handler is run on a main thread, which should be true since there is no * TaskQueue annotation. */ @NonNull Boolean defaultIsMainThread(); + /** * Returns true if the handler is run on a non-main thread, which should be true for any * platform with TaskQueue support. @@ -3516,6 +3621,7 @@ void callFlutterEchoAnotherNullableEnum( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the * `binaryMessenger`. @@ -8059,6 +8165,7 @@ public void error(Throwable error) { } } } + /** * The core interface that the Dart platform_test code implements for host integration tests to * call into. @@ -8083,6 +8190,7 @@ public FlutterIntegrationCoreApi( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * A no-op function taking no arguments and returning no value, to sanity test basic calling. */ @@ -8109,6 +8217,7 @@ public void noop(@NonNull VoidResult result) { } }); } + /** Responds with an error from an async function returning a value. */ public void throwError(@NonNull NullableResult result) { final String channelName = @@ -8135,6 +8244,7 @@ public void throwError(@NonNull NullableResult result) { } }); } + /** Responds with an error from an async void function. */ public void throwErrorFromVoid(@NonNull VoidResult result) { final String channelName = @@ -8159,6 +8269,7 @@ public void throwErrorFromVoid(@NonNull VoidResult result) { } }); } + /** Returns the passed object, to test serialization and deserialization. */ public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { final String channelName = @@ -8191,6 +8302,7 @@ public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { final String channelName = @@ -8361,6 +8477,7 @@ public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) } }); } + /** Returns the passed int, to test serialization and deserialization. */ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { final String channelName = @@ -8393,6 +8510,7 @@ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { } }); } + /** Returns the passed double, to test serialization and deserialization. */ public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result result) { final String channelName = @@ -8425,6 +8543,7 @@ public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result resul } }); } + /** Returns the passed string, to test serialization and deserialization. */ public void echoString(@NonNull String aStringArg, @NonNull Result result) { final String channelName = @@ -8457,6 +8576,7 @@ public void echoString(@NonNull String aStringArg, @NonNull Result resul } }); } + /** Returns the passed byte list, to test serialization and deserialization. */ public void echoUint8List(@NonNull byte[] listArg, @NonNull Result result) { final String channelName = @@ -8489,6 +8609,7 @@ public void echoUint8List(@NonNull byte[] listArg, @NonNull Result resul } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoList(@NonNull List listArg, @NonNull Result> result) { final String channelName = @@ -8521,6 +8642,7 @@ public void echoList(@NonNull List listArg, @NonNull Result } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoEnumList( @NonNull List enumListArg, @NonNull Result> result) { @@ -8554,6 +8676,7 @@ public void echoEnumList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoClassList( @NonNull List classListArg, @@ -8588,6 +8711,7 @@ public void echoClassList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNonNullEnumList( @NonNull List enumListArg, @NonNull Result> result) { @@ -8621,6 +8745,7 @@ public void echoNonNullEnumList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNonNullClassList( @NonNull List classListArg, @@ -8655,6 +8780,7 @@ public void echoNonNullClassList( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoMap( @NonNull Map mapArg, @NonNull Result> result) { @@ -8688,6 +8814,7 @@ public void echoMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoStringMap( @NonNull Map stringMapArg, @NonNull Result> result) { @@ -8721,6 +8848,7 @@ public void echoStringMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoIntMap( @NonNull Map intMapArg, @NonNull Result> result) { @@ -8754,6 +8882,7 @@ public void echoIntMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoEnumMap( @NonNull Map enumMapArg, @NonNull Result> result) { @@ -8787,6 +8916,7 @@ public void echoEnumMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoClassMap( @NonNull Map classMapArg, @@ -8821,6 +8951,7 @@ public void echoClassMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNonNullStringMap( @NonNull Map stringMapArg, @NonNull Result> result) { @@ -8854,6 +8985,7 @@ public void echoNonNullStringMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNonNullIntMap( @NonNull Map intMapArg, @NonNull Result> result) { @@ -8887,6 +9019,7 @@ public void echoNonNullIntMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNonNullEnumMap( @NonNull Map enumMapArg, @NonNull Result> result) { @@ -8920,6 +9053,7 @@ public void echoNonNullEnumMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNonNullClassMap( @NonNull Map classMapArg, @@ -8954,6 +9088,7 @@ public void echoNonNullClassMap( } }); } + /** Returns the passed enum to test serialization and deserialization. */ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) { final String channelName = @@ -8986,6 +9121,7 @@ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) } }); } + /** Returns the passed enum to test serialization and deserialization. */ public void echoAnotherEnum( @NonNull AnotherEnum anotherEnumArg, @NonNull Result result) { @@ -9019,6 +9155,7 @@ public void echoAnotherEnum( } }); } + /** Returns the passed boolean, to test serialization and deserialization. */ public void echoNullableBool( @Nullable Boolean aBoolArg, @NonNull NullableResult result) { @@ -9046,6 +9183,7 @@ public void echoNullableBool( } }); } + /** Returns the passed int, to test serialization and deserialization. */ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { final String channelName = @@ -9072,6 +9210,7 @@ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { @@ -9099,6 +9238,7 @@ public void echoNullableDouble( } }); } + /** Returns the passed string, to test serialization and deserialization. */ public void echoNullableString( @Nullable String aStringArg, @NonNull NullableResult result) { @@ -9126,6 +9266,7 @@ public void echoNullableString( } }); } + /** Returns the passed byte list, to test serialization and deserialization. */ public void echoNullableUint8List( @Nullable byte[] listArg, @NonNull NullableResult result) { @@ -9153,6 +9294,7 @@ public void echoNullableUint8List( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNullableList( @Nullable List listArg, @NonNull NullableResult> result) { @@ -9180,6 +9322,7 @@ public void echoNullableList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNullableEnumList( @Nullable List enumListArg, @NonNull NullableResult> result) { @@ -9207,6 +9350,7 @@ public void echoNullableEnumList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNullableClassList( @Nullable List classListArg, @@ -9235,6 +9379,7 @@ public void echoNullableClassList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNullableNonNullEnumList( @Nullable List enumListArg, @NonNull NullableResult> result) { @@ -9262,6 +9407,7 @@ public void echoNullableNonNullEnumList( } }); } + /** Returns the passed list, to test serialization and deserialization. */ public void echoNullableNonNullClassList( @Nullable List classListArg, @@ -9290,6 +9436,7 @@ public void echoNullableNonNullClassList( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableMap( @Nullable Map mapArg, @NonNull NullableResult> result) { @@ -9317,6 +9464,7 @@ public void echoNullableMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableStringMap( @Nullable Map stringMapArg, @@ -9345,6 +9493,7 @@ public void echoNullableStringMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableIntMap( @Nullable Map intMapArg, @NonNull NullableResult> result) { @@ -9372,6 +9521,7 @@ public void echoNullableIntMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableEnumMap( @Nullable Map enumMapArg, @@ -9400,6 +9550,7 @@ public void echoNullableEnumMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableClassMap( @Nullable Map classMapArg, @@ -9428,6 +9579,7 @@ public void echoNullableClassMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableNonNullStringMap( @Nullable Map stringMapArg, @@ -9456,6 +9608,7 @@ public void echoNullableNonNullStringMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableNonNullIntMap( @Nullable Map intMapArg, @NonNull NullableResult> result) { @@ -9483,6 +9636,7 @@ public void echoNullableNonNullIntMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableNonNullEnumMap( @Nullable Map enumMapArg, @@ -9511,6 +9665,7 @@ public void echoNullableNonNullEnumMap( } }); } + /** Returns the passed map, to test serialization and deserialization. */ public void echoNullableNonNullClassMap( @Nullable Map classMapArg, @@ -9539,6 +9694,7 @@ public void echoNullableNonNullClassMap( } }); } + /** Returns the passed enum to test serialization and deserialization. */ public void echoNullableEnum( @Nullable AnEnum anEnumArg, @NonNull NullableResult result) { @@ -9566,6 +9722,7 @@ public void echoNullableEnum( } }); } + /** Returns the passed enum to test serialization and deserialization. */ public void echoAnotherNullableEnum( @Nullable AnotherEnum anotherEnumArg, @NonNull NullableResult result) { @@ -9593,6 +9750,7 @@ public void echoAnotherNullableEnum( } }); } + /** * A no-op function taking no arguments and returning no value, to sanity test basic * asynchronous calling. @@ -9620,6 +9778,7 @@ public void noopAsync(@NonNull VoidResult result) { } }); } + /** Returns the passed in generic Object asynchronously. */ public void echoAsyncString(@NonNull String aStringArg, @NonNull Result result) { final String channelName = @@ -9653,6 +9812,7 @@ public void echoAsyncString(@NonNull String aStringArg, @NonNull Result }); } } + /** * An API that can be implemented for minimal, compile-only tests. * @@ -9666,6 +9826,7 @@ public interface HostTrivialApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostTrivialApi api) { setUp(binaryMessenger, "", api); @@ -9701,6 +9862,7 @@ static void setUp( } } } + /** * A simple API implemented in some unit tests. * @@ -9716,6 +9878,7 @@ public interface HostSmallApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostSmallApi api) { setUp(binaryMessenger, "", api); @@ -9790,6 +9953,7 @@ public void error(Throwable error) { } } } + /** * A simple API called in some unit tests. * diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/NonNullFieldsTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/NonNullFieldsTest.java index d2598d5c0f9d..0d398247b8ce 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/NonNullFieldsTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/NonNullFieldsTest.java @@ -7,7 +7,6 @@ import static org.junit.Assert.*; import com.example.alternate_language_test_plugin.NonNullFields.NonNullFieldSearchRequest; -import java.lang.IllegalStateException; import org.junit.Test; public class NonNullFieldsTest { diff --git a/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/Messages.java b/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/Messages.java index 8b5af38eb85d..35b4387ebfe9 100644 --- a/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/Messages.java +++ b/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/Messages.java @@ -229,6 +229,7 @@ public interface Result { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for nullable API method returns. */ public interface NullableResult { /** Success case callback method for handling returns. */ @@ -237,6 +238,7 @@ public interface NullableResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Asynchronous error handling return type for void API method returns. */ public interface VoidResult { /** Success case callback method for handling returns. */ @@ -245,13 +247,16 @@ public interface VoidResult { /** Failure case callback method for handling errors. */ void error(@NonNull Throwable error); } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AndroidQuickActionsApi { /** Checks for, and returns the action that launched the app. */ @Nullable String getLaunchAction(); + /** Sets the dynamic shortcuts for the app. */ void setShortcutItems(@NonNull List itemsList, @NonNull VoidResult result); + /** Removes all dynamic shortcuts. */ void clearShortcutItems(); @@ -259,6 +264,7 @@ public interface AndroidQuickActionsApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `AndroidQuickActionsApi` to handle messages through the * `binaryMessenger`. @@ -353,6 +359,7 @@ public void error(Throwable error) { } } } + /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class AndroidQuickActionsFlutterApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -372,6 +379,7 @@ public AndroidQuickActionsFlutterApi( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sends a string representing a shortcut from the native platform to the app. */ public void launchAction(@NonNull String actionArg, @NonNull VoidResult result) { final String channelName = diff --git a/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/QuickActions.java b/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/QuickActions.java index 0890399b58c0..93bec2ac3c43 100644 --- a/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/QuickActions.java +++ b/packages/quick_actions/quick_actions_android/android/src/main/java/io/flutter/plugins/quickactions/QuickActions.java @@ -48,7 +48,8 @@ public Activity getActivity() { } // Returns true when running on a version of Android that supports quick actions. - // When this returns false, methods should silently no-op, per the documented behavior (see README.md). + // When this returns false, methods should silently no-op, per the documented behavior (see + // README.md). @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.N_MR1) boolean isVersionAllowed() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1; @@ -78,7 +79,8 @@ public void setShortcutItems( final boolean didSucceed = dynamicShortcutsSet; - // TODO(camsim99): Investigate removing all of the executor logic in favor of background channels. + // TODO(camsim99): Investigate removing all of the executor logic in favor of background + // channels. uiThreadExecutor.execute( () -> { if (didSucceed) { diff --git a/packages/quick_actions/quick_actions_android/example/android/app/src/androidTest/java/io/flutter/plugins/quickactionsexample/QuickActionsTest.java b/packages/quick_actions/quick_actions_android/example/android/app/src/androidTest/java/io/flutter/plugins/quickactionsexample/QuickActionsTest.java index daa5c9aaa2ce..6eed13b30aaf 100644 --- a/packages/quick_actions/quick_actions_android/example/android/app/src/androidTest/java/io/flutter/plugins/quickactionsexample/QuickActionsTest.java +++ b/packages/quick_actions/quick_actions_android/example/android/app/src/androidTest/java/io/flutter/plugins/quickactionsexample/QuickActionsTest.java @@ -74,8 +74,7 @@ public void appShortcutsAreCreated() { assertEquals(expectedShortcuts.size(), dynamicShortcuts.size()); for (ShortcutInfo expectedShortcut : expectedShortcuts) { ShortcutInfo dynamicShortcut = - dynamicShortcuts - .stream() + dynamicShortcuts.stream() .filter(s -> s.getId().equals(expectedShortcut.getId())) .findFirst() .get(); @@ -94,8 +93,7 @@ public void appShortcutLaunchActivityAfterStarting() { (ShortcutManager) context.getSystemService(Context.SHORTCUT_SERVICE); List dynamicShortcuts = shortcutManager.getDynamicShortcuts(); ShortcutInfo dynamicShortcut = - dynamicShortcuts - .stream() + dynamicShortcuts.stream() .filter(s -> s.getId().equals(firstShortcut.getId())) .findFirst() .get(); diff --git a/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesPlugin.java b/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesPlugin.java index 4d4a2ce66c24..effdb5b319e7 100644 --- a/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesPlugin.java +++ b/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesPlugin.java @@ -32,9 +32,11 @@ public class LegacySharedPreferencesPlugin implements FlutterPlugin, SharedPreferencesApi { private static final String TAG = "SharedPreferencesPlugin"; private static final String SHARED_PREFERENCES_NAME = "FlutterSharedPreferences"; - // All identifiers must match the SharedPreferencesPlugin.kt file, as well as the strings.dart file. + // All identifiers must match the SharedPreferencesPlugin.kt file, as well as the strings.dart + // file. private static final String LIST_IDENTIFIER = "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBhIGxpc3Qu"; - // The symbol `!` was chosen as it cannot be created by the base 64 encoding used with LIST_IDENTIFIER. + // The symbol `!` was chosen as it cannot be created by the base 64 encoding used with + // LIST_IDENTIFIER. private static final String JSON_LIST_IDENTIFIER = LIST_IDENTIFIER + "!"; private static final String BIG_INTEGER_PREFIX = "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBCaWdJbnRlZ2Vy"; private static final String DOUBLE_PREFIX = "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBEb3VibGUu"; @@ -77,12 +79,14 @@ public void onDetachedFromEngine(@NonNull FlutterPlugin.FlutterPluginBinding bin @Override public @NonNull Boolean setString(@NonNull String key, @NonNull String value) { - // TODO (tarrinneal): Move this string prefix checking logic to dart code and make it an Argument Error. + // TODO (tarrinneal): Move this string prefix checking logic to dart code and make it an + // Argument Error. if (value.startsWith(LIST_IDENTIFIER) || value.startsWith(BIG_INTEGER_PREFIX) || value.startsWith(DOUBLE_PREFIX)) { throw new RuntimeException( - "StorageError: This string cannot be stored as it clashes with special identifier prefixes"); + "StorageError: This string cannot be stored as it clashes with special identifier" + + " prefixes"); } return preferences.edit().putString(key, value).commit(); } diff --git a/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/Messages.java b/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/Messages.java index 446776d7167e..4abdb0beaec2 100644 --- a/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/Messages.java +++ b/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/Messages.java @@ -82,21 +82,27 @@ public interface SharedPreferencesApi { /** Removes property from shared preferences data set. */ @NonNull Boolean remove(@NonNull String key); + /** Adds property to shared preferences data set of type bool. */ @NonNull Boolean setBool(@NonNull String key, @NonNull Boolean value); + /** Adds property to shared preferences data set of type String. */ @NonNull Boolean setString(@NonNull String key, @NonNull String value); + /** Adds property to shared preferences data set of type int. */ @NonNull Boolean setInt(@NonNull String key, @NonNull Long value); + /** Adds property to shared preferences data set of type double. */ @NonNull Boolean setDouble(@NonNull String key, @NonNull Double value); + /** Adds property to shared preferences data set of type List. */ @NonNull Boolean setEncodedStringList(@NonNull String key, @NonNull String value); + /** * Adds property to shared preferences data set of type List. * @@ -104,9 +110,11 @@ public interface SharedPreferencesApi { */ @NonNull Boolean setDeprecatedStringList(@NonNull String key, @NonNull List value); + /** Removes all properties from shared preferences data set with matching prefix. */ @NonNull Boolean clear(@NonNull String prefix, @Nullable List allowList); + /** Gets all properties from shared preferences data set with matching prefix. */ @NonNull Map getAll(@NonNull String prefix, @Nullable List allowList); @@ -115,6 +123,7 @@ public interface SharedPreferencesApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** * Sets up an instance of `SharedPreferencesApi` to handle messages through the * `binaryMessenger`. diff --git a/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesListEncoder.java b/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesListEncoder.java index 59cbb6db4187..f49cab3670b0 100644 --- a/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesListEncoder.java +++ b/packages/shared_preferences/shared_preferences_android/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesListEncoder.java @@ -15,6 +15,7 @@ public interface SharedPreferencesListEncoder { /** Converts list to String for storing in shared preferences. */ @NonNull String encode(@NonNull List list); + /** Converts stored String representing List to List. */ @NonNull List decode(@NonNull String listString); diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java index be9d4c58a664..718e795ee9ac 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java @@ -296,12 +296,14 @@ public interface UrlLauncherApi { /** Returns true if the URL can definitely be launched. */ @NonNull Boolean canLaunchUrl(@NonNull String url); + /** Opens the URL externally, returning true if successful. */ @NonNull Boolean launchUrl( @NonNull String url, @NonNull Map headers, @NonNull Boolean requireNonBrowser); + /** * Opens the URL in an in-app Custom Tab or WebView, returning true if it opens successfully. */ @@ -314,6 +316,7 @@ Boolean openUrlInApp( @NonNull Boolean supportsCustomTabs(); + /** Closes the view opened by [openUrlInSafariViewController]. */ void closeWebView(); @@ -321,6 +324,7 @@ Boolean openUrlInApp( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + /** Sets up an instance of `UrlLauncherApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLauncherApi api) { setUp(binaryMessenger, "", api); diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java index 5ead043540cf..5f1b1aa628e8 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java @@ -106,7 +106,8 @@ public void onCreate(@Nullable Bundle savedInstanceState) { // Open new urls inside the webview itself. webview.setWebViewClient(webViewClient); - // Multi windows is set with FlutterWebChromeClient by default to handle internal bug: b/159892679. + // Multi windows is set with FlutterWebChromeClient by default to handle internal bug: + // b/159892679. webview.getSettings().setSupportMultipleWindows(true); webview.setWebChromeClient(new FlutterWebChromeClient()); diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index 7cfb5c1c13be..ef661f7e1e97 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -55,8 +55,10 @@ public interface DisposeHandler { // TODO: Migrate to stable API, see https://github.com/flutter/flutter/issues/147039. @UnstableApi - // Error thrown for this-escape warning on JDK 21+ due to https://bugs.openjdk.org/browse/JDK-8015831. - // Keeping behavior as-is and addressing the warning could cause a regression: https://github.com/flutter/packages/pull/10193 + // Error thrown for this-escape warning on JDK 21+ due to + // https://bugs.openjdk.org/browse/JDK-8015831. + // Keeping behavior as-is and addressing the warning could cause a regression: + // https://github.com/flutter/packages/pull/10193 @SuppressWarnings("this-escape") public VideoPlayer( @NonNull VideoPlayerCallbacks events, diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/texture/TextureVideoPlayer.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/texture/TextureVideoPlayer.java index e482bdd85020..d623ddc88608 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/texture/TextureVideoPlayer.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/texture/TextureVideoPlayer.java @@ -30,6 +30,7 @@ public final class TextureVideoPlayer extends VideoPlayer implements SurfaceProducer.Callback { // True when the ExoPlayer instance has a null surface. private boolean needsSurface = true; + /** * Creates a texture video player. * @@ -89,7 +90,8 @@ protected ExoPlayerEventListener createExoPlayerEventListener( @NonNull ExoPlayer exoPlayer, @Nullable SurfaceProducer surfaceProducer) { if (surfaceProducer == null) { throw new IllegalArgumentException( - "surfaceProducer cannot be null to create an ExoPlayerEventListener for TextureVideoPlayer."); + "surfaceProducer cannot be null to create an ExoPlayerEventListener for" + + " TextureVideoPlayer."); } boolean surfaceProducerHandlesCropAndRotation = surfaceProducer.handlesCropAndRotation(); return new TextureExoPlayerEventListener( diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java index af80d4b26423..e3016db2845d 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewProxyApi.java @@ -58,7 +58,8 @@ public View getView() { @Override public void dispose() {} - // TODO(bparrishMines): This should be removed once https://github.com/flutter/engine/pull/40771 makes it to stable. + // TODO(bparrishMines): This should be removed once https://github.com/flutter/engine/pull/40771 + // makes it to stable. // Temporary fix for https://github.com/flutter/flutter/issues/92165. The FlutterView is setting // setImportantForAutofill(IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS) which prevents this // view from automatically being traversed for autofill. diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java index 3ca8ce924bb3..8ad8b29df915 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebViewTest.java @@ -309,7 +309,8 @@ public void defaultWebChromeClientIsSecureWebChromeClient() { webView.getWebChromeClient() instanceof WebChromeClientProxyApi.WebChromeClientImpl); } - // This test verifies that WebView.destroy() is called when the Dart instance is garbage collected. + // This test verifies that WebView.destroy() is called when the Dart instance is garbage + // collected. // This requires adding // // ``` From 54600bd016d983cdae2d449b8ea2022e57e64777 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 14 Apr 2026 16:51:34 -0400 Subject: [PATCH 3/4] Gemini fixup --- .../io/flutter/plugins/camera/Camera.java | 5 ++--- .../flutter/plugins/camera/CameraApiImpl.java | 12 +++++------ .../camerax/CameraControlProxyApi.java | 21 ++++++++----------- .../file_selector_android/FileUtils.java | 4 ++-- .../plugins/imagepicker/FileUtils.java | 3 +-- .../inapppurchase/InAppPurchasePlugin.java | 5 ++--- 6 files changed, 22 insertions(+), 28 deletions(-) diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java index d4cb02b1bd76..818151d754fe 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java @@ -277,9 +277,8 @@ private void prepareMediaRecorder(String outputFilePath) throws IOException { MediaRecorderBuilder mediaRecorderBuilder; - // TODO(camsim99): Revert changes that allow legacy code to be used when recordingProfile is - // null - // once this has largely been fixed on the Android side. + // TODO(camsim99): Revert changes that allow legacy code to be used when recordingProfile + // is null once this has largely been fixed on the Android side. // https://github.com/flutter/flutter/issues/119668 if (SdkCapabilityChecker.supportsEncoderProfiles() && getRecordingProfile() != null) { mediaRecorderBuilder = diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java index b4632e984165..b3b04d5309e5 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java @@ -89,9 +89,9 @@ private Long instantiateCamera(String cameraName, Messages.PlatformMediaSettings @SuppressWarnings("ConstantConditions") private void handleException(Exception exception, Messages.Result result) { // The code below exactly preserves the format of the native exceptions generated by pre-Pigeon - // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be - // client - // code that relies on specific string values here, so these should not be changed. See + // code. Since `camera` currently leaks the raw platform exceptions to clients, there may + // be client code that relies on specific string values here, so these should not be changed. + // See // https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#platform-exception-handling // for longer-term solutions to this. if (exception instanceof CameraAccessException) { @@ -103,9 +103,9 @@ private void handleException(Exception exception, Messages.Result result) private void handleException(Exception exception, Messages.VoidResult result) { // The code below exactly preserves the format of the native exceptions generated by pre-Pigeon - // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be - // client - // code that relies on specific string values here, so these should not be changed. See + // code. Since `camera` currently leaks the raw platform exceptions to clients, there may + // be client code that relies on specific string values here, so these should not be changed. + // See // https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#platform-exception-handling // for longer-term solutions to this. if (exception instanceof CameraAccessException) { diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java index 3a00f91bec8a..a037297b1b58 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlProxyApi.java @@ -74,10 +74,9 @@ public void onSuccess(Void voidResult) { @Override public void onFailure(@NonNull Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // Operation was canceled due to camera being closed or a new request was submitted, - // which - // is not actionable and should not block a new value from potentially being - // submitted. + // Operation was canceled due to camera being closed or a new request was + // submitted, which is not actionable and should not block a new value from + // potentially being submitted. ResultCompat.success(null, callback); return; } @@ -107,10 +106,9 @@ public void onSuccess(FocusMeteringResult focusMeteringResult) { @Override public void onFailure(@NonNull Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // Operation was canceled due to camera being closed or a new request was submitted, - // which - // is not actionable and should not block a new value from potentially being - // submitted. + // Operation was canceled due to camera being closed or a new request was + // submitted, which is not actionable and should not block a new value from + // potentially being submitted. ResultCompat.success(null, callback); return; } @@ -162,10 +160,9 @@ public void onSuccess(Integer integerResult) { @Override public void onFailure(@NonNull Throwable t) { if (t instanceof CameraControl.OperationCanceledException) { - // Operation was canceled due to camera being closed or a new request was submitted, - // which - // is not actionable and should not block a new value from potentially being - // submitted. + // Operation was canceled due to camera being closed or a new request was + // submitted, which is not actionable and should not block a new value from + // potentially being submitted. ResultCompat.success(null, callback); return; } diff --git a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java index ccfcb06cce92..9b5e7e77d707 100644 --- a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java +++ b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileUtils.java @@ -66,8 +66,8 @@ public static String getPathFromUri(@NonNull Context context, @NonNull Uri uri) String[] uriDocumentIdSplit = uriDocumentId.split(":"); if (uriDocumentIdSplit.length < 2) { - // We expect the URI document ID to contain its storage volume and name to determine its - // path. + // We expect the URI document ID to contain its storage volume and name to + // determine its path. throw new UnsupportedOperationException( "Retrieving the path of a document with an unknown storage volume or name is" + " unsupported by this plugin."); diff --git a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java index f97167c4eb6c..d83f6fe7ec23 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/FileUtils.java @@ -65,8 +65,7 @@ String getPathFromUri(final Context context, final Uri uri) { File targetDirectory = new File(context.getCacheDir(), uuid); targetDirectory.mkdir(); // TODO(SynSzakala) according to the docs, `deleteOnExit` does not work reliably on Android; - // we should preferably - // just clear the picked files after the app startup. + // we should preferably just clear the picked files after the app startup. targetDirectory.deleteOnExit(); String fileName = getImageName(context, uri); String extension = getImageExtension(context, uri); diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java index 17693a1081fd..ccb6bacdbb32 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java @@ -19,9 +19,8 @@ public class InAppPurchasePlugin implements FlutterPlugin, ActivityAware { static final String PROXY_PACKAGE_KEY = "PROXY_PACKAGE"; // The proxy value has to match the value in library's AndroidManifest.xml. // This is important that the is not changed, so we hard code the value here then having - // a unit test to make sure. If there is a strong reason to change the value, please - // inform the - // code owner of this package. + // a unit test to make sure. If there is a strong reason to change the value, + // please inform the code owner of this package. static final String PROXY_VALUE = "io.flutter.plugins.inapppurchase"; private MethodCallHandlerImpl methodCallHandler; From b36fac48fbcb364e0602e870a6aa97048a31f428 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 15 Apr 2026 07:40:35 -0400 Subject: [PATCH 4/4] Autoformat again --- .../io/flutter/plugins/camerax/ImageCaptureProxyApi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java index 5398dd148b05..78ba586b2314 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/ImageCaptureProxyApi.java @@ -157,11 +157,11 @@ String getImageCaptureExceptionDescription(int imageCaptureErrorCode) { return "Image capture failed due to the camera being closed."; case ImageCapture.ERROR_INVALID_CAMERA: return "The ImageCapture use case was bound to an invalid camera by the Flutter camera" - + " plugin. If you see this error, please file an issue if you cannot find one" - + " that already exists: https://github.com/flutter/flutter/issues/."; + + " plugin. If you see this error, please file an issue if you cannot find one" + + " that already exists: https://github.com/flutter/flutter/issues/."; default: return "An unknown error has occurred while attempting to take a picture. Check the logs" - + " for more details."; + + " for more details."; } } }