Loading gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +11 −3 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <condition_variable> #include <condition_variable> #include <mutex> #include <mutex> #include <cutils/properties.h> using android::hardware::Return; using android::hardware::Return; using android::hardware::Void; using android::hardware::Void; Loading @@ -36,6 +38,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::sp; 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 #define TIMEOUT_SEC 2 // for basic commands/responses // for command line argument on how strictly to run the test // for command line argument on how strictly to run the test Loading Loading @@ -460,7 +468,7 @@ TEST_F(GnssHalTest, GetAllExtensions) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); 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; sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); EXPECT_NE(iGnssDebug, nullptr); } } Loading gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +8 −1 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <VtsHalHidlTargetTestBase.h> #include <VtsHalHidlTargetTestBase.h> #include <android/hardware/gnss/1.1/IGnssConfiguration.h> #include <android/hardware/gnss/1.1/IGnssConfiguration.h> #include <cutils/properties.h> using android::hardware::hidl_vec; using android::hardware::hidl_vec; Loading @@ -33,6 +34,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_1::IGnssConfiguration; using android::hardware::gnss::V1_1::IGnssConfiguration; using android::hardware::gnss::V1_1::IGnssMeasurement; 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: * SetupTeardownCreateCleanup: * Requests the gnss HAL then calls cleanup * Requests the gnss HAL then calls cleanup Loading Loading @@ -447,7 +454,7 @@ TEST_F(GnssHalTest, InjectBestLocation) { TEST_F(GnssHalTest, GnssDebugValuesSanityTest) { TEST_F(GnssHalTest, GnssDebugValuesSanityTest) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); 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; sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); EXPECT_NE(iGnssDebug, nullptr); Loading Loading
gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +11 −3 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <condition_variable> #include <condition_variable> #include <mutex> #include <mutex> #include <cutils/properties.h> using android::hardware::Return; using android::hardware::Return; using android::hardware::Void; using android::hardware::Void; Loading @@ -36,6 +38,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::hardware::gnss::V1_0::IGnssMeasurement; using android::sp; 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 #define TIMEOUT_SEC 2 // for basic commands/responses // for command line argument on how strictly to run the test // for command line argument on how strictly to run the test Loading Loading @@ -460,7 +468,7 @@ TEST_F(GnssHalTest, GetAllExtensions) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); 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; sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); EXPECT_NE(iGnssDebug, nullptr); } } Loading
gnss/1.1/vts/functional/gnss_hal_test_cases.cpp +8 −1 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <VtsHalHidlTargetTestBase.h> #include <VtsHalHidlTargetTestBase.h> #include <android/hardware/gnss/1.1/IGnssConfiguration.h> #include <android/hardware/gnss/1.1/IGnssConfiguration.h> #include <cutils/properties.h> using android::hardware::hidl_vec; using android::hardware::hidl_vec; Loading @@ -33,6 +34,12 @@ using android::hardware::gnss::V1_0::IGnssDebug; using android::hardware::gnss::V1_1::IGnssConfiguration; using android::hardware::gnss::V1_1::IGnssConfiguration; using android::hardware::gnss::V1_1::IGnssMeasurement; 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: * SetupTeardownCreateCleanup: * Requests the gnss HAL then calls cleanup * Requests the gnss HAL then calls cleanup Loading Loading @@ -447,7 +454,7 @@ TEST_F(GnssHalTest, InjectBestLocation) { TEST_F(GnssHalTest, GnssDebugValuesSanityTest) { TEST_F(GnssHalTest, GnssDebugValuesSanityTest) { auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); auto gnssDebug = gnss_hal_->getExtensionGnssDebug(); ASSERT_TRUE(gnssDebug.isOk()); 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; sp<IGnssDebug> iGnssDebug = gnssDebug; EXPECT_NE(iGnssDebug, nullptr); EXPECT_NE(iGnssDebug, nullptr); Loading