Skip to content

Commit

Permalink
cheeseburger: use ITouchscreenGesture from hardware/oneplus
Browse files Browse the repository at this point in the history
* Removed from msm8998-common.

Change-Id: Id7921b1298749a8d74493426202f43e30146fa6f
  • Loading branch information
trautamaki committed Sep 24, 2021
1 parent 941d190 commit d9d6c3e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
soong_namespace {
imports: ["hardware/oneplus"],
}
3 changes: 3 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ TARGET_OTA_ASSERT_DEVICE := cheeseburger,OnePlus5,oneplus5
# SELinux
BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor

# Soong
PRODUCT_SOONG_NAMESPACES += $(DEVICE_PATH)

# inherit from the proprietary version
-include vendor/oneplus/cheeseburger/BoardConfigVendor.mk
4 changes: 4 additions & 0 deletions touch/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cc_binary {
relative_install_path: "hw",
vendor: true,
srcs: [
":vendor.lineage.touch@1.0-oneplus-touchgesture",
"KeyDisabler.cpp",
"KeySwapper.cpp",
"service.cpp"
Expand All @@ -31,4 +32,7 @@ cc_binary {
"libutils",
"vendor.lineage.touch@1.0",
],
header_libs: [
"vendor.lineage.touch@1.0-oneplus-headers",
],
}
9 changes: 9 additions & 0 deletions touch/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include <touch/oneplus/TouchscreenGesture.h>

#include "KeyDisabler.h"
#include "KeySwapper.h"
Expand All @@ -29,12 +30,15 @@ using android::hardware::joinRpcThreadpool;

using ::vendor::lineage::touch::V1_0::IKeyDisabler;
using ::vendor::lineage::touch::V1_0::IKeySwapper;
using ::vendor::lineage::touch::V1_0::ITouchscreenGesture;
using ::vendor::lineage::touch::V1_0::implementation::KeyDisabler;
using ::vendor::lineage::touch::V1_0::implementation::KeySwapper;
using ::vendor::lineage::touch::V1_0::implementation::TouchscreenGesture;

int main() {
sp<IKeyDisabler> key_disabler = new KeyDisabler();
sp<IKeySwapper> key_swapper = new KeySwapper();
sp<ITouchscreenGesture> gestureService = new TouchscreenGesture();

configureRpcThreadpool(1, true /*callerWillJoin*/);

Expand All @@ -48,6 +52,11 @@ int main() {
return 1;
}

if (gestureService->registerAsService() != android::OK) {
LOG(ERROR) << "Cannot register touchscreen gesture HAL service.";
return 1;
}

LOG(INFO) << "Touch HAL service is ready.";
joinRpcThreadpool();
// Should not pass this line
Expand Down

0 comments on commit d9d6c3e

Please sign in to comment.