[Automotive] How to disable GARAGE mode in Android 8 and later

410 views
Skip to first unread message

platisd

unread,
Mar 29, 2018, 7:53:18 PM3/29/18
to android-platform
Hi,

We are trying to shut down our (automotive) system down through the Vehicle HAL, e.g. by setting `VehicleApPowerState::SHUTDOWN_PREPARE` with `VehicleApPowerStateShutdownParam::SHUTDOWN_ONLY`. However, the `CarPowerManagementService` class postpones shutdown for the `GarageModeService` handler to finish performing "maintenance tasks when car is parked and in Wi-Fi range".
Since we might not want our system to go into Garage mode (as we have noticed it takes an undefined amount of time for it to finish) we are trying to disable it. In some Android Automotive bootcamp slides from 2016 (which I am unsure if I am allowed to publish), it is mentioned that to enable Garage Mode, one would need to overlay the following framework values:

<integer name=:“config_jobSchedulerInactivityIdleThreshold”>0</integer>
<integer name=:“config_jobSchedulerIdleWindowSlop”>0</integer>

We have tried removing the relevant entries from one of our overlays, meaning that the original values should now be there, but to no avail. The strange thing is that, looking at the code we could not find any obvious connection between those two values and whether the Garage mode is enabled or not. From our understanding, this depends on the `android.car.GARAGE_MODE_ENABLED` value.

Provided that we do not want to patch AOSP so to change the default behavior, are there any ideas on how to disable Garage Mode? Thanks!

platisd

unread,
Apr 2, 2018, 10:32:36 AM4/2/18
to android-platform
Delving more into this, we see that Garage Mode will be registered as a `PowerEventProcessingHandler` irrespective of the `GARAGE_MODE_ENABLED` value. As a matter of fact, registration will always take place.

It would be really nice if we could get this customizable depending on our system setup. The only hint in the code pointing towards this is within the `readPolicyLocked` method where the following is mentioned:

// TODO: define a xml schema for policy and read it from system dir. bug: 32096969

Should we assume the fix of `32096969` will introduce the intended behavior?
Reply all
Reply to author
Forward
0 new messages