googlemaps / googlemaps/flutter-navigation-sdk
[Bug]: The Nav SDK's interactive traffic prompts aren't usable on the Auto screens
- Dominant language
- Dart
- Stars
- 75
- Forks
- 54
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 5
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Description of the bug
The Navigation SDK renders its own **interactive** prompts on the car map surface during guidance — traffic-incident confirmation cards (*“Construction nearby … Still there / Not there”*) and traffic/reroute prompts (*“Slower than usual traffic … Dismiss”*), enabled via `GoogleMapsAutoViewController.setTrafficIncidentCardsEnabled(true)` / `setTrafficPromptsEnabled(true)`.
On **Android Auto** these cards render but **their buttons are completely non-interactive** — tapping does nothing. The root cause is that `AndroidAutoBaseScreen` (the screen’s `SurfaceCallback`) implements only pan/zoom and never `onClick`, so taps are never delivered to the `NavigationView` that drew the buttons.
We are also raising the **CarPlay** side as a parallel question, since this is one cross-platform SDK: the CarPlay path is architecturally different (and we haven’t verified it yet), so we’d like the maintainers to confirm whether interactive prompts are tappable on CarPlay or are intentionally display-only. Details in the CarPlay section.
### Flutter version
3.44.1
### Package version
0.9.4
### Native SDK versions
- [x] I haven't changed the version of the native SDKs
### Flutter Doctor Output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.44.1, on macOS 26.5 25F71 darwin-arm64, locale en-BG)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 26.5)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
### Steps to reproduce
1. Subclass `AndroidAutoBaseScreen` for the Android Auto screen (as the example shows).
2. Start guidance and enable the prompts on the auto view:
```dart
await autoViewController.setTrafficPromptsEnabled(true);
await autoViewController.setTrafficIncidentCardsEnabled(true);
```
3. Drive/simulate until the SDK shows an interactive prompt (incident card, or a prompt with *Dismiss*).
4. Tap any button on the head unit (DHU or real car).
### Expected vs Actual Behavior
#### Expected
Tapping triggers the SDK’s built-in action (submit incident confirmation / dismiss), as on the phone `GoogleMapsNavigationView`.
#### Actual
Nothing happens. The buttons are inert; the prompt only disappears on its own timeout.
### Code Sample
#### Root cause
`AndroidAutoBaseScreen` implements `androidx.car.app.SurfaceCallback` but overrides **only** `onScroll` and `onScale`; it does **not** override `SurfaceCallback.onClick(float x, float y)` (or `onFling`).
`android/src/main/kotlin/com/google/maps/flutter/navigation/AndroidAutoBaseScreen.kt`:
```kotlin
override fun onScroll(distanceX: Float, distanceY: Float) {
mGoogleMap?.moveCamera(CameraUpdateFactory.scrollBy(distanceX, distanceY))
}
override fun onScale(focusX: Float, focusY: Float, scaleFactor: Float) {
val update = CameraUpdateFactory.zoomBy((scaleFactor - 1), Point(focusX.toInt(), focusY.toInt()))
mGoogleMap?.animateCamera(update)
}
// no onClick(...) — taps are never handled
```
The `NavigationView` is hosted on a `Presentation` over a `VirtualDisplay`, so it does not receive the car’s touch directly — the **only** path for taps is `SurfaceCallback.onClick`, which the plugin must translate and dispatch into the view. Pan/zoom are bridged; taps are not, so the SDK’s own interactive prompt UI is unreachable.
### Additional Context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.