Define VHAL properties for car power policy

- POWER_POLICY_REQ: VHAL uses to set a new power policy
- POWER_POLICY_GROUP_REQ: VHAL uses to set default power policies
per power status transition
- CURRENT_POWER_POLICY: carpowerpolicyd updates to tell VHAL the current
power policy

Bug: 162599168
Test: build okay
Change-Id: Ife58cec19bc099129d2cc49bac8821455d6b4194
This commit is contained in:
Eric Jeong
2020-09-10 09:26:24 -07:00
parent 8dff34bce3
commit 3974eacf08
2 changed files with 85 additions and 2 deletions

View File

@@ -1092,6 +1092,30 @@ const ConfigDeclaration kVehicleProperties[]{
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = toInt(VehicleProperty::POWER_POLICY_REQ),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = toInt(VehicleProperty::POWER_POLICY_GROUP_REQ),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = toInt(VehicleProperty::CURRENT_POWER_POLICY),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{

View File

@@ -2920,6 +2920,65 @@ enum VehicleProperty : int32_t {
| VehiclePropertyType:MIXED
| VehicleArea:GLOBAL),
/**
* Defines a request to apply power policy.
*
* VHAL sets this property to change car power policy. Car power policy service subscribes to
* this property and actually changes the power policy.
* The request is made by setting the VehiclePropValue with the ID of a power policy which is
* defined at /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy
* service ignores the request and the current power policy is maintained.
*
* string: "sample_policy_id" // power policy ID
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
POWER_POLICY_REQ = (
0x0F21
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:STRING
| VehicleArea:GLOBAL),
/**
* Defines a request to set the power polic group used to decide a default power policy per
* power status transition.
*
* VHAL sets this property with the ID of a power policy group in order to set the default power
* policy applied at power status transition. Power policy groups are defined at
* /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy service
* ignores the request.
* Car power policy service subscribes to this property and sets the power policy group.
* The actual application of power policy takes place when the system power status changes and
* there is a valid mapped power policy for the new power status.
*
* string: "sample_policy_group_id" // power policy group ID
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
POWER_POLICY_GROUP_REQ = (
0x0F22
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:STRING
| VehicleArea:GLOBAL),
/**
* Notifies the current power policy to VHAL layer.
*
* Car power policy service sets this property when the current power policy is changed.
*
* string: "sample_policy_id" // power policy ID
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
CURRENT_POWER_POLICY = (
0x0F23
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:STRING
| VehicleArea:GLOBAL),
/**
* Defines an event that car watchdog updates to tell it's alive.
*
@@ -2938,8 +2997,8 @@ enum VehicleProperty : int32_t {
/**
* Defines a process terminated by car watchdog and the reason of termination.
*
* int32Values[0]: 1 // ProcessTerminationReason showing why a process is terminated.
* string: "/system/bin/log" // Process execution command.
* int32Values[0]: 1 // ProcessTerminationReason showing why a process is terminated.
* string: "/system/bin/log" // Process execution command.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:WRITE