diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index 5284648c8e73..0e91f2df16a4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.12 + +* Fixes Java warnings. + ## 2.4.11 * Adds a namespace for compatibility with AGP 8.0. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle index 5f8c17e81a90..35ba28401859 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle @@ -33,7 +33,6 @@ android { checkAllWarnings true warningsAsErrors true disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency' - baseline file("lint-baseline.xml") } dependencies { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/lint-baseline.xml b/packages/google_maps_flutter/google_maps_flutter_android/android/lint-baseline.xml deleted file mode 100644 index 092b2d57e775..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/lint-baseline.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java index a57cd1a34c97..84d9fa782305 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java @@ -159,20 +159,17 @@ private void invalidateMapIfNeeded() { } loadedCallbackPending = true; googleMap.setOnMapLoadedCallback( - new GoogleMap.OnMapLoadedCallback() { - @Override - public void onMapLoaded() { - loadedCallbackPending = false; - postFrameCallback( - () -> { - postFrameCallback( - () -> { - if (mapView != null) { - mapView.invalidate(); - } - }); - }); - } + () -> { + loadedCallbackPending = false; + postFrameCallback( + () -> { + postFrameCallback( + () -> { + if (mapView != null) { + mapView.invalidate(); + } + }); + }); }); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapFactory.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapFactory.java index ffa2412f9c42..f7bf1f9d7acb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapFactory.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapFactory.java @@ -5,6 +5,8 @@ package io.flutter.plugins.googlemaps; import android.content.Context; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.google.android.gms.maps.model.CameraPosition; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.StandardMessageCodec; @@ -30,7 +32,8 @@ public class GoogleMapFactory extends PlatformViewFactory { @SuppressWarnings("unchecked") @Override - public PlatformView create(Context context, int id, Object args) { + @NonNull + public PlatformView create(@NonNull Context context, int id, @Nullable Object args) { Map params = (Map) args; final GoogleMapBuilder builder = new GoogleMapBuilder(); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapsPlugin.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapsPlugin.java index 20fc15e72b6e..5d0a5ebdda85 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapsPlugin.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapsPlugin.java @@ -26,13 +26,13 @@ */ public class GoogleMapsPlugin implements FlutterPlugin, ActivityAware { - @Nullable private Lifecycle lifecycle; + @Nullable Lifecycle lifecycle; private static final String VIEW_TYPE = "plugins.flutter.dev/google_maps_android"; @SuppressWarnings("deprecation") public static void registerWith( - final io.flutter.plugin.common.PluginRegistry.Registrar registrar) { + @NonNull final io.flutter.plugin.common.PluginRegistry.Registrar registrar) { final Activity activity = registrar.activity(); if (activity == null) { // When a background flutter view tries to register the plugin, the registrar has no activity. @@ -70,7 +70,7 @@ public GoogleMapsPlugin() {} // FlutterPlugin @Override - public void onAttachedToEngine(FlutterPluginBinding binding) { + public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { binding .getPlatformViewRegistry() .registerViewFactory( @@ -88,12 +88,12 @@ public Lifecycle getLifecycle() { } @Override - public void onDetachedFromEngine(FlutterPluginBinding binding) {} + public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {} // ActivityAware @Override - public void onAttachedToActivity(ActivityPluginBinding binding) { + public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(binding); } @@ -103,7 +103,7 @@ public void onDetachedFromActivity() { } @Override - public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { + public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { onAttachedToActivity(binding); } @@ -124,7 +124,7 @@ private static final class ProxyLifecycleProvider private final LifecycleRegistry lifecycle = new LifecycleRegistry(this); private final int registrarActivityHashCode; - private ProxyLifecycleProvider(Activity activity) { + ProxyLifecycleProvider(Activity activity) { this.registrarActivityHashCode = activity.hashCode(); activity.getApplication().registerActivityLifecycleCallbacks(this); } 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 73530d1b5158..d1e89c3b94cd 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 @@ -18,9 +18,9 @@ class TileProviderController implements TileProvider { private static final String TAG = "TileProviderController"; - private final String tileOverlayId; - private final MethodChannel methodChannel; - private final Handler handler = new Handler(Looper.getMainLooper()); + protected final String tileOverlayId; + protected final MethodChannel methodChannel; + protected final Handler handler = new Handler(Looper.getMainLooper()); TileProviderController(MethodChannel methodChannel, String tileOverlayId) { this.tileOverlayId = tileOverlayId; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 4b9315bae22c..03914708dcfd 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.4.11 +version: 2.4.12 environment: sdk: ">=2.17.0 <4.0.0"