Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3974eacf authored by Eric Jeong's avatar Eric Jeong
Browse files

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
parent 8dff34bc
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -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 =
                        {
+61 −2
Original line number Diff line number Diff line
@@ -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.
     *