-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[google_sign_in] Implement disconnect for Android
#9991
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_sign_in] Implement disconnect for Android
#9991
Conversation
Adds the missing implementation of `disconnect` using the new `revokeAccess` API, updating `play-services-auth` to the version containing the new API. Fixes flutter/flutter#169612
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.
Code Review
This pull request implements the disconnect functionality for Android by leveraging the new revokeAccess API. The changes include updating the native dependency, adding the new API via Pigeon, and implementing the logic on both the Dart and native sides, complete with corresponding tests. The implementation is solid, but I've identified a potential crash due to unsafe access on a list and a minor typo in an error message. Addressing these points will improve the robustness and clarity of the code.
packages/google_sign_in/google_sign_in_android/lib/google_sign_in_android.dart
Show resolved
Hide resolved
...ign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java
Outdated
Show resolved
Hide resolved
This comment was marked as off-topic.
This comment was marked as off-topic.
| .create(context) | ||
| .revokeAccess( | ||
| RevokeAccessRequest.builder() | ||
| .setAccount(new Account(params.getAccountEmail(), "com.google")) |
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.
nit: Let's move this into a constant
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.
Good call, especially since it's used in two places. Done.
|
autosubmit label was removed for flutter/packages/9991, because - The status or check suite Linux_android android_platform_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/9991, because - The status or check suite Linux_android android_platform_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@3413b65...117bf63 2025-09-24 magder@google.com [ci] Add update-release-info command suggestion when version check fails (flutter/packages#9834) 2025-09-24 engine-flutter-autoroll@skia.org Manual roll Flutter from 9ff2767 to 4a04204 (28 revisions) (flutter/packages#10067) 2025-09-24 stuartmorgan@google.com Remove "All right reserved" from all files (flutter/packages#10066) 2025-09-24 stuartmorgan@google.com [google_sign_in] Implement `disconnect` for Android (flutter/packages#9991) 2025-09-24 43054281+camsim99@users.noreply.github.com [camera_android] Remove references to third party `googlesamples/mlkit` code (flutter/packages#10056) 2025-09-23 52160996+FMorschel@users.noreply.github.com [go_router_builder] [in_app_purchase_storekit] Removes redundant arguments from annotations (flutter/packages#9964) 2025-09-23 121233810+nozomemein@users.noreply.github.com [go_router] Fix Android Cold Start deep link with empty path losing scheme and authority. (flutter/packages#9868) 2025-09-23 NearTox@outlook.com [go_router_builder] Proposal: add json support, custom string encoder/decoder (flutter/packages#8665) 2025-09-23 lukas.mirbt@appshack.se [go_router] Fix ShellRoutes break iOS swipe back navigation (flutter/packages#9968) 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 flutter-ecosystem@google.com 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#175935) flutter/packages@3413b65...117bf63 2025-09-24 magder@google.com [ci] Add update-release-info command suggestion when version check fails (flutter/packages#9834) 2025-09-24 engine-flutter-autoroll@skia.org Manual roll Flutter from 9ff2767 to 4a04204 (28 revisions) (flutter/packages#10067) 2025-09-24 stuartmorgan@google.com Remove "All right reserved" from all files (flutter/packages#10066) 2025-09-24 stuartmorgan@google.com [google_sign_in] Implement `disconnect` for Android (flutter/packages#9991) 2025-09-24 43054281+camsim99@users.noreply.github.com [camera_android] Remove references to third party `googlesamples/mlkit` code (flutter/packages#10056) 2025-09-23 52160996+FMorschel@users.noreply.github.com [go_router_builder] [in_app_purchase_storekit] Removes redundant arguments from annotations (flutter/packages#9964) 2025-09-23 121233810+nozomemein@users.noreply.github.com [go_router] Fix Android Cold Start deep link with empty path losing scheme and authority. (flutter/packages#9868) 2025-09-23 NearTox@outlook.com [go_router_builder] Proposal: add json support, custom string encoder/decoder (flutter/packages#8665) 2025-09-23 lukas.mirbt@appshack.se [go_router] Fix ShellRoutes break iOS swipe back navigation (flutter/packages#9968) 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 flutter-ecosystem@google.com 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
Adds the missing implementation of
disconnectusing the newrevokeAccessAPI, updatingplay-services-authto the version containing the new API.Fixes flutter/flutter#169612
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3