Skip to content

[quick_actions] Switch to Kotlin Pigeon#11507

Open
stuartmorgan-g wants to merge 2 commits intoflutter:mainfrom
stuartmorgan-g:kotlin-pigeon-quick-actions
Open

[quick_actions] Switch to Kotlin Pigeon#11507
stuartmorgan-g wants to merge 2 commits intoflutter:mainfrom
stuartmorgan-g:kotlin-pigeon-quick-actions

Conversation

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

Replaces the Java Pigeon generator with the Kotlin Pigeon generator, and adjusts the project accordingly:

  • Adds Kotlin build setings to Gradle.
  • Updates API signatures for Kotlin/Java differences.
  • Adds generic Java/Kotlin compat shim to create Result objects from Java, since those haven't been added to the Pigeon generator yet.

Part of flutter/flutter#158287

Pre-Review Checklist

Footnotes

  1. 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

@stuartmorgan-g stuartmorgan-g requested a review from jesswrd April 14, 2026 19:40
@stuartmorgan-g stuartmorgan-g added the triage-android Should be looked at in Android triage label Apr 14, 2026
@flutter-dashboard
Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

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. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator Author

test-exempt: code refactor with no semantic change

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a 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 migrates the quick_actions_android package to use Kotlin Pigeon for its internal implementation. The changes involve updating the build configuration to support Kotlin, replacing Java-generated Pigeon files with Kotlin versions, and refactoring the Android plugin implementation to align with the new API. Feedback points out an invalid Kotlin version in the build script and an unsafe unchecked cast in the utility code.

companion object {
@JvmStatic
fun <T> success(value: T, callback: Any) {
val castedCallback: (Result<T>) -> Unit = callback as (Result<T>) -> Unit
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This unchecked cast from Any to a functional type is unsafe and could lead to a ClassCastException at runtime. Furthermore, the success method (lines 24-27) appears to be unused in this pull request. Consider removing unused code to keep the shim minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: quick_actions platform-android triage-android Should be looked at in Android triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant