Update member variables to use mNamingConvention
Bug: 115969174
Test: Builds
Change-Id: Id4334d9060a3110d13debcfaf1bebc9dddd321c5
diff --git a/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp b/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp
index f8b021e..00207b1 100644
--- a/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp
+++ b/sensors/1.0/vts/functional/SensorsHidlEnvironmentV1_0.cpp
@@ -94,9 +94,9 @@
}
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 2fb67a6..37b7349 100644
--- a/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp
+++ b/sensors/2.0/vts/functional/SensorsHidlEnvironmentV2_0.cpp
@@ -95,19 +95,19 @@
}
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::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 d8b4ee0..affdf8b 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::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::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 454dda4..6499fba 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 @@
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;