HA Companion app on Android Car Headunit

Hello,

I have an Android head unit installed in my car, it runs android 12 and I installed a custom launcher (Agama) on it that fits the needs of a car user.
The home assistant companion app works well and one of the purposes I have it on there is to track the car. Here comes my problem. After a reboot the companion app is not running and I don’t get location updates or send any notification commands.

I can auto-start the app with the launcher and that works well, but it starts and opens the app. I would like to see that it starts in the background.
Any clues how to achieve this?

it actually should auto start on its own as long as the apps schedule is set which should be automatic once launched unless the app crashes or is force closed. This may be some odd device behavior, you can try to double check the app has permission to run in the background but outside of that it should jsut work.

I think you are right, the device seems to have some restrictions. I found posts on XDA forum where people are unable to start apps in the background on boot for head units in general.
I have just found this video and tried it. will check if it works.

I went through this exact issue you are having. Have you tried seeing if Tasker will start the HA app? I’ve installed Tasker and set an automation through that to start the HA app on boot. With Agama I can see it load for a split second then it disappears behind the launcher which is perfect.

It is really strange; I have given the permission to the companion app to run at startup. that works once and after that it won’t. Now I let agama start the companion app, but then it doesn’t disappear (minimize). Also other apps show the same behavior, they run once after giving the permission. there is definitely something strange going on wrt the OS on this device.

Android head units behave differently to standard Android phones and tablets that you may be use to. I’m pretty sure it’s related to the quick boot options they they use to make the device start much quicker when you turn on the ignition. That means that the device isn’t technically “booting” each time which means apps that are set to start at boot aren’t loaded because the device isn’t technicaly booting up like they would expect. Have a look at the power settings for the head unit to see if you can change the quick boot settings as well.

I have a sleep setting and I think this is related to quickboot / fast boot. However I am pretty sure my head unit boots ‘normally’. because reboot and boot take the same time, and both don’t start the home assistant companion app, despite I gave it the permission to run at startup. I suspect the system wipes the setting to run at startup, probably to boot faster.

try to start the app first then do a restart and unlock (wait 1 minute) and see if a sensor updates…as long as the app is not stopped it should stay on schedule but if the OS is manually stopping the app then yea that can be an issue

Actually I am sending a notification command_webview to the companion app to test if it comes online. this brings the app on the foreground if it is running.

are you using the critical format to speed up delivery?

https://companion.home-assistant.io/docs/notifications/critical-notifications

do other sensors like last notification work on the device?