mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 10:44:41 +00:00
Resolve merge conflicts of cb56fbeb9d to master
Bug: None
Test: cd hardware/interfaces/gnss && mm, check artifacts built
successfully.
Change-Id: I32038aaf40b1d427b838242b7197581b7cde4efd
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
#include <cutils/properties.h>
|
||||
|
||||
using android::hardware::Return;
|
||||
using android::hardware::Void;
|
||||
|
||||
@@ -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
|
||||
@@ -473,9 +481,9 @@ TEST_P(GnssHalTest, GetAllExtensions) {
|
||||
|
||||
auto gnssDebug = gnss_hal_->getExtensionGnssDebug();
|
||||
ASSERT_TRUE(gnssDebug.isOk());
|
||||
if (info_called_count_ > 0 && last_info_.yearOfHw >= 2017) {
|
||||
sp<IGnssDebug> iGnssDebug = gnssDebug;
|
||||
EXPECT_NE(iGnssDebug, nullptr);
|
||||
if (!IsAutomotiveDevice() && info_called_count_ > 0 && last_info_.yearOfHw >= 2017) {
|
||||
sp<IGnssDebug> iGnssDebug = gnssDebug;
|
||||
EXPECT_NE(iGnssDebug, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user