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

Commit 61dd7a76 authored by Yu Shan's avatar Yu Shan
Browse files

Add recently added properties and fix change mode.

Add the recently added properties to DefaultProperties.json to sync with
DefaultConfig.h.

This CL also fixes change mode for
SUPPORT_CUSTOMIZE_VENDOR_PERMISSION and REMOVE_USER to be consistent
with the property change mode annotation.

Test: atest DefaultConfigTest
Bug: 239613431
Change-Id: I0389746f9e0498330ab38c6bc41bb3a92886b32e
parent 6707175b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow;
using ::aidl::android::hardware::automotive::vehicle::VehicleGear;
using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection;
@@ -82,8 +83,11 @@ const std::unordered_map<std::string, int> CONSTANTS_BY_NAME = {
        {"WINDOW_2_RIGHT", WINDOW_2_RIGHT},
        {"WINDOW_ROOF_TOP_1", WINDOW_ROOF_TOP_1},
        {"WINDOW_1_RIGHT_2_LEFT_2_RIGHT", WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT},
        {"SEAT_1_RIGHT", SEAT_1_RIGHT},
        {"SEAT_1_LEFT", SEAT_1_LEFT},
        {"SEAT_1_RIGHT", SEAT_1_RIGHT},
        {"SEAT_2_LEFT", SEAT_2_LEFT},
        {"SEAT_2_RIGHT", SEAT_2_RIGHT},
        {"SEAT_2_CENTER", SEAT_2_CENTER},
        {"WHEEL_REAR_RIGHT", WHEEL_REAR_RIGHT},
        {"WHEEL_REAR_LEFT", WHEEL_REAR_LEFT},
        {"WHEEL_FRONT_RIGHT", WHEEL_FRONT_RIGHT},
@@ -101,6 +105,8 @@ const std::unordered_map<std::string, int> CONSTANTS_BY_NAME = {
        {"FUEL_DOOR_REAR_LEFT", FUEL_DOOR_REAR_LEFT},
        {"LIGHT_STATE_ON", LIGHT_STATE_ON},
        {"LIGHT_SWITCH_AUTO", LIGHT_SWITCH_AUTO},
        {"MIRROR_DRIVER_LEFT_RIGHT",
         toInt(VehicleAreaMirror::DRIVER_LEFT) | toInt(VehicleAreaMirror::DRIVER_RIGHT)},
#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
        // Following are test properties:
        {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES},
@@ -170,6 +176,8 @@ JsonValueParser::JsonValueParser() {
    mConstantParsersByType["VehicleGear"] = std::make_unique<ConstantParser<VehicleGear>>();
    mConstantParsersByType["VehicleAreaWindow"] =
            std::make_unique<ConstantParser<VehicleAreaWindow>>();
    mConstantParsersByType["VehicleAreaMirror"] =
            std::make_unique<ConstantParser<VehicleAreaMirror>>();
    mConstantParsersByType["VehicleOilLevel"] = std::make_unique<ConstantParser<VehicleOilLevel>>();
    mConstantParsersByType["VehicleUnit"] = std::make_unique<ConstantParser<VehicleUnit>>();
    mConstantParsersByType["VehicleSeatOccupancyState"] =
+321 −1
Original line number Diff line number Diff line
@@ -129,6 +129,311 @@
                "VehicleUnit::KILOWATT_HOUR"
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BELT_BUCKLED",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT"
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT"
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT"
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT"
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER"
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BELT_HEIGHT_POS",
            "defaultValue": {
                "int32Values": [
                    10
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": 0,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": 0,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": 0,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": 0,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": 0,
                    "maxInt32Value": 10
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BELT_HEIGHT_MOVE",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_FORE_AFT_POS",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_FORE_AFT_MOVE",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BACKREST_ANGLE_1_POS",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BACKREST_ANGLE_2_POS",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -10,
                    "maxInt32Value": 10
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::SEAT_1_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_1_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_LEFT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_RIGHT",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                },
                {
                    "areaId": "Constants::SEAT_2_CENTER",
                    "minInt32Value": -1,
                    "maxInt32Value": 1
                }
            ]
        },
        {
            "property": "VehicleProperty::SEAT_OCCUPANCY",
            "areas": [
@@ -782,6 +1087,21 @@
            ],
            "comment": "+ve values for heating and -ve for cooling"
        },
        {
            "property": "VehicleProperty::HVAC_SIDE_MIRROR_HEAT",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "areas": [
                {
                    "areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT",
                    "minInt32Value": 0,
                    "maxInt32Value": 2
                }
            ]
        },
        {
            "property": "VehicleProperty::HVAC_TEMPERATURE_SET",
            "areas": [
+12 −48
Original line number Diff line number Diff line
@@ -182,11 +182,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_LEFT},
                                    VehicleAreaConfig{.areaId = SEAT_2_RIGHT},
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_HEIGHT_POS),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -206,11 +202,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = 0,
                                                      .maxInt32Value = 10}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {10}}},
                               {SEAT_1_RIGHT, {.int32Values = {10}}},
                               {SEAT_2_LEFT, {.int32Values = {10}}},
                               {SEAT_2_RIGHT, {.int32Values = {10}}},
                               {SEAT_2_CENTER, {.int32Values = {10}}}}},
         .initialValue = {.int32Values = {10}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_BELT_HEIGHT_MOVE),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -230,11 +222,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -1,
                                                      .maxInt32Value = 1}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_FORE_AFT_POS),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -254,11 +242,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -10,
                                                      .maxInt32Value = 10}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_FORE_AFT_MOVE),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -278,11 +262,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -1,
                                                      .maxInt32Value = 1}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_1_POS),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -302,11 +282,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -10,
                                                      .maxInt32Value = 10}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -326,11 +302,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -1,
                                                      .maxInt32Value = 1}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_2_POS),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -350,11 +322,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -10,
                                                      .maxInt32Value = 10}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config = {.prop = toInt(VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE),
                    .access = VehiclePropertyAccess::READ_WRITE,
@@ -374,11 +342,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                                    VehicleAreaConfig{.areaId = SEAT_2_CENTER,
                                                      .minInt32Value = -1,
                                                      .maxInt32Value = 1}}},
         .initialAreaValues = {{SEAT_1_LEFT, {.int32Values = {0}}},
                               {SEAT_1_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_LEFT, {.int32Values = {0}}},
                               {SEAT_2_RIGHT, {.int32Values = {0}}},
                               {SEAT_2_CENTER, {.int32Values = {0}}}}},
         .initialValue = {.int32Values = {0}}},

        {.config =
                 {
@@ -1271,7 +1235,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                 {
                         .prop = toInt(VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION),
                         .access = VehiclePropertyAccess::READ,
                         .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
                         .changeMode = VehiclePropertyChangeMode::STATIC,
                         .configArray = {kMixedTypePropertyForTest,
                                         toInt(VehicleVendorPermission::
                                                       PERMISSION_GET_VENDOR_CATEGORY_INFO),
@@ -1315,8 +1279,8 @@ const std::vector<ConfigDeclaration> kVehicleProperties = {
                .config =
                        {
                                .prop = toInt(VehicleProperty::REMOVE_USER),
                                .access = VehiclePropertyAccess::READ_WRITE,
                                .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
                                .access = VehiclePropertyAccess::WRITE,
                                .changeMode = VehiclePropertyChangeMode::STATIC,
                        },
        },
        {