-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[google_maps_flutter_android] Fix Android lint warnings #3751
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_android] Fix Android lint warnings #3751
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Thank you for your contribution. It looks like the tests are failing. Before we review the PR, please see what you can do to resolve the test failures. If you are unsure how to proceed, please reach out for help on the #hackers-new channel. @gmackall the tests are failing on the duplicate class issue I think you have seen before but I dont see any updated dependencies that would introduce that class of error. |
@reidbaker Thank you, I fixed the part that was causing the problem and it passed all the tests, could you please check it again? |
@@ -60,7 +60,7 @@ | |||
private final int id; | |||
private final MethodChannel methodChannel; | |||
private final GoogleMapOptions options; | |||
@Nullable private MapView mapView; | |||
@Nullable MapView mapView; |
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.
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.
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.
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
private final String tileOverlayId; | ||
private final MethodChannel methodChannel; | ||
private final Handler handler = new Handler(Looper.getMainLooper()); | ||
final String tileOverlayId; |
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.
Can you make these SyntheticAccessor violations protected?
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.
Apply to protected scope 496560e
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.
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).
2 small changes but this looks good. Once those are fixed I am ready to approve. Thank you for helping make flutter better :) |
Sorry, missed this ping last week. Is the failure you are referring to the one with the message
That ran here? Asking because that's the most similar message I see but not sure if there was an identical one that failed, but the logs have since expired. If so, I don't think that message is caused by this change, it's actually still there on the latest successful test run if you scroll down to the "run lint" instruction. |
anonymous class `GoogleMap.OnMapLoadedCallback()` replace lambda expression. and resotred private scope
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 LGTM as well. Thanks for the contributions (here and in local auth)!
Roll Packages from 7e3f5da to de6131d (41 revisions) flutter/packages@7e3f5da...de6131d 2023-05-01 [email protected] I122213 update non examples (flutter/packages#3846) 2023-04-29 [email protected] [go_router] Cleans up route match API and introduces dart fix (flutter/packages#3819) 2023-04-29 [email protected] [camerax] Add `LifecycleOwner` Proxy (flutter/packages#3837) 2023-04-29 [email protected] [file_selector] Add getDirectoryPaths implementation for Windows (flutter/packages#3704) 2023-04-29 [email protected] [various] Update Android example min SDKs (flutter/packages#3847) 2023-04-28 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.2.12 to 2.3.2 (flutter/packages#3838) 2023-04-28 [email protected] [camerax] Implement Image Streaming (flutter/packages#3454) 2023-04-28 [email protected] [various] update agp and gradle for all examples in packages (flutter/packages#3822) 2023-04-28 [email protected] Update xcode to 14c18 (flutter/packages#3774) 2023-04-28 [email protected] [camera_android] Add NV21 as an image stream format #3277 (flutter/packages#3639) 2023-04-28 [email protected] [go_router] Remove unused navigator keys (flutter/packages#3708) 2023-04-28 [email protected] [image_picker] Move I/O operations to a separate thread (flutter/packages#3506) 2023-04-28 49699333+dependabot[bot]@users.noreply.github.com [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.8.20 to 1.8.21 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#3824) 2023-04-28 [email protected] [pigeon] Reland: Add an initial example app (flutter/packages#3832) 2023-04-28 [email protected] Roll Flutter from c9004ff to 66fa4c5 (68 revisions) (flutter/packages#3830) 2023-04-28 [email protected] [various] Conditionalize the namespace in all Android plugins (flutter/packages#3836) 2023-04-27 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 5.1.0 to 5.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#3672) 2023-04-27 [email protected] [auick_action_ios] Retries multiple times to not fail ci when there is a flake (flutter/packages#3823) 2023-04-26 [email protected] Swap some iOS package CODEOWNERS (flutter/packages#3793) 2023-04-26 [email protected] [various] Add `targetCompatibility` to build.gradle (flutter/packages#3825) 2023-04-26 [email protected] [various] Set cmake_policy versions (flutter/packages#3828) 2023-04-26 [email protected] [path_provider] Allow `win32` up to version 4.x (flutter/packages#3820) 2023-04-26 [email protected] [tool] Move Android lint checks (flutter/packages#3816) 2023-04-25 [email protected] [google_maps_flutter_android] Fix Android lint warnings (flutter/packages#3751) 2023-04-25 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump androidx.annotation:annotation from 1.5.0 to 1.6.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#3381) 2023-04-25 [email protected] Update test golden images for the latest Skia roll (flutter/packages#3787) 2023-04-25 [email protected] [various] Adds Android namespace (flutter/packages#3791) 2023-04-25 [email protected] [shared_preferences] Update gradle/agp in example apps (flutter/packages#3809) 2023-04-24 [email protected] [go_router] Adds name to TypedGoRoute (flutter/packages#3702) 2023-04-22 [email protected] [webview_flutter] Adds support to receive permission requests (flutter/packages#3543) 2023-04-21 [email protected] [google_sign_in] Fix Android Java warnings (flutter/packages#3762) 2023-04-21 [email protected] [local_auth] Fix enum return on Android (flutter/packages#3780) 2023-04-21 [email protected] [pigeon] Warn when trying to use enums in collections (flutter/packages#3782) 2023-04-21 [email protected] [webview_flutter_android] [webview_flutter_wkwebview] Platform implementations for supporting permission requests (flutter/packages#3792) 2023-04-21 [email protected] [pigeon] Update for compatibility with a future change to the analyzer. (flutter/packages#3789) 2023-04-21 [email protected] [camera_android] Fix Android lint warnings (flutter/packages#3716) 2023-04-21 [email protected] [webview_flutter_platform_interface] Adds method to receive permission requests (flutter/packages#3767) 2023-04-21 [email protected] [image_picker_ios] In unit test write and read kCGImagePropertyExifUserComment property (flutter/packages#3783) 2023-04-21 [email protected] [go_router_builder] Fixed the return value of the generated push method (flutter/packages#3650) 2023-04-21 [email protected] [image_picker] Mention `launchMode: singleInstance` in README (flutter/packages#3759) 2023-04-21 [email protected] Revert "[pigeon] Add an initial example app" (flutter/packages#3785) 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 ...
Fixed the Android lint warning shown in `lint-baseline.xml` and removed the baseline. Part of flutter/flutter#88011
Fixed the Android lint warning shown in
lint-baseline.xml
and removed the baseline.Part of flutter/flutter#88011
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.///
).