summaryrefslogtreecommitdiffstats
path: root/sensors/common
diff options
context:
space:
mode:
authorBrian Stack <bstack@google.com>2018-11-01 09:05:59 -0700
committerBrian Stack <bstack@google.com>2018-11-07 17:26:01 -0800
commit9c1867eec850558e04a772cd36f9ff744a2111b9 (patch)
tree0418edc5849db18504d215d2cd9973181831932e /sensors/common
parent40525b145e253958af21433dadb6a0986ed95e68 (diff)
downloadandroid_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
Diffstat (limited to 'sensors/common')
-rw-r--r--sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp26
-rw-r--r--sensors/common/vts/utils/include/sensors-vts-utils/SensorsHidlEnvironmentBase.h12
2 files changed, 19 insertions, 19 deletions
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;