Skip to content

[Bug]: Android Auto - Unexpected close (X) button in ETA #715

Description

@bderrien

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Image

With the latest version, I have a “close” (X) button in the ETA panel.

However, clicking it doesn’t do anything.
Do you know if it’s possible to remove this button, or to attach a callback to it?

I couldn’t find any information about it in the Android documentation.

Flutter version

3.38.5

Package version

0.9.3

Native SDK versions

  • I haven't changed the version of the native SDKs

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.38.5, on macOS 26.5 25F71 darwin-arm64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.4)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
[✓] Network resources

Steps to reproduce

apply this patch :

diff --git forkSrcPrefix/example/android/app/src/main/kotlin/com/google/maps/flutter/navigation_example/SampleAndroidAutoScreen.kt forkDstPrefix/example/android/app/src/main/kotlin/com/google/maps/flutter/navigation_example/SampleAndroidAutoScreen.kt
index 20c1520bcae9cd91cfd229a1e2324a133ae86c56..8817fe4b96fad29f439cd344e2202bc4f506c7a5 100644
--- forkSrcPrefix/example/android/app/src/main/kotlin/com/google/maps/flutter/navigation_example/SampleAndroidAutoScreen.kt
+++ forkDstPrefix/example/android/app/src/main/kotlin/com/google/maps/flutter/navigation_example/SampleAndroidAutoScreen.kt
@@ -22,12 +22,14 @@ import androidx.car.app.CarContext
 import androidx.car.app.model.Action
 import androidx.car.app.model.ActionStrip
 import androidx.car.app.model.CarIcon
+import androidx.car.app.model.DateTimeWithZone
 import androidx.car.app.model.Distance
 import androidx.car.app.model.Template
 import androidx.car.app.navigation.model.Maneuver
 import androidx.car.app.navigation.model.NavigationTemplate
 import androidx.car.app.navigation.model.RoutingInfo
 import androidx.car.app.navigation.model.Step
+import androidx.car.app.navigation.model.TravelEstimate
 import androidx.core.graphics.drawable.IconCompat
 import com.google.android.gms.maps.GoogleMap
 import com.google.android.libraries.mapsplatform.turnbyturn.model.NavInfo
@@ -35,6 +37,7 @@ import com.google.android.libraries.mapsplatform.turnbyturn.model.StepInfo
 import com.google.maps.flutter.navigation.AndroidAutoBaseScreen
 import com.google.maps.flutter.navigation.AutoMapViewOptions
 import com.google.maps.flutter.navigation.GoogleMapsNavigationNavUpdatesService
+import java.util.TimeZone
 
 
 class SampleAndroidAutoScreen(carContext: CarContext): AndroidAutoBaseScreen(carContext) {
@@ -170,6 +173,14 @@ class SampleAndroidAutoScreen(carContext: CarContext): AndroidAutoBaseScreen(car
             navigationTemplateBuilder.setNavigationInfo(mNavInfo!!)
         }
 
+        navigationTemplateBuilder.setDestinationTravelEstimate(TravelEstimate.Builder(
+            Distance.create(
+                10.0,
+                Distance.UNIT_KILOMETERS
+            ),
+            DateTimeWithZone.create(System.currentTimeMillis(), TimeZone.getDefault())
+        ).build())
+
         return navigationTemplateBuilder.build()
     }
 }
\ No newline at end of file

then start a turn-by-turn NavInfo

Expected vs Actual Behavior

Actual behavior

  • A close (X) button is displayed.

Expected behavior

  • The close (X) button should not be displayed.
    or
  • It should be possible to handle clicks on the close (X) button.

Code Sample

/

Additional Context

No response

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions