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

Commit 40dcf012 authored by Patrick Berny's avatar Patrick Berny
Browse files

Resolve merge conflicts of cb56fbeb to master

Bug: None
Test: cd hardware/interfaces/gnss && mm, check artifacts built
        successfully.

Change-Id: I32038aaf40b1d427b838242b7197581b7cde4efd
parents 2801b037 cb56fbeb
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -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,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);
  }
+9 −1
Original line number Diff line number Diff line
@@ -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);