Add enter garage mode bootup reason.
Test: m android.hardware.automotive.vehicle.property-update-api
Bug: 316217804
Change-Id: I2556e784d6a1b48c8067b06157176743fe6fa5a2
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
index 9720aca..55af2ab 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
@@ -37,4 +37,5 @@
USER_POWER_ON = 0,
SYSTEM_USER_DETECTION = 1,
SYSTEM_REMOTE_ACCESS = 2,
+ SYSTEM_ENTER_GARAGE_MODE = 3,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
index e325b38..8c8c2da 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
@@ -34,7 +34,24 @@
SYSTEM_USER_DETECTION = 1,
/**
* Automatic power on to execute a remote task. This is triggered by
- * receiving a wakeup message from TCU wakeup client.
+ * receiving a wakeup message from an external system in the vehicle.
*/
SYSTEM_REMOTE_ACCESS = 2,
+ /**
+ * Automatic power on to enter garage mode. This is triggered by
+ * receiving a wakeup message from an external system in the vehicle.
+ *
+ * Note that this does not necessarily mean Android will enter
+ * the garage mode since user may enter the vehicle after this is set.
+ * The system will only enter garage mode if VEHICLE_IN_USE is not true
+ * upon check.
+ *
+ * To consider the Time-Of-Check-Time-Of-Use issue, there is a slight chance
+ * that the vehicle become in-use after car service does the VEHICLE_IN_USE
+ * check. The external power controller must also check whether the vehicle
+ * is in use upon receiving the SHUTDOWN_REQUEST, before sending out
+ * SHUTDOWN_PREPARE, to make sure the system does not enter garage mode or
+ * shutdown if the vehicle is currently in use.
+ */
+ SYSTEM_ENTER_GARAGE_MODE = 3,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index ecabe8c..3d63a06 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -4545,12 +4545,22 @@
/**
* Request the head unit to be shutdown.
*
+ * <p>This is required for executing a task when the head unit is powered off (remote task
+ * feature). After the head unit is powered-on to execute the task, the head unit should
+ * be shutdown. The head unit will send this message once the task is finished.
+ *
+ * <p>This is not for the case when a user wants to shutdown the head unit.
+ *
* <p>This usually involves telling a separate system outside the head unit (e.g. a power
* controller) to prepare shutting down the head unit.
*
- * <p>This does not mean the head unit will shutdown immediately.
+ * <p>Note that the external system must validate whether this request is valid by checking
+ * whether the vehicle is currently in use. If a user enters the vehicle after a
+ * SHUTDOWN_REQUEST is sent, then the system must ignore this request. It
+ * is recommended to store a VehicleInUse property in the power controller and exposes it
+ * through VEHICLE_IN_USE property. A shutdown request must be ignored if VehicleInUse is true.
*
- * <p>This means that another system will start sending a shutdown signal to the head unit,
+ * <p>If allowed, the external system will start sending a shutdown signal to the head unit,
* which will cause VHAL to send SHUTDOWN_PREPARE message to Android. Android will then start
* the shut down process by handling the message.
*