Add VHAL params for fuel economy and units
Add Units: US_GALLON and IMPERIAL_GALLON
Add property: FUEL_CONSUMPTION_UNITES_DISTANCE_OVER_VOLUME
Bug: 127734378
Test: make and flash
Change-Id: I62531d8351cbeacd433d06bdb1804ee896f2e4a3
diff --git a/car-lib/api/current.txt b/car-lib/api/current.txt
index 7f509df..f2689b5 100644
--- a/car-lib/api/current.txt
+++ b/car-lib/api/current.txt
@@ -144,6 +144,7 @@
field public static final int EV_CHARGE_PORT_OPEN = 287310602; // 0x1120030a
field public static final int FOG_LIGHTS_STATE = 289410562; // 0x11400e02
field public static final int FOG_LIGHTS_SWITCH = 289410578; // 0x11400e12
+ field public static final int FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 287311364; // 0x11200604
field public static final int FUEL_DOOR_OPEN = 287310600; // 0x11200308
field public static final int FUEL_LEVEL = 291504903; // 0x11600307
field public static final int FUEL_LEVEL_LOW = 287310853; // 0x11200405
diff --git a/car-lib/src/android/car/VehiclePropertyIds.java b/car-lib/src/android/car/VehiclePropertyIds.java
index ce10d2a..cfc6e34 100644
--- a/car-lib/src/android/car/VehiclePropertyIds.java
+++ b/car-lib/src/android/car/VehiclePropertyIds.java
@@ -295,6 +295,10 @@
*/
public static final int EV_BATTERY_DISPLAY_UNITS = 289408515;
/**
+ * Fuel consumption units for display
+ */
+ public static final int FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 287311364;
+ /**
* Outside temperature
*/
public static final int ENV_OUTSIDE_TEMPERATURE = 291505923;
@@ -776,6 +780,9 @@
if (o == EV_BATTERY_DISPLAY_UNITS) {
return "EV_BATTERY_DISPLAY_UNITS";
}
+ if (o == FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME) {
+ return "FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME";
+ }
if (o == ENV_OUTSIDE_TEMPERATURE) {
return "ENV_OUTSIDE_TEMPERATURE";
}
diff --git a/car-lib/src/android/car/VehicleUnit.java b/car-lib/src/android/car/VehicleUnit.java
index c9859dc..463d53b 100644
--- a/car-lib/src/android/car/VehicleUnit.java
+++ b/car-lib/src/android/car/VehicleUnit.java
@@ -43,7 +43,8 @@
public static final int KELVIN = 0x32;
public static final int MILLILITER = 0x40;
public static final int LITER = 0x41;
- public static final int GALLON = 0x42;
+ public static final int US_GALLON = 0x42;
+ public static final int IMPERIAL_GALLON = 0x43;
public static final int NANO_SECS = 0x50;
public static final int SECS = 0x53;
public static final int YEAR = 0x59;
@@ -74,7 +75,8 @@
KELVIN,
MILLILITER,
LITER,
- GALLON,
+ US_GALLON,
+ IMPERIAL_GALLON,
NANO_SECS,
SECS,
YEAR,
diff --git a/service/src/com/android/car/hal/PropertyHalServiceIds.java b/service/src/com/android/car/hal/PropertyHalServiceIds.java
index dd38c33..ca90f78 100644
--- a/service/src/com/android/car/hal/PropertyHalServiceIds.java
+++ b/service/src/com/android/car/hal/PropertyHalServiceIds.java
@@ -397,6 +397,9 @@
mProps.put(VehicleProperty.EV_BATTERY_DISPLAY_UNITS, new Pair<>(
Car.PERMISSION_READ_DISPLAY_UNITS,
Car.PERMISSION_CONTROL_DISPLAY_UNITS));
+ mProps.put(VehicleProperty.FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME, new Pair<>(
+ Car.PERMISSION_READ_DISPLAY_UNITS,
+ Car.PERMISSION_CONTROL_DISPLAY_UNITS));
}
/**