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

Commit 782ef26b authored by Jordan Jozwiak's avatar Jordan Jozwiak
Browse files

Add missing VHAL properties

Bug: b/111500076
Test: Build and install.
Change-Id: I32bfd33ce050ab6ffc886e2ba63b99bd5a33ad31
(cherry picked from commit 85df08f4fe94fd6dfedd6d7def5192cf1f7ce2c4)
parent 333d9050
Loading
Loading
Loading
Loading
+142 −7
Original line number Diff line number Diff line
@@ -58,6 +58,14 @@ constexpr int VENDOR_EXTENSION_INT_PROPERTY =
    (int)(0x103 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::INT32 | VehicleArea::WINDOW);
constexpr int VENDOR_EXTENSION_STRING_PROPERTY =
    (int)(0x104 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::STRING | VehicleArea::GLOBAL);
constexpr int FUEL_DOOR_REAR_LEFT = (int)PortLocationType::REAR_LEFT;
constexpr int CHARGE_PORT_FRONT_LEFT = (int)PortLocationType::FRONT_LEFT;
constexpr int LIGHT_STATE_ON = (int)VehicleLightState::ON;
constexpr int LIGHT_SWITCH_AUTO = (int)VehicleLightSwitch::AUTOMATIC;
constexpr int WHEEL_FRONT_LEFT = (int)VehicleAreaWheel::LEFT_FRONT;
constexpr int WHEEL_FRONT_RIGHT = (int)VehicleAreaWheel::RIGHT_FRONT;
constexpr int WHEEL_REAR_LEFT = (int)VehicleAreaWheel::LEFT_REAR;
constexpr int WHEEL_REAR_RIGHT = (int)VehicleAreaWheel::RIGHT_REAR;

/**
 * This property is used for test purpose to generate fake events. Here is the test package that
@@ -149,8 +157,9 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::STATIC,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.floatValues = {15000}}},
     .initialValue = {.floatValues = {15000.0f}}},

    {.config =
         {
@@ -165,8 +174,9 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::STATIC,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.floatValues = {150000}}},
     .initialValue = {.floatValues = {150000.0f}}},

    {.config =
         {
@@ -176,6 +186,24 @@ const ConfigDeclaration kVehicleProperties[]{
         },
     .initialValue = {.int32Values = {1}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::INFO_FUEL_DOOR_LOCATION),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::STATIC,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {FUEL_DOOR_REAR_LEFT}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::INFO_EV_PORT_LOCATION),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::STATIC,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::INFO_MAKE),
@@ -218,14 +246,16 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::FUEL_LEVEL),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.floatValues = {15000}}},
     .initialValue = {.floatValues = {15000.0f}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::FUEL_DOOR_OPEN),
             .access = VehiclePropertyAccess::READ,
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {0}}},

@@ -234,14 +264,16 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::EV_BATTERY_LEVEL),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.floatValues = {150000}}},
     .initialValue = {.floatValues = {150000.0f}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::EV_CHARGE_PORT_OPEN),
             .access = VehiclePropertyAccess::READ,
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {0}}},

@@ -250,6 +282,7 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::EV_CHARGE_PORT_CONNECTED),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {0}}},

@@ -258,8 +291,37 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.floatValues = {0.0f}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::RANGE_REMAINING),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.floatValues = {0}}},
     .initialValue = {.floatValues = {100.0f}}},  // units in meters

    {.config =
         {.prop = toInt(VehicleProperty::TIRE_PRESSURE),
          .access = VehiclePropertyAccess::READ,
          .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
          .areaConfigs =
              {VehicleAreaConfig{
                   .areaId = WHEEL_FRONT_LEFT, .minFloatValue = 100.0f, .maxFloatValue = 300.0f,
               },
               VehicleAreaConfig{
                   .areaId = WHEEL_FRONT_RIGHT, .minFloatValue = 100.0f, .maxFloatValue = 300.0f,
               },
               VehicleAreaConfig{
                   .areaId = WHEEL_REAR_LEFT, .minFloatValue = 100.0f, .maxFloatValue = 300.0f,
               },
               VehicleAreaConfig{
                   .areaId = WHEEL_REAR_RIGHT, .minFloatValue = 100.0f, .maxFloatValue = 300.0f,
               }}},
     .initialValue = {.floatValues = {200}}},  // units in kPa

    {.config =
         {
@@ -282,6 +344,7 @@ const ConfigDeclaration kVehicleProperties[]{
             .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {0}}},

@@ -540,6 +603,78 @@ const ConfigDeclaration kVehicleProperties[]{
                   .configArray = {1}},
    },

    {.config =
         {
             .prop = toInt(VehicleProperty::HEADLIGHTS_STATE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_STATE_ON}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_STATE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_STATE_ON}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::FOG_LIGHTS_STATE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_STATE_ON}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::HAZARD_LIGHTS_STATE),
             .access = VehiclePropertyAccess::READ,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_STATE_ON}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::HEADLIGHTS_SWITCH),
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH),
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::FOG_LIGHTS_SWITCH),
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},

    {.config =
         {
             .prop = toInt(VehicleProperty::HAZARD_LIGHTS_SWITCH),
             .access = VehiclePropertyAccess::READ_WRITE,
             .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
             .areaConfigs = {VehicleAreaConfig{.areaId = (0)}},
         },
     .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}},

    {.config = {.prop = VEHICLE_MAP_SERVICE,
                .access = VehiclePropertyAccess::READ_WRITE,
                .changeMode = VehiclePropertyChangeMode::ON_CHANGE}},