-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[google_maps_flutter] Moves Java->Dart calls to Pigeon #7040
[google_maps_flutter] Moves Java->Dart calls to Pigeon #7040
Conversation
|
||
@Override | ||
public void error(@NonNull Throwable error) {} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are because we don't currently have a way in Pigeon to ignore responses. Longer term I think we'll want to convert this over to event channels though; I'm not sure why maps wasn't written using them in the first place, since a stream of one-way calls without responses are the use cases event channels were written for IIUC.
(I'm not doing that conversion as part of this because we don't have event channel support for Pigeon yet; probably in Q3 sometime.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt know event channels existed so maybe the author didnt either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I think of it, I'm not sure when event channels were added, so this code may just predate them.
return data; | ||
} | ||
|
||
static Map<String, Object> tileOverlayArgumentsToJson( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change this to stay here and do a Pigeon build if you prefer, but since we have to pass all the arguments individually anyway (vs passing a single object to convert) it seemed easier to just inline it.
@@ -464,36 439,6 @@ static LatLng latLngFromPigeon(Messages.PlatformLatLng latLng) { | |||
return new LatLng(latLng.getLatitude(), latLng.getLongitude()); | |||
} | |||
|
|||
static Object clusterToJson(String clusterManagerId, Cluster<MarkerBuilder> cluster) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pure removal because the Pigeon version (just below) was added in a previous PR.
@@ -182,10 190,6 @@ void init() { | |||
mapView.getMapAsync(this); | |||
} | |||
|
|||
private CameraPosition getCameraPosition() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunistic cleanup; the IDE flagged that this was unused.
@@ -66,37 65,43 @@ Tile getTile() { | |||
return TileProvider.NO_TILE; | |||
} | |||
try { | |||
return Convert.interpretTile(result); | |||
if (result == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunistic safety fix; the IDE was flagging that we weren't handling null result
here.
expect((await markerDragEndStream.next).value.value, equals(dragEndId)); | ||
}); | ||
|
||
test('markers send tap events to correct stream', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Longer because I added a bunch of missing test coverage.
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/CirclesController.java
Show resolved
Hide resolved
|
||
@Override | ||
public void error(@NonNull Throwable error) {} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt know event channels existed so maybe the author didnt either.
public void success() {} | ||
|
||
@Override | ||
public void error(@NonNull Throwable error) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggle with our guidance to only log actionable errors. My gut is always to log because otherwise you are left guessing if you hit an error condition.
No action needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason I didn't add it in this PR is that I know we have a class of issues around lifetime mismatch between native and Dart in Google Maps, and I worry that just adding logging here without deeply investigating those first would cause a bunch of spam where the call fails only because the instance has been eliminated on the Dart side, in which case silently dropping them is better than logging.
...flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolylinesController.java
Outdated
Show resolved
Hide resolved
} | ||
@SuppressWarnings("unchecked") | ||
final Map<String, ?> tileJson = (Map<String, ?>) result.getJson(); | ||
return Convert.interpretTile(tileJson); | ||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr is not the right place but I think we should prefer a more tightly caught exception since this reads like it is catching json exceptions.
flutter/packages@97bad7e...14341d1 2024-07-08 49699333 dependabot[bot]@users.noreply.github.com [sign_in]: Bump com.android.tools.build:gradle from 7.2.1 to 8.5.0 in /packages/google_sign_in/google_sign_in_android/android (flutter/packages#7070) 2024-07-08 49699333 dependabot[bot]@users.noreply.github.com [path_provider]: Bump com.android.tools.build:gradle from 7.3.1 to 8.5.0 in /packages/path_provider/path_provider_android/android (flutter/packages#7068) 2024-07-07 [email protected] Roll Flutter from af913a7 to fafd67d (41 revisions) (flutter/packages#7062) 2024-07-06 [email protected] [rfw] Update goldens. (flutter/packages#6941) 2024-07-06 [email protected] [google_maps_flutter] Moves Java->Dart calls to Pigeon (flutter/packages#7040) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
…r#151417) flutter/packages@97bad7e...14341d1 2024-07-08 49699333 dependabot[bot]@users.noreply.github.com [sign_in]: Bump com.android.tools.build:gradle from 7.2.1 to 8.5.0 in /packages/google_sign_in/google_sign_in_android/android (flutter/packages#7070) 2024-07-08 49699333 dependabot[bot]@users.noreply.github.com [path_provider]: Bump com.android.tools.build:gradle from 7.3.1 to 8.5.0 in /packages/path_provider/path_provider_android/android (flutter/packages#7068) 2024-07-07 [email protected] Roll Flutter from af913a7 to fafd67d (41 revisions) (flutter/packages#7062) 2024-07-06 [email protected] [rfw] Update goldens. (flutter/packages#6941) 2024-07-06 [email protected] [google_maps_flutter] Moves Java->Dart calls to Pigeon (flutter/packages#7040) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
Converts all of the Obj-C->Dart calls from raw method channels to Pigeon. This finishes conversion of all of the invocations in `google_maps_flutter_ios` This is the iOS equivalent of #7040, and much of the Dart code is based on that PR. Part of flutter/flutter#117907
Converts all of the Java->Dart calls from raw method channels to Pigeon. This finishes conversion of all of the invocations in
google_maps_flutter_android
Part of flutter/flutter#117907
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).