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

Commit e51ea5f4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rename SensorsHidlEnvironmentBase to SensorsVtsEnvironmentBase"

parents d83f0e31 7040ab26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ using ::android::hardware::sensors::V1_0::ISensors;
using ::android::hardware::sensors::V1_0::Result;
using ::android::hardware::sensors::V1_0::SensorInfo;

void SensorsHidlEnvironmentV1_0::HidlTearDown() {
void SensorsHidlEnvironmentV1_0::TearDown() {
    mStopThread = true;
    if (mPollThread.joinable()) {
        mPollThread.detach();
+4 −4
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#ifndef ANDROID_SENSORS_HIDL_ENVIRONMENT_V1_0_H
#define ANDROID_SENSORS_HIDL_ENVIRONMENT_V1_0_H

#include "sensors-vts-utils/SensorsHidlEnvironmentBase.h"
#include "sensors-vts-utils/SensorsVtsEnvironmentBase.h"

#include <android/hardware/sensors/1.0/ISensors.h>
#include <android/hardware/sensors/1.0/types.h>
@@ -30,13 +30,13 @@ using ::android::sp;

class SensorsHidlTest;
class SensorsHidlEnvironmentV1_0
    : public SensorsHidlEnvironmentBase<::android::hardware::sensors::V1_0::Event> {
    : public SensorsVtsEnvironmentBase<::android::hardware::sensors::V1_0::Event> {
  public:
    void HidlTearDown() override;
    void TearDown() override;

    using Event = ::android::hardware::sensors::V1_0::Event;
    SensorsHidlEnvironmentV1_0(const std::string& service_name)
        : SensorsHidlEnvironmentBase(service_name) {}
        : SensorsVtsEnvironmentBase(service_name) {}

  private:
    friend SensorsHidlTest;
+3 −3
Original line number Diff line number Diff line
@@ -39,12 +39,12 @@ class SensorsHidlTest : public SensorsHidlTestBase<SensorType, Event, SensorInfo
  public:
    virtual void SetUp() override {
        mEnvironment = new SensorsHidlEnvironmentV1_0(GetParam());
        mEnvironment->HidlSetUp();
        mEnvironment->SetUp();
        // Ensure that we have a valid environment before performing tests
        ASSERT_NE(S(), nullptr);
    }

    virtual void TearDown() override { mEnvironment->HidlTearDown(); }
    virtual void TearDown() override { mEnvironment->TearDown(); }

  protected:
    SensorInfo defaultSensorByType(SensorType type) override;
@@ -81,7 +81,7 @@ class SensorsHidlTest : public SensorsHidlTestBase<SensorType, Event, SensorInfo

    inline sp<ISensors>& S() { return mEnvironment->sensors; }

    SensorsHidlEnvironmentBase<Event>* getEnvironment() override { return mEnvironment; }
    SensorsVtsEnvironmentBase<Event>* getEnvironment() override { return mEnvironment; }

  private:
    // Test environment for sensors HAL.
+2 −2
Original line number Diff line number Diff line
@@ -256,8 +256,8 @@ TEST_P(SensorsHidlTest, CleanupDirectConnectionOnInitialize) {
    // Clear the active direct connections so they are not stopped during TearDown
    auto handles = mDirectChannelHandles;
    mDirectChannelHandles.clear();
    getEnvironment()->HidlTearDown();
    getEnvironment()->HidlSetUp();
    getEnvironment()->TearDown();
    getEnvironment()->SetUp();
    if (HasFatalFailure()) {
        return;  // Exit early if resetting the environment failed
    }
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ bool SensorsHidlEnvironmentV2_X::resetHal() {
    return succeed;
}

void SensorsHidlEnvironmentV2_X::HidlTearDown() {
void SensorsHidlEnvironmentV2_X::TearDown() {
    mStopThread = true;

    if (mEventQueueFlag != nullptr) {
Loading