Loading gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ #include <condition_variable> #include <mutex> #include <cutils/properties.h> using android::hardware::Return; using android::hardware::Void; Loading @@ -37,6 +39,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::sp; static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; } #define TIMEOUT_SEC 2 // for basic commands/responses // for command line argument on how strictly to run the test Loading Loading @@ -473,7 +481,7 @@ TEST_P(GnssHalTest, GetAllExtensions) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); if (info_called_count_ > 0 && last_info_.yearOfHw >= 2017) { if (!IsAutomotiveDevice() && info_called_count_ > 0 && last_info_.yearOfHw >= 2017) { sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); } Loading gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <gnss_hal_test.h> #include <android/hardware/gnss/1.1/IGnssConfiguration.h> #include <cutils/properties.h> #include <gtest/gtest.h> using android::hardware::hidl_vec; Loading @@ -32,6 +33,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_1::IGnssConfiguration; using android::hardware::gnss::V1_1::IGnssMeasurement; static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; } /* * SetupTeardownCreateCleanup: * Requests the gnss HAL then calls cleanup Loading Loading @@ -524,7 +531,8 @@ TEST_P(GnssHalTest, InjectBestLocation) { TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); if (gnss_cb_->info_cbq_.calledCount() > 0 && gnss_cb_->last_info_.yearOfHw >= 2017) { if (!IsAutomotiveDevice() && gnss_cb_->info_cbq_.calledCount() > 0 && gnss_cb_->last_info_.yearOfHw >= 2017) { sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); Loading Loading
gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ #include <condition_variable> #include <mutex> #include <cutils/properties.h> using android::hardware::Return; using android::hardware::Void; Loading @@ -37,6 +39,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::sp; static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; } #define TIMEOUT_SEC 2 // for basic commands/responses // for command line argument on how strictly to run the test Loading Loading @@ -473,7 +481,7 @@ TEST_P(GnssHalTest, GetAllExtensions) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); if (info_called_count_ > 0 && last_info_.yearOfHw >= 2017) { if (!IsAutomotiveDevice() && info_called_count_ > 0 && last_info_.yearOfHw >= 2017) { sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); } Loading
gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <gnss_hal_test.h> #include <android/hardware/gnss/1.1/IGnssConfiguration.h> #include <cutils/properties.h> #include <gtest/gtest.h> using android::hardware::hidl_vec; Loading @@ -32,6 +33,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_1::IGnssConfiguration; using android::hardware::gnss::V1_1::IGnssMeasurement; static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; property_get("ro.hardware.type", buffer, ""); return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; } /* * SetupTeardownCreateCleanup: * Requests the gnss HAL then calls cleanup Loading Loading @@ -524,7 +531,8 @@ TEST_P(GnssHalTest, InjectBestLocation) { TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); if (gnss_cb_->info_cbq_.calledCount() > 0 && gnss_cb_->last_info_.yearOfHw >= 2017) { if (!IsAutomotiveDevice() && gnss_cb_->info_cbq_.calledCount() > 0 && gnss_cb_->last_info_.yearOfHw >= 2017) { sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); Loading