Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.4.11

* Fixes Java warnings.

## 2.4.10

* Bump RoboElectric dependency to 4.4.1 to support AndroidX.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ android {
checkAllWarnings true
warningsAsErrors true
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency'
baseline file("lint-baseline.xml")
}

dependencies {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class GoogleMapController
private final int id;
private final MethodChannel methodChannel;
private final GoogleMapOptions options;
@Nullable private MapView mapView;
@Nullable MapView mapView;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this and the other private changes in this file can you use a smaller scope than public? Specifically I think for all of these synthetic method calls you can use protected instead.
See https://stackoverflow.com/questions/4501324/synthetic-accessor-method-warning for more information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I restored the private scope modification in the GoogleMapController.java file, and after replacing the anonymous class GoogleMap.OnMapLoadedCallback() with a lambda expression, I confirmed that the synthetic-accessor warning no longer occurs. 4cbbc06

@Nullable private GoogleMap googleMap;
private boolean trackCameraPosition = false;
private boolean myLocationEnabled = false;
Expand Down Expand Up @@ -135,7 +135,7 @@ private CameraPosition getCameraPosition() {
return trackCameraPosition ? googleMap.getCameraPosition() : null;
}

private boolean loadedCallbackPending = false;
boolean loadedCallbackPending = false;

/**
* Invalidates the map view after the map has finished rendering.
Expand Down Expand Up @@ -176,7 +176,7 @@ public void onMapLoaded() {
});
}

private static void postFrameCallback(Runnable f) {
public static void postFrameCallback(Runnable f) {
Choreographer.getInstance()
.postFrameCallback(
new Choreographer.FrameCallback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String, Object> params = (Map<String, Object>) args;
final GoogleMapBuilder builder = new GoogleMapBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -70,7 +70,7 @@ public GoogleMapsPlugin() {}
// FlutterPlugin

@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
binding
.getPlatformViewRegistry()
.registerViewFactory(
Expand All @@ -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);
}

Expand All @@ -103,7 +103,7 @@ public void onDetachedFromActivity() {
}

@Override
public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) {
public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) {
onAttachedToActivity(binding);
}

Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
final String tileOverlayId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make these SyntheticAccessor violations protected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply to protected scope 496560e

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make these SyntheticAccessor violations protected?

@reidbaker Out of curiosity, why protected? protected is actually slightly more visible than the default Java access (package private).

final MethodChannel methodChannel;
final Handler handler = new Handler(Looper.getMainLooper());

TileProviderController(MethodChannel methodChannel, String tileOverlayId) {
this.tileOverlayId = tileOverlayId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.10
version: 2.4.11

environment:
sdk: ">=2.17.0 <4.0.0"
Expand Down