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

Commit 22ec893a authored by Yu Shan's avatar Yu Shan
Browse files

Define JSON property config file for VHAL.

Define JSON-style property config files for reference VHAL. The
VHAL is converted from DefaultConfig.h using a one-off script
and some manual tweaking. We will add tests to make sure the
JSON file is consistent with DefaultConfig.h.

Test: None, will add test once we complete the parser.
Bug: 238685398

Change-Id: Ifdd41da591e8c352326a247f65a59cda36b76981
parent 23ffe48a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
filegroup {
    name: "VehicleHalDefaultProperties_JSON",
    srcs: ["DefaultProperties.json"],
}

filegroup {
    name: "VehicleHalTestProperties_JSON",
    srcs: ["TestProperties.json"],
}

filegroup {
    name: "VehicleHalVendorClusterTestProperties_JSON",
    srcs: ["VendorClusterTestProperties.json"],
}
+1345 −0

File added.

Preview size limit exceeded, changes collapsed.

+204 −0
Original line number Diff line number Diff line
{
    "properties": [
        {
            "property": "Constants::kMixedTypePropertyForTest",
            "defaultValue": {
                "floatValues": [
                    4.5
                ],
                "int32Values": [
                    1,
                    2,
                    3
                ],
                "stringValue": "MIXED property"
            },
            "configArray": [
                1,
                1,
                0,
                2,
                0,
                0,
                1,
                0,
                0
            ],
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::VENDOR_EXTENSION_BOOLEAN_PROPERTY",
            "areas": [
                {
                    "defaultValue": {
                        "int32Values": [
                            1
                        ]
                    },
                    "areaId": "Constants::DOOR_1_LEFT"
                },
                {
                    "defaultValue": {
                        "int32Values": [
                            1
                        ]
                    },
                    "areaId": "Constants::DOOR_1_RIGHT"
                },
                {
                    "defaultValue": {
                        "int32Values": [
                            0
                        ]
                    },
                    "areaId": "Constants::DOOR_2_LEFT"
                },
                {
                    "defaultValue": {
                        "int32Values": [
                            0
                        ]
                    },
                    "areaId": "Constants::DOOR_2_RIGHT"
                }
            ],
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY",
            "areas": [
                {
                    "defaultValue": {
                        "floatValues": [
                            1.0
                        ]
                    },
                    "areaId": "Constants::HVAC_LEFT",
                    "minFloatValue": -10.0,
                    "maxFloatValue": 10.0
                },
                {
                    "defaultValue": {
                        "floatValues": [
                            2.0
                        ]
                    },
                    "areaId": "Constants::HVAC_RIGHT",
                    "minFloatValue": -10.0,
                    "maxFloatValue": 10.0
                }
            ],
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::VENDOR_EXTENSION_INT_PROPERTY",
            "areas": [
                {
                    "defaultValue": {
                        "int32Values": [
                            1
                        ]
                    },
                    "areaId": "VehicleAreaWindow::FRONT_WINDSHIELD",
                    "minInt32Value": -100,
                    "maxInt32Value": 100
                },
                {
                    "defaultValue": {
                        "int32Values": [
                            0
                        ]
                    },
                    "areaId": "VehicleAreaWindow::REAR_WINDSHIELD",
                    "minInt32Value": -100,
                    "maxInt32Value": 100
                },
                {
                    "defaultValue": {
                        "int32Values": [
                            -1
                        ]
                    },
                    "areaId": "VehicleAreaWindow::ROOF_TOP_1",
                    "minInt32Value": -100,
                    "maxInt32Value": 100
                }
            ],
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::VENDOR_EXTENSION_STRING_PROPERTY",
            "defaultValue": {
                "stringValue": "Vendor String Property"
            },
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::PLACEHOLDER_PROPERTY_INT",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::PLACEHOLDER_PROPERTY_FLOAT",
            "defaultValue": {
                "floatValues": [
                    0.0
                ]
            },
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::PLACEHOLDER_PROPERTY_BOOLEAN",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::PLACEHOLDER_PROPERTY_STRING",
            "defaultValue": {
                "stringValue": "Test"
            },
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::ECHO_REVERSE_BYTES",
            "access": "VehiclePropertyAccess::READ_WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION",
            "defaultValue": {
                "int32Values": [
                    1
                ]
            },
            "configArray": [
                "Constants::kMixedTypePropertyForTest",
                "VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO",
                "VehicleVendorPermission::PERMISSION_SET_VENDOR_CATEGORY_INFO",
                "Constants::VENDOR_EXTENSION_INT_PROPERTY",
                "VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_SEAT",
                "VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE",
                "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY",
                "VehicleVendorPermission::PERMISSION_DEFAULT",
                "VehicleVendorPermission::PERMISSION_DEFAULT"
            ]
        }
    ]
}
 No newline at end of file
+63 −0
Original line number Diff line number Diff line
{
    "properties": [
        {
            "property": "Constants::VENDOR_CLUSTER_SWITCH_UI",
            "access": "VehiclePropertyAccess::WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::VENDOR_CLUSTER_DISPLAY_STATE",
            "access": "VehiclePropertyAccess::WRITE",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        },
        {
            "property": "Constants::VENDOR_CLUSTER_REPORT_STATE",
            "defaultValue": {
                "int32Values": [
                    0,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    -1,
                    0,
                    -1
                ]
            },
            "configArray": [
                0,
                0,
                0,
                11,
                0,
                0,
                0,
                0,
                16
            ],
            "access": "VehiclePropertyAccess::READ",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE",
            "comment":
                    "Value means 0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */, 0 /* ClusterHome */, -1 /* ClusterNone */"
        },
        {
            "property": "Constants::VENDOR_CLUSTER_REQUEST_DISPLAY",
            "defaultValue": {
                "int32Values": [
                    0
                ]
            },
            "access": "VehiclePropertyAccess::READ",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE",
            "comment": "0 means ClusterHome"
        },
        {
            "property": "Constants::VENDOR_CLUSTER_NAVIGATION_STATE",
            "access": "VehiclePropertyAccess::READ",
            "changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
        }
    ]
}
 No newline at end of file