Skip to content

feat(android): expose local favorites through AppFunctions - #115

Open
AvianJay wants to merge 2 commits into
mainfrom
feat/android-appfunctions
Open

AvianJay wants to merge 2 commits into
mainfrom
feat/android-appfunctions

Conversation

@AvianJay

@AvianJay AvianJay commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Expose YABus local favorites to Android assistants through Jetpack AppFunctions: list groups, page through route/station/boarding favorites, and return immutable open actions for a favorite or group. The implementation reads the same local data as the home-screen widget, including unsynced changes, and preserves boarding direction and destination. It returns no account credentials and makes no changes to favorites.

Adds generated-service registration, assistant metadata, six Robolectric cases, and an APK schema verification script wired into CI. APPFUNCTIONS.md documents local versus cloud behavior, build requirements and Google's preview enrollment. Companion backend PR: YetAnotherBusDeveloper/busapiserver#6.

AppFunctions RC requires compile SDK 37 and AGP 9.1. This updates Gradle to 9.3.1 and Flutter CI to 3.44.0, upgrades google_mobile_ads to 9.2.0 for Gradle 9 compatibility, and explicitly configures Kotlin/JVM 17 for the pinned Firebase Analytics plugin when built-in Kotlin is disabled. The AGP host-test packaging task now depends on Flutter's asset producer. Android 16 tests run with JDK 21; app bytecode still targets 17 and the minimum Android version is unchanged. The compact anchored ad layout is retained.

Validation:

  • Debug APK assembled successfully.
  • APK inspection passed: all four generated AppFunctions and the platform XSD are packaged.
  • 6 Android AppFunctions Robolectric tests passed (0 failures/errors).
  • GitHub Verify passed on the implementation commit: flutter analyze, full flutter test suite, Node checks, and Chrome route-geometry tests. Linux and Web builds also passed on that run. CI is rerunning for the final Gradle host-test dependency fix.
  • git diff --check passed; changes are isolated in a worktree.
  • Local Android validation used one Gradle worker and a 2 GiB heap due to memory pressure; the final build and tests completed successfully.

Live Gemini execution still requires Android 16+ and Google's platform access. This PR implements and verifies the app integration; it does not imply preview acceptance or publish an app release.

@AvianJay
AvianJay marked this pull request as ready for review November 6, 2026 00:54

@Av1anJay Av1anJay left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code review

Non-blocking issue — YabusAppFunctions.kt:128: listFavorites rejects group names longer than 120 UTF-16 code units, but the existing favorite-group creation UI (favorite_groups_screen.dart:40-47) and addFavoriteGroup (app_controller.dart:3502-3512) impose no such limit. A valid existing local group can therefore be returned by listFavoriteGroups but cannot be queried by its exact name, contrary to the function contract; this also applies to emoji names that exceed the limit in UTF-16 units. Please remove the arbitrary limit or otherwise allow every persisted group name, and add a regression test using a group name over 120 units.

Checks: On this checkout, git diff --check and Python script compilation passed; web-worker Node tests passed (3/3), and Node-version tests passed (3/3) with Node 24.22.1. The host's default Node 22.23.1 is too old for the repository guard. Flutter/Android tooling is not installed locally; for this exact head SHA, GitHub CI passed Flutter analyze and tests, the Android AppFunctions Robolectric test task and packaged-schema verification, as well as the Android, Wear OS, Linux, Web, Windows, iOS and macOS builds. No Android 16+/Gemini device execution was performed.

Review submitted as COMMENT because the finding above is non-blocking. Correction: the authenticated reviewer is Av1anJay (GitHub user ID 99471364), while the PR author is AvianJay (GitHub user ID 48914361); these are different accounts, so the earlier self-review explanation was incorrect.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants