--- /dev/null
+BasedOnStyle: Google
+AccessModifierOffset: -2
+AllowShortFunctionsOnASingleLine: Inline
+ColumnLimit: 100
+CommentPragmas: NOLINT:.*
+DerivePointerAlignment: false
+IndentWidth: 4
+PointerAlignment: Left
+TabWidth: 4
+UseTab: Never
+PenaltyExcessCharacter: 32
if (file.is_open()) {
std::string line;
while (getline(file, line)) {
- if (!line.compare("glove_mode"))
- return true;
+ if (!line.compare("glove_mode")) return true;
}
file.close();
}
if (file.is_open()) {
std::string line;
getline(file, line);
- if (!line.compare("glove_mode,1:OK"))
- return true;
+ if (!line.compare("glove_mode,1:OK")) return true;
file.close();
}
return false;
#ifndef VENDOR_LINEAGE_TOUCH_V1_0_GLOVEMODE_H
#define VENDOR_LINEAGE_TOUCH_V1_0_GLOVEMODE_H
-#include <vendor/lineage/touch/1.0/IGloveMode.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+#include <vendor/lineage/touch/1.0/IGloveMode.h>
namespace vendor {
namespace lineage {
Return<bool> setEnabled(bool enabled) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
-
};
} // namespace samsung
#ifndef VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H
#define VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H
-#include <vendor/lineage/touch/1.0/IKeyDisabler.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+#include <vendor/lineage/touch/1.0/IKeyDisabler.h>
namespace vendor {
namespace lineage {
Return<bool> setEnabled(bool enabled) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
-
};
} // namespace samsung
if (file.is_open()) {
std::string line;
while (getline(file, line)) {
- if (!line.compare("hover_enable"))
- return true;
+ if (!line.compare("hover_enable")) return true;
}
file.close();
}
if (file.is_open()) {
std::string line;
getline(file, line);
- if (!line.compare("hover_enable,1:OK"))
- return true;
+ if (!line.compare("hover_enable,1:OK")) return true;
file.close();
}
return false;
#ifndef VENDOR_LINEAGE_TOUCH_V1_0_STYLUSMODE_H
#define VENDOR_LINEAGE_TOUCH_V1_0_STYLUSMODE_H
-#include <vendor/lineage/touch/1.0/IStylusMode.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+#include <vendor/lineage/touch/1.0/IStylusMode.h>
namespace vendor {
namespace lineage {
Return<bool> setEnabled(bool enabled) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
-
};
} // namespace samsung
static constexpr const char* kGeasturePath = "/sys/class/sec/sec_epen/epen_gestures";
const std::map<int32_t, TouchscreenGesture::GestureInfo> TouchscreenGesture::kGestureInfoMap = {
+ // clang-format off
{0, {0x2f1, "Swipe up stylus"}},
{1, {0x2f2, "Swipe down stylus"}},
{2, {0x2f3, "Swipe left stylus"}},
{3, {0x2f4, "Swipe right stylus"}},
{4, {0x2f5, "Long press stylus"}},
+ // clang-format on
};
-
bool TouchscreenGesture::isSupported() {
std::ifstream file(kGeasturePath);
return file.good();
std::fstream file(kGeasturePath);
int gestureMode;
int mask = 1 << gesture.id;
-
+
file >> gestureMode;
if (enabled)
return !file.fail();
}
-
// Methods from ::android::hidl::base::V1_0::IBase follow.
} // namespace samsung
#ifndef VENDOR_LINEAGE_TOUCH_V1_0_TOUCHSCREENGESTURE_H
#define VENDOR_LINEAGE_TOUCH_V1_0_TOUCHSCREENGESTURE_H
-#include <vendor/lineage/touch/1.0/ITouchscreenGesture.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+#include <vendor/lineage/touch/1.0/ITouchscreenGesture.h>
namespace vendor {
namespace lineage {
const char* name;
} GestureInfo;
static const std::map<int32_t, GestureInfo> kGestureInfoMap; // id -> info
-
};
// FIXME: most likely delete, this is only for passthrough implementations
if (gloveMode->isSupported()) {
status = gloveMode->registerAsService();
if (status != OK) {
- LOG(ERROR)
- << "Could not register service for Touch HAL GloveMode Iface ("
- << status << ")";
+ LOG(ERROR) << "Could not register service for Touch HAL GloveMode Iface (" << status
+ << ")";
goto shutdown;
}
}
if (keyDisabler->isSupported()) {
status = keyDisabler->registerAsService();
if (status != OK) {
- LOG(ERROR)
- << "Could not register service for Touch HAL KeyDisabler Iface ("
- << status << ")";
+ LOG(ERROR) << "Could not register service for Touch HAL KeyDisabler Iface (" << status
+ << ")";
goto shutdown;
}
}
if (stylusMode->isSupported()) {
status = stylusMode->registerAsService();
if (status != OK) {
- LOG(ERROR)
- << "Could not register service for Touch HAL StylusMode Iface ("
- << status << ")";
+ LOG(ERROR) << "Could not register service for Touch HAL StylusMode Iface (" << status
+ << ")";
goto shutdown;
}
}
if (touchscreenGesture->isSupported()) {
status = touchscreenGesture->registerAsService();
if (status != OK) {
- LOG(ERROR)
- << "Could not register service for Touch HAL TouchscreenGesture Iface ("
- << status << ")";
+ LOG(ERROR) << "Could not register service for Touch HAL TouchscreenGesture Iface ("
+ << status << ")";
goto shutdown;
}
}
LOG(INFO) << "Touch HAL service is ready.";
joinRpcThreadpool();
- // Should not pass this line
+// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown