summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Altensen <info@stricted.net>2019-07-20 01:00:46 +0200
committerPaul Keith <javelinanddart@gmail.com>2019-07-21 05:24:12 +0200
commit6f3af5aed83622017fdcb7c30389c41ecc29710d (patch)
treeb96f7a6dab9908504cae36ee504650ead61d871e
parent53afa330782194eac21ff6c8fea922024c2784b8 (diff)
downloadandroid_hardware_samsung-6f3af5aed83622017fdcb7c30389c41ecc29710d.tar.gz
android_hardware_samsung-6f3af5aed83622017fdcb7c30389c41ecc29710d.tar.bz2
android_hardware_samsung-6f3af5aed83622017fdcb7c30389c41ecc29710d.zip
lineagehw: hidl: touch: run clang-format
Change-Id: If7126936fc4e0804c29061c7ecc706228654af15
-rw-r--r--lineagehw/hidl/touch/.clang-format11
-rw-r--r--lineagehw/hidl/touch/GloveMode.cpp6
-rw-r--r--lineagehw/hidl/touch/GloveMode.h3
-rw-r--r--lineagehw/hidl/touch/KeyDisabler.h3
-rw-r--r--lineagehw/hidl/touch/StylusMode.cpp6
-rw-r--r--lineagehw/hidl/touch/StylusMode.h3
-rw-r--r--lineagehw/hidl/touch/TouchscreenGesture.cpp6
-rw-r--r--lineagehw/hidl/touch/TouchscreenGesture.h3
-rw-r--r--lineagehw/hidl/touch/service.cpp22
9 files changed, 31 insertions, 32 deletions
diff --git a/lineagehw/hidl/touch/.clang-format b/lineagehw/hidl/touch/.clang-format
new file mode 100644
index 0000000..ae4a451
--- /dev/null
+++ b/lineagehw/hidl/touch/.clang-format
@@ -0,0 +1,11 @@
+BasedOnStyle: Google
+AccessModifierOffset: -2
+AllowShortFunctionsOnASingleLine: Inline
+ColumnLimit: 100
+CommentPragmas: NOLINT:.*
+DerivePointerAlignment: false
+IndentWidth: 4
+PointerAlignment: Left
+TabWidth: 4
+UseTab: Never
+PenaltyExcessCharacter: 32
diff --git a/lineagehw/hidl/touch/GloveMode.cpp b/lineagehw/hidl/touch/GloveMode.cpp
index dcac846..f059b61 100644
--- a/lineagehw/hidl/touch/GloveMode.cpp
+++ b/lineagehw/hidl/touch/GloveMode.cpp
@@ -29,8 +29,7 @@ bool GloveMode::isSupported() {
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();
}
@@ -43,8 +42,7 @@ Return<bool> GloveMode::isEnabled() {
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;
diff --git a/lineagehw/hidl/touch/GloveMode.h b/lineagehw/hidl/touch/GloveMode.h
index 7208a8d..25489bc 100644
--- a/lineagehw/hidl/touch/GloveMode.h
+++ b/lineagehw/hidl/touch/GloveMode.h
@@ -17,9 +17,9 @@
#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 {
@@ -46,7 +46,6 @@ class GloveMode : public IGloveMode {
Return<bool> setEnabled(bool enabled) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
-
};
} // namespace samsung
diff --git a/lineagehw/hidl/touch/KeyDisabler.h b/lineagehw/hidl/touch/KeyDisabler.h
index 3b56b46..9cab414 100644
--- a/lineagehw/hidl/touch/KeyDisabler.h
+++ b/lineagehw/hidl/touch/KeyDisabler.h
@@ -17,9 +17,9 @@
#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 {
@@ -46,7 +46,6 @@ class KeyDisabler : public IKeyDisabler {
Return<bool> setEnabled(bool enabled) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
-
};
} // namespace samsung
diff --git a/lineagehw/hidl/touch/StylusMode.cpp b/lineagehw/hidl/touch/StylusMode.cpp
index aa86e7a..e3190db 100644
--- a/lineagehw/hidl/touch/StylusMode.cpp
+++ b/lineagehw/hidl/touch/StylusMode.cpp
@@ -29,8 +29,7 @@ bool StylusMode::isSupported() {
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();
}
@@ -43,8 +42,7 @@ Return<bool> StylusMode::isEnabled() {
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;
diff --git a/lineagehw/hidl/touch/StylusMode.h b/lineagehw/hidl/touch/StylusMode.h
index 2eae6c8..6226ca5 100644
--- a/lineagehw/hidl/touch/StylusMode.h
+++ b/lineagehw/hidl/touch/StylusMode.h
@@ -17,9 +17,9 @@
#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 {
@@ -46,7 +46,6 @@ class StylusMode : public IStylusMode {
Return<bool> setEnabled(bool enabled) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.
-
};
} // namespace samsung
diff --git a/lineagehw/hidl/touch/TouchscreenGesture.cpp b/lineagehw/hidl/touch/TouchscreenGesture.cpp
index 1f47115..c0091a6 100644
--- a/lineagehw/hidl/touch/TouchscreenGesture.cpp
+++ b/lineagehw/hidl/touch/TouchscreenGesture.cpp
@@ -27,14 +27,15 @@ 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();
@@ -57,7 +58,7 @@ Return<bool> TouchscreenGesture::setGestureEnabled(
std::fstream file(kGeasturePath);
int gestureMode;
int mask = 1 << gesture.id;
-
+
file >> gestureMode;
if (enabled)
@@ -70,7 +71,6 @@ Return<bool> TouchscreenGesture::setGestureEnabled(
return !file.fail();
}
-
// Methods from ::android::hidl::base::V1_0::IBase follow.
} // namespace samsung
diff --git a/lineagehw/hidl/touch/TouchscreenGesture.h b/lineagehw/hidl/touch/TouchscreenGesture.h
index c1d7c70..35517f1 100644
--- a/lineagehw/hidl/touch/TouchscreenGesture.h
+++ b/lineagehw/hidl/touch/TouchscreenGesture.h
@@ -17,9 +17,9 @@
#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 {
@@ -50,7 +50,6 @@ class TouchscreenGesture : public ITouchscreenGesture {
const char* name;
} GestureInfo;
static const std::map<int32_t, GestureInfo> kGestureInfoMap; // id -> info
-
};
// FIXME: most likely delete, this is only for passthrough implementations
diff --git a/lineagehw/hidl/touch/service.cpp b/lineagehw/hidl/touch/service.cpp
index 1bdc66f..e12326c 100644
--- a/lineagehw/hidl/touch/service.cpp
+++ b/lineagehw/hidl/touch/service.cpp
@@ -74,9 +74,8 @@ int main() {
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;
}
}
@@ -84,9 +83,8 @@ int main() {
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;
}
}
@@ -94,9 +92,8 @@ int main() {
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;
}
}
@@ -104,16 +101,15 @@ int main() {
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