Skip to content

fix(car): notification-only car messaging for production; park templated behind flag#6015

Merged
jamesarich merged 2 commits into
mainfrom
claude/car-auto-review-crash
Jun 29, 2026
Merged

fix(car): notification-only car messaging for production; park templated behind flag#6015
jamesarich merged 2 commits into
mainfrom
claude/car-auto-review-crash

Conversation

@jamesarich

@jamesarich jamesarich commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Why

Google rejected v2.8.0-closed.2 (versionCode 29321269) — "App crashes / the content of your application is not able to load" under the Auto App Quality Guidelines.

Root cause: the car app is a "templated messaging experience" (CarAppService MESSAGING + MessagingStyle notifications + <uses name="template" />). Per Google's docs, templated messaging is beta — publishable to Internal/Closed tracks only; Open/Production submissions are auto-rejected regardless of correctness. The crash is in the templated surface (launched by tapping a message notification → renders HomeScreen). The #5997 TabTemplate fix was already in the rejected build — it crashed anyway, and adding the com.google.android.gms.car.application meta-data there is what first exposed the templated app to review.

Reproduction is blocked locally: the DHU (2.1) can't launch sideloaded apps (CAR.VALIDATOR: Package DENIED; failed all other checks for every non-Google app, even with unknown-sources on), and Auto-host crashes don't reach Crashlytics/Datadog. R8 code-strip and resource-shrink were ruled out (all car code/resources survive the minified release build).

So this design can never reach Production. This PR makes the default build notification-only (GA, production-safe) and parks the templated experience behind a flag for Closed-track builds.

🌟 Production: notification-only car messaging

  • Default googleRelease ships notification-only: CarAppService is android:enabled=false and automotive_app_desc declares only <uses name="notification" />. It is therefore not a templated Auto app and is not subject to the Auto templated review.
  • Hands-free reply / mark-as-read keep working — that notification code lives in core:service, which is in every build.

🛠️ Templated dashboard parked behind -PenableCarTemplates

./gradlew :androidApp:bundleGoogleRelease                            # Production (notification-only)
./gradlew :androidApp:bundleGoogleRelease -PenableCarTemplates=true  # Closed track (+ templated)
  • The flag adds androidApp/src/googleCarTemplates/res, whose automotive_app_desc override declares <uses name="template" />, and enables the service.
  • feature:car stays compiled (FlavorModule references FeatureCarModule). It resolves the enabled placeholder from the same property, because a library's own manifest placeholder is not overridden by the app's value.

🐛 Crash hardening

  • HomeScreen.onGetTemplate() now degrades to a safe template instead of throwing out to the Android Auto host (which crashes it = Play rejection). NOTE: a host-side template-contract rejection wouldn't throw here — the suspected TabTemplate-vs-ListTemplate/SectionedItemTemplate-of-ConversationItem contract issue still needs the Play Console pre-launch stack to confirm. Templated is parked until then.

Testing Performed

  • aapt-verified the packaged manifest + automotive_app_desc: flag-off → service enabled=false + notification-only; flag-on → service enabled=true + <uses template>.
  • spotlessCheck, detekt, assembleDebug (google + fdroid), :feature:car:test (CarScreensTest: disconnected→PaneTemplate and connected→TabTemplate both pass).

Follow-ups (not in this PR)

  • Root-cause the templated crash from the Play pre-launch report; likely make the messaging surface a ListTemplate/SectionedItemTemplate of ConversationItems rather than a TabTemplate dashboard.
  • The nodes/status dashboard is a better fit for a future generally-available IOT/POI templated app (separate investigation).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for an optional templated Android Auto experience in specific builds.
    • Improved build-time controls so the car experience can switch between notification-only and templated modes.
  • Bug Fixes

    • Prevented Android Auto template errors from crashing the host by falling back safely when template generation fails.
    • Kept the car experience disabled by default for production builds.

…mplated behind flag

Google rejected v2.8.0-closed.2 (App crashes / "content not able to load") under the Auto
App Quality Guidelines. The car app is a "templated messaging experience" — a Google beta
restricted to Internal/Closed tracks; Open/Production submissions are auto-rejected regardless
of correctness. The crashing surface is the templated CarAppService/HomeScreen, which the DHU
can't launch (sideloaded apps are denied by CAR.VALIDATOR) and which doesn't report to
Crashlytics/Datadog. The #5997 TabTemplate fix was already in the rejected build; it crashed anyway.

Default (production) builds now ship notification-only car messaging, which is GA and
production-safe:
- CarAppService is android:enabled=false and automotive_app_desc declares only <uses notification>.
- Hands-free reply / mark-as-read still works — that code lives in core:service (every build).
- Result: not a templated Auto app, so it is not subject to the Auto templated review.

The templated dashboard is parked behind -PenableCarTemplates=true for Closed-track builds:
- Adds androidApp/src/googleCarTemplates/res (automotive_app_desc + <uses template>) and enables
  the service.
- feature:car stays compiled (FlavorModule references FeatureCarModule); feature:car resolves the
  enabled placeholder from the same property, since a library's own manifest placeholder is not
  overridden by the app's value.

Also harden HomeScreen.onGetTemplate() to degrade to a safe template instead of crashing the
Android Auto host on any build-path exception.

Testing Performed:
- aapt-verified the packaged manifest + automotive_app_desc: flag-off -> service disabled +
  notification-only; flag-on -> service enabled + <uses template>.
- spotlessCheck, detekt, assembleDebug (google + fdroid), :feature🚗test (CarScreensTest
  both cases pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e51f4a62-57c2-4d16-9383-5a2b979bbcd6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/car-auto-review-crash

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bugfix PR tag label Jun 29, 2026
@jamesarich jamesarich marked this pull request as ready for review June 29, 2026 17:12
@jamesarich jamesarich enabled auto-merge June 29, 2026 17:25
@jamesarich jamesarich added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit f47c31d Jun 29, 2026
17 checks passed
@jamesarich jamesarich deleted the claude/car-auto-review-crash branch June 29, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant