Do not write initial empty values for the diagnostic properties. There is a separate step that initializes them with meaningful values. am: ad2baebb3b
am: 8beffc61fb
Change-Id: I239505a8b1a4b3cb90a02e7980d256c9e9222678
This commit is contained in:
commit
3b62ca8ce2
1 changed files with 17 additions and 0 deletions
|
@ -162,12 +162,29 @@ StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) {
|
|||
return StatusCode::OK;
|
||||
}
|
||||
|
||||
static bool isDiagnosticProperty(VehiclePropConfig propConfig) {
|
||||
switch (propConfig.prop) {
|
||||
case OBD2_LIVE_FRAME:
|
||||
case OBD2_FREEZE_FRAME:
|
||||
case OBD2_FREEZE_FRAME_CLEAR:
|
||||
case OBD2_FREEZE_FRAME_INFO:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Parse supported properties list and generate vector of property values to hold current values.
|
||||
void EmulatedVehicleHal::onCreate() {
|
||||
for (auto& it : kVehicleProperties) {
|
||||
VehiclePropConfig cfg = it.config;
|
||||
int32_t supportedAreas = cfg.supportedAreas;
|
||||
|
||||
if (isDiagnosticProperty(cfg)) {
|
||||
// do not write an initial empty value for the diagnostic properties
|
||||
// as we will initialize those separately.
|
||||
continue;
|
||||
}
|
||||
|
||||
// A global property will have supportedAreas = 0
|
||||
if (isGlobalProp(cfg.prop)) {
|
||||
supportedAreas = 0;
|
||||
|
|
Loading…
Reference in a new issue