sensors: Run clang-format

Change-Id: Ibacd45e08fbace2dd4ff3082712d61215b539121
This commit is contained in:
Bruno Martins
2026-01-11 19:23:25 +00:00
parent 5bb09cf6fa
commit b0a11aa8b4
5 changed files with 8 additions and 12 deletions

View File

@@ -147,9 +147,9 @@ Return<void> HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _h
Return<void> HalProxy::getSensorsList(ISensorsV2_0::getSensorsList_cb _hidl_cb) {
std::vector<V1_0::SensorInfo> sensors;
for (const auto& iter : mSensors) {
if (iter.second.type != SensorType::HINGE_ANGLE) {
sensors.push_back(convertToOldSensorInfo(iter.second));
}
if (iter.second.type != SensorType::HINGE_ANGLE) {
sensors.push_back(convertToOldSensorInfo(iter.second));
}
}
_hidl_cb(sensors);
return Void();
@@ -735,8 +735,7 @@ void HalProxy::decrementRefCountAndMaybeReleaseWakelock(size_t delta,
if (!mThreadsRun.load()) return;
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
if (delta > mWakelockRefCount) {
ALOGE("Decrementing wakelock ref count by %zu when count is %zu",
delta, mWakelockRefCount);
ALOGE("Decrementing wakelock ref count by %zu when count is %zu", delta, mWakelockRefCount);
}
if (timeoutStart == -1) timeoutStart = mWakelockTimeoutResetTime;
if (mWakelockRefCount == 0 || timeoutStart < mWakelockTimeoutResetTime) return;

View File

@@ -74,8 +74,7 @@ std::vector<V2_1::Event> HalProxyCallbackBase::processEvents(const std::vector<V
}
const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
if (sensor.type == V2_1::SensorType::PICK_UP_GESTURE
&& event.u.scalar != 1) {
if (sensor.type == V2_1::SensorType::PICK_UP_GESTURE && event.u.scalar != 1) {
continue;
}

View File

@@ -16,7 +16,7 @@
#include <string.h>
#include <utils/SystemClock.h>
static const char *udfps_state_paths[] = {
static const char* udfps_state_paths[] = {
"/sys/devices/virtual/touch/tp_dev/fp_state",
"/sys/touchpanel/fp_state",
NULL,

View File

@@ -265,9 +265,7 @@ SysfsPollingOneShotSensor::~SysfsPollingOneShotSensor() {
}
void SysfsPollingOneShotSensor::writeEnable(bool enable) {
std::call_once(mEnableOpenOnce, [&] {
mEnableStream.open(mEnablePath);
});
std::call_once(mEnableOpenOnce, [&] { mEnableStream.open(mEnablePath); });
if (mEnableStream) {
mEnableStream << (enable ? '1' : '0') << std::flush;

View File

@@ -43,7 +43,7 @@ namespace implementation {
class ISensorsEventCallback {
public:
virtual ~ISensorsEventCallback(){};
virtual ~ISensorsEventCallback() {};
virtual void postEvents(const std::vector<Event>& events, bool wakeup) = 0;
};