Loading gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,10 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::sp; /* * Since Utils.cpp depends on Gnss Hal 2.0, the tests for Gnss Hal 1.0 will use * there own version of IsAutomotiveDevice() instead of the common version. */ static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); Loading Loading @@ -479,7 +483,7 @@ TEST_F(GnssHalTest, GetAllExtensions) { * Verifies that modern hardware supports measurement capabilities. */ TEST_F(GnssHalTest, MeasurementCapabilites) { if (info_called_count_ > 0 && last_info_.yearOfHw >= 2016) { if (!IsAutomotiveDevice() && info_called_count_ > 0 && last_info_.yearOfHw >= 2016) { EXPECT_TRUE(last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS); } } Loading gnss/2.0/vts/functional/gnss_hal_test_cases.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -61,6 +61,13 @@ TEST_F(GnssHalTest, TestGnssMeasurementExtension) { auto gnssMeasurement_1_0 = gnss_hal_->getExtensionGnssMeasurement(); ASSERT_TRUE(gnssMeasurement_2_0.isOk() && gnssMeasurement_1_1.isOk() && gnssMeasurement_1_0.isOk()); // CDD does not require Android Automotive OS devices to support // GnssMeasurements. if(Utils::isAutomotiveDevice()) { return; } sp<IGnssMeasurement_2_0> iGnssMeas_2_0 = gnssMeasurement_2_0; sp<IGnssMeasurement_1_1> iGnssMeas_1_1 = gnssMeasurement_1_1; sp<IGnssMeasurement_1_0> iGnssMeas_1_0 = gnssMeasurement_1_0; Loading gnss/common/utils/vts/Utils.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #include <Utils.h> #include "gtest/gtest.h" #include <cutils/properties.h> namespace android { namespace hardware { namespace gnss { Loading Loading @@ -164,6 +166,12 @@ GnssConstellationType_1_0 Utils::mapConstellationType(GnssConstellationType_2_0 } } bool Utils::isAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; } } // namespace common } // namespace gnss } // namespace hardware Loading gnss/common/utils/vts/include/Utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ struct Utils { static const MeasurementCorrections getMockMeasurementCorrections(); static GnssConstellationType_1_0 mapConstellationType(GnssConstellationType_2_0 constellation); static bool isAutomotiveDevice(); }; } // namespace common Loading gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +3 −3 File changed.Contains only whitespace changes. Show changes Loading
gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,10 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::sp; /* * Since Utils.cpp depends on Gnss Hal 2.0, the tests for Gnss Hal 1.0 will use * there own version of IsAutomotiveDevice() instead of the common version. */ static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); Loading Loading @@ -479,7 +483,7 @@ TEST_F(GnssHalTest, GetAllExtensions) { * Verifies that modern hardware supports measurement capabilities. */ TEST_F(GnssHalTest, MeasurementCapabilites) { if (info_called_count_ > 0 && last_info_.yearOfHw >= 2016) { if (!IsAutomotiveDevice() && info_called_count_ > 0 && last_info_.yearOfHw >= 2016) { EXPECT_TRUE(last_capabilities_ & IGnssCallback::Capabilities::MEASUREMENTS); } } Loading
gnss/2.0/vts/functional/gnss_hal_test_cases.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -61,6 +61,13 @@ TEST_F(GnssHalTest, TestGnssMeasurementExtension) { auto gnssMeasurement_1_0 = gnss_hal_->getExtensionGnssMeasurement(); ASSERT_TRUE(gnssMeasurement_2_0.isOk() && gnssMeasurement_1_1.isOk() && gnssMeasurement_1_0.isOk()); // CDD does not require Android Automotive OS devices to support // GnssMeasurements. if(Utils::isAutomotiveDevice()) { return; } sp<IGnssMeasurement_2_0> iGnssMeas_2_0 = gnssMeasurement_2_0; sp<IGnssMeasurement_1_1> iGnssMeas_1_1 = gnssMeasurement_1_1; sp<IGnssMeasurement_1_0> iGnssMeas_1_0 = gnssMeasurement_1_0; Loading
gnss/common/utils/vts/Utils.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #include <Utils.h> #include "gtest/gtest.h" #include <cutils/properties.h> namespace android { namespace hardware { namespace gnss { Loading Loading @@ -164,6 +166,12 @@ GnssConstellationType_1_0 Utils::mapConstellationType(GnssConstellationType_2_0 } } bool Utils::isAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; } } // namespace common } // namespace gnss } // namespace hardware Loading
gnss/common/utils/vts/include/Utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ struct Utils { static const MeasurementCorrections getMockMeasurementCorrections(); static GnssConstellationType_1_0 mapConstellationType(GnssConstellationType_2_0 constellation); static bool isAutomotiveDevice(); }; } // namespace common Loading
gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +3 −3 File changed.Contains only whitespace changes. Show changes