diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..5661877 --- /dev/null +++ b/Android.bp @@ -0,0 +1,3 @@ +soong_namespace { + imports: ["hardware/oneplus"], +} diff --git a/BoardConfig.mk b/BoardConfig.mk index 4a1789c..835847c 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -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 diff --git a/touch/Android.bp b/touch/Android.bp index 6347618..92b62aa 100644 --- a/touch/Android.bp +++ b/touch/Android.bp @@ -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" @@ -31,4 +32,7 @@ cc_binary { "libutils", "vendor.lineage.touch@1.0", ], + header_libs: [ + "vendor.lineage.touch@1.0-oneplus-headers", + ], } diff --git a/touch/service.cpp b/touch/service.cpp index 18fb00d..de5c70c 100644 --- a/touch/service.cpp +++ b/touch/service.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "KeyDisabler.h" #include "KeySwapper.h" @@ -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 key_disabler = new KeyDisabler(); sp key_swapper = new KeySwapper(); + sp gestureService = new TouchscreenGesture(); configureRpcThreadpool(1, true /*callerWillJoin*/); @@ -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