| Alessandro Astone | 2c75f47 | 2021-01-30 01:33:12 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2025 The LineageOS Project |
| 3 | * SPDX-License-Identifier: Apache-2.0 |
| 4 | */ |
| 5 | |
| 6 | #define LOG_TAG "vendor.lineage.touch-service.pixel" |
| 7 | |
| 8 | #include "GloveMode.h" |
| 9 | |
| 10 | #include <android-base/logging.h> |
| 11 | #include <android/binder_manager.h> |
| 12 | #include <android/binder_process.h> |
| 13 | |
| 14 | using aidl::vendor::lineage::touch::GloveMode; |
| 15 | |
| 16 | int main() { |
| 17 | ABinderProcess_setThreadPoolMaxThreadCount(0); |
| 18 | std::shared_ptr<GloveMode> glovemode = ndk::SharedRefBase::make<GloveMode>(); |
| 19 | |
| 20 | const std::string instance = std::string(GloveMode::descriptor) + "/default"; |
| 21 | binder_status_t status = |
| 22 | AServiceManager_addService(glovemode->asBinder().get(), instance.c_str()); |
| 23 | CHECK_EQ(status, STATUS_OK) << "Failed to add service " << instance << " " << status; |
| 24 | |
| 25 | ABinderProcess_joinThreadPool(); |
| 26 | return EXIT_FAILURE; // should not reach |
| 27 | } |