Define SHUTDOWN_REQUEST property.

Test: m -j android.hardware.automotive.vehicle-update-api
Bug: 260913967
Change-Id: I9661fdd0426b5d42c9b949cbf97a15dfed7d9590
This commit is contained in:
Yu Shan 2022-11-30 14:57:40 -08:00
parent da9b3895d2
commit d20f22d250
6 changed files with 45 additions and 3 deletions

View file

@ -224,4 +224,5 @@ enum VehicleProperty {
VEHICLE_CURB_WEIGHT = 289410886,
GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = 289410887,
SUPPORTED_PROPERTY_IDS = 289476424,
SHUTDOWN_REQUEST = 289410889,
}

View file

@ -1154,7 +1154,7 @@ enum VehicleProperty {
* It is assumed that AP's power state is controlled by a separate power
* controller.
*
* For configuration information, VehiclePropConfig.configArray can have bit flag combining
* For configuration information, VehiclePropConfig.configArray must have bit flag combining
* values in VehicleApPowerStateConfigFlag.
*
* int32Values[0] : VehicleApPowerStateReq enum value
@ -3140,4 +3140,41 @@ enum VehicleProperty {
*/
SUPPORTED_PROPERTY_IDS = 0x0F48 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
/**
* Request the head unit to be shutdown.
*
* <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>This means that another 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.
*
* <p>This property is only for issuing a request and only supports writing. Every time this
* property value is set, the request to shutdown will be issued no matter what the current
* property value is. The current property value is meaningless.
*
* <p>Since this property is write-only, subscribing is not allowed and no property change
* event will be generated.
*
* <p>The value to set indicates the shutdown option, it must be one of
* {@code VehicleApPowerStateShutdownParam}, e.g.,
* VehicleApPowerStateShutdownParam.SLEEP_IMMEDIATELY. This shutdown option might not be honored
* if the system doesn't support such option. In such case, an error will not be returned.
*
* <p>For configuration information, VehiclePropConfig.configArray must have bit flag combining
* values in {@code VehicleApPowerStateConfigFlag} to indicate which shutdown options are
* supported.
*
* <p>Returns error if failed to send the shutdown request to the other system.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
* @data_enum VehicleApPowerStateShutdownParam
*/
SHUTDOWN_REQUEST =
0x0F49 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
}

View file

@ -224,6 +224,7 @@ std::unordered_map<VehicleProperty, VehiclePropertyAccess> AccessForVehiclePrope
{VehicleProperty::VEHICLE_CURB_WEIGHT, VehiclePropertyAccess::READ},
{VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyAccess::READ},
{VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess::READ},
{VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyAccess::WRITE},
};
} // namespace vehicle

View file

@ -224,6 +224,7 @@ std::unordered_map<VehicleProperty, VehiclePropertyChangeMode> ChangeModeForVehi
{VehicleProperty::VEHICLE_CURB_WEIGHT, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyChangeMode::ON_CHANGE},
};
} // namespace vehicle

View file

@ -215,7 +215,8 @@ public final class AccessForVehicleProperty {
Map.entry(VehicleProperty.TRAILER_PRESENT, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.VEHICLE_CURB_WEIGHT, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess.READ)
Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyAccess.WRITE)
);
}

View file

@ -215,7 +215,8 @@ public final class ChangeModeForVehicleProperty {
Map.entry(VehicleProperty.TRAILER_PRESENT, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.VEHICLE_CURB_WEIGHT, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode.STATIC)
Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyChangeMode.ON_CHANGE)
);
}