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

Commit 03ca3ee5 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7881892 from d652835d to tm-release

Change-Id: I17b9416e9310d6887cda056429e68a75ff1bf73f
parents 1d421033 d652835d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -14,6 +14,12 @@
    },
    {
      "name": "FakeVehicleHalValueGeneratorsTest"
    },
    {
      "name": "FakeObd2FrameTest"
    },
    {
      "name": "FakeUserHalTest"
    }
  ]
}
+4 −1
Original line number Diff line number Diff line
@@ -25,7 +25,10 @@ cc_library {
    local_include_dirs: ["include"],
    export_include_dirs: ["include"],
    defaults: ["VehicleHalDefaults"],
    static_libs: ["VehicleHalUtils"],
    static_libs: [
        "VehicleHalUtils",
        "FakeObd2Frame",
    ],
    shared_libs: [
        "libjsoncpp",
    ],
+5 −13
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <type_traits>
#include <typeinfo>

#include <Obd2SensorStore.h>
#include <VehicleUtils.h>
#include <android/binder_enums.h>
#include <utils/Log.h>
@@ -42,16 +43,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;

template <class T>
int getLastIndex() {
    auto range = ::ndk::enum_range<T>();
    auto it = range.begin();
    while (std::next(it) != range.end()) {
        it++;
    }
    return toInt(*it);
}

bool isDiagnosticProperty(int32_t prop) {
    return prop == toInt(VehicleProperty::OBD2_LIVE_FRAME) ||
           prop == toInt(VehicleProperty::OBD2_FREEZE_FRAME);
@@ -84,9 +75,10 @@ void copyMixedValueJson(const Json::Value& jsonValue, RawPropValues& dest) {
}

std::vector<uint8_t> generateDiagnosticBytes(const RawPropValues& diagnosticValue) {
    size_t lastIntegerSensorIndex =
            static_cast<size_t>(getLastIndex<DiagnosticIntegerSensorIndex>());
    size_t lastFloatSensorIndex = static_cast<size_t>(getLastIndex<DiagnosticFloatSensorIndex>());
    size_t lastIntegerSensorIndex = static_cast<size_t>(
            obd2frame::Obd2SensorStore::getLastIndex<DiagnosticIntegerSensorIndex>());
    size_t lastFloatSensorIndex = static_cast<size_t>(
            obd2frame::Obd2SensorStore::getLastIndex<DiagnosticFloatSensorIndex>());

    size_t byteSize = (lastIntegerSensorIndex + lastFloatSensorIndex + 2);
    std::vector<uint8_t> bytes((byteSize + 7) / 8);
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ cc_test {
    static_libs: [
        "VehicleHalUtils",
        "FakeVehicleHalValueGenerators",
        "FakeObd2Frame",
    ],
    shared_libs: [
        "libjsoncpp",
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ cc_library {
    static_libs: [
        "VehicleHalUtils",
        "FakeVehicleHalValueGenerators",
        "FakeObd2Frame",
        "FakeUserHal",
    ],
    shared_libs: [
        "libjsoncpp",
Loading