Skip to content

Implement support for Android Auto#3993

Open
maniac103 wants to merge 3 commits into
openhab:mainfrom
maniac103:android-auto
Open

Implement support for Android Auto#3993
maniac103 wants to merge 3 commits into
openhab:mainfrom
maniac103:android-auto

Conversation

@maniac103

Copy link
Copy Markdown
Contributor

Fixes #3041

Fixes openhab#3041

Signed-off-by: Danny Baumann <dannybaumann@web.de>
@maniac103

maniac103 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Implementation comments:

  • Min SDK version bump is needed due to some transient dependency (probably pulled in by lifecycle-service) requiring it: Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [androidx.savedstate:savedstate-ktx:1.4.0]
  • AA uses the primary connection
  • Implemented are the following sitemap widgets: text, switch, switch-with-mappings, rollershutter, player, selection
  • Maximum page link nesting depth is 5, including the additional screen for action selection (limitation of AA)
  • Maximum number of sitemap widgets (== length of widget list) may or may not be limited by AA, exact limitation value can differ between cars and/or AA version
  • The sitemap to be used is selected on first startup; for changing the selection one needs to clear the primary server's default sitemap

I'm open for improvement suggestions about

  • default sitemap selection
  • ways of conveying the AA limitations towards the user

I've also thought about using GridTemplate instead of ListTemplate, but there's a couple of drawbacks:

  • grid items don't support inline switches
  • grid items kinda are based on images, but server side icons are not guaranteed to be present (also handling is complicated, as we'd need to pre-fetch them)
  • (widget count limit doesn't seem to be larger for grids either)

Once this is accepted, we probably need a release on the beta track in Play Store, since sideloaded apps don't appear in the AA launcher.

@maniac103

maniac103 commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Open issue I don't have a good idea for yet: Loading a different sitemap (e.g. after a server change) also counts against the 5 step limit documented here. This means that after moving back and forth a few times, the app will consume more than 5 steps and crash. This problem is worsened by sitemap selection screen (which counts as a separate step each time), but even if we'd do the sitemap selection on the phone the problem is there and just takes a few toggles more to appear.
I have not yet found a way to restart the step counter.

One option to remedy this may be to not listen for server changes, so that after changing servers one needs to reconnect to AA to reflect the change in the AA app. Not sure if this is acceptable?

maniac103 added 2 commits May 7, 2026 10:47
Signed-off-by: Danny Baumann <dannybaumann@web.de>
Signed-off-by: Danny Baumann <dannybaumann@web.de>
@robnielsen

Copy link
Copy Markdown
Contributor

Loading a different sitemap (e.g. after a server change) also counts against the 5 step limit documented here.

Maybe disable loading a different sitemap when moving? https://source.android.com/docs/automotive/driver_distraction/consume#DrivingState

@maniac103

Copy link
Copy Markdown
Contributor Author

Maybe disable loading a different sitemap when moving? https://source.android.com/docs/automotive/driver_distraction/consume#DrivingState

From my understanding,

  • that API is only available for AAOS, not for AA
  • the 5 step limit takes effect no matter whether the car is parked or not, except
  • if adaptive task limits is active, in which case more than 5 steps may be possible when parked, but
  • whether it's enabled is under OEM control, and app behavior on > 5 steps differs hugely between it being enabled or not (delayed display vs. crash)

Given all of those, I think we need to design our UX for the 5 step limit, no matter if parked or not.

@mueller-ma

Copy link
Copy Markdown
Member

We could:

  • Sitemap selections on phone
  • Disallow any sub-pages
  • Don't refresh sitemaps when the configuration is changed on the server

That way we shouldn't hit the limit, but no sub-pages might be an issue for some people.

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.

Openhab Android app compatability with AndroidAuto

3 participants