diff options
author | Brian Stack <bstack@google.com> | 2018-11-01 09:05:59 -0700 |
---|---|---|
committer | Brian Stack <bstack@google.com> | 2018-11-07 17:26:01 -0800 |
commit | 9c1867eec850558e04a772cd36f9ff744a2111b9 (patch) | |
tree | 0418edc5849db18504d215d2cd9973181831932e | |
parent | 40525b145e253958af21433dadb6a0986ed95e68 (diff) | |
download | android_hardware_interfaces-9c1867eec850558e04a772cd36f9ff744a2111b9.tar.gz android_hardware_interfaces-9c1867eec850558e04a772cd36f9ff744a2111b9.tar.bz2 android_hardware_interfaces-9c1867eec850558e04a772cd36f9ff744a2111b9.zip |
Update member variables to use mNamingConvention
Bug: 115969174
Test: Builds
Change-Id: Id4334d9060a3110d13debcfaf1bebc9dddd321c5
4 files changed, 28 insertions, 28 deletions
diff --git a/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp b/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp index f8b021e00..00207b1ee 100644 --- a/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp +++ b/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp @@ -94,9 +94,9 @@ bool SensorsHidlEnvironmentV1_0::resetHal() { } void SensorsHidlEnvironmentV1_0::startPollingThread() { - stopThread = false; - pollThread = std::thread(pollingThread, this, std::ref(stopThread)); - events.reserve(128); + mStopThread = false; + mPollThread = std::thread(pollingThread, this, std::ref(mStopThread)); + mEvents.reserve(128); } void SensorsHidlEnvironmentV1_0::pollingThread(SensorsHidlEnvironmentV1_0* env, diff --git a/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp b/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp index 2fb67a69c..37b734998 100644 --- a/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp +++ b/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp @@ -95,19 +95,19 @@ bool SensorsHidlEnvironmentV2_0::resetHal() { } void SensorsHidlEnvironmentV2_0::HidlTearDown() { - stopThread = true; + mStopThread = true; // Wake up the event queue so the poll thread can exit mEventQueueFlag->wake(asBaseType(EventQueueFlagBits::READ_AND_PROCESS)); - pollThread.join(); + mPollThread.join(); EventFlag::deleteEventFlag(&mEventQueueFlag); } void SensorsHidlEnvironmentV2_0::startPollingThread() { - stopThread = false; - pollThread = std::thread(pollingThread, this); - events.reserve(MAX_RECEIVE_BUFFER_EVENT_COUNT); + mStopThread = false; + mPollThread = std::thread(pollingThread, this); + mEvents.reserve(MAX_RECEIVE_BUFFER_EVENT_COUNT); } void SensorsHidlEnvironmentV2_0::readEvents() { @@ -133,7 +133,7 @@ void SensorsHidlEnvironmentV2_0::readEvents() { void SensorsHidlEnvironmentV2_0::pollingThread(SensorsHidlEnvironmentV2_0* env) { ALOGD("polling thread start"); - while (!env->stopThread.load()) { + while (!env->mStopThread.load()) { env->readEvents(); } diff --git a/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp b/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp index d8b4ee085..affdf8b6b 100644 --- a/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp +++ b/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp @@ -19,7 +19,7 @@ void SensorsHidlEnvironmentBase::HidlSetUp() { ASSERT_TRUE(resetHal()) << "could not get hidl service"; - collectionEnabled = false; + mCollectionEnabled = false; startPollingThread(); // In case framework just stopped for test and there is sensor events in the pipe, @@ -28,27 +28,27 @@ void SensorsHidlEnvironmentBase::HidlSetUp() { } void SensorsHidlEnvironmentBase::HidlTearDown() { - stopThread = true; - pollThread.detach(); + mStopThread = true; + mPollThread.detach(); } void SensorsHidlEnvironmentBase::catEvents(std::vector<Event>* output) { - std::lock_guard<std::mutex> lock(events_mutex); + std::lock_guard<std::mutex> lock(mEventsMutex); if (output) { - output->insert(output->end(), events.begin(), events.end()); + output->insert(output->end(), mEvents.begin(), mEvents.end()); } - events.clear(); + mEvents.clear(); } void SensorsHidlEnvironmentBase::setCollection(bool enable) { - std::lock_guard<std::mutex> lock(events_mutex); - collectionEnabled = enable; + std::lock_guard<std::mutex> lock(mEventsMutex); + mCollectionEnabled = enable; } void SensorsHidlEnvironmentBase::addEvent(const Event& ev) { - std::lock_guard<std::mutex> lock(events_mutex); - if (collectionEnabled) { - events.push_back(ev); + std::lock_guard<std::mutex> lock(mEventsMutex); + if (mCollectionEnabled) { + mEvents.push_back(ev); } if (mCallback != nullptr) { @@ -57,11 +57,11 @@ void SensorsHidlEnvironmentBase::addEvent(const Event& ev) { } void SensorsHidlEnvironmentBase::registerCallback(IEventCallback* callback) { - std::lock_guard<std::mutex> lock(events_mutex); + std::lock_guard<std::mutex> lock(mEventsMutex); mCallback = callback; } void SensorsHidlEnvironmentBase::unregisterCallback() { - std::lock_guard<std::mutex> lock(events_mutex); + std::lock_guard<std::mutex> lock(mEventsMutex); mCallback = nullptr; }
\ No newline at end of file diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlEnvironmentBase.h b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlEnvironmentBase.h index 454dda483..6499fba54 100644 --- a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlEnvironmentBase.h +++ b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlEnvironmentBase.h @@ -50,18 +50,18 @@ class SensorsHidlEnvironmentBase : public ::testing::VtsHalHidlTargetTestEnvBase void unregisterCallback(); protected: - SensorsHidlEnvironmentBase() : collectionEnabled(false), mCallback(nullptr) {} + SensorsHidlEnvironmentBase() : mCollectionEnabled(false), mCallback(nullptr) {} void addEvent(const Event& ev); virtual void startPollingThread() = 0; virtual bool resetHal() = 0; - bool collectionEnabled; - std::atomic_bool stopThread; - std::thread pollThread; - std::vector<Event> events; - std::mutex events_mutex; + bool mCollectionEnabled; + std::atomic_bool mStopThread; + std::thread mPollThread; + std::vector<Event> mEvents; + std::mutex mEventsMutex; IEventCallback* mCallback; |