mirror of
https://github.com/Evolution-X-Devices/device_oplus_mt6893-common
synced 2026-02-01 10:53:39 +00:00
Signed-off-by: Himanshu Tyagi <himanshut567@gmail.com> Change-Id: I21b18db6621d5ed56abf32d63eb19be97d463b5b
26 lines
726 B
C++
26 lines
726 B
C++
/*
|
|
* Copyright (C) 2022 The LineageOS Project
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include "Vibrator.h"
|
|
|
|
#include <android/binder_manager.h>
|
|
#include <android/binder_process.h>
|
|
#include <android-base/logging.h>
|
|
|
|
using ::aidl::android::hardware::vibrator::Vibrator;
|
|
|
|
int main() {
|
|
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
|
std::shared_ptr<Vibrator> vibrator = ndk::SharedRefBase::make<Vibrator>();
|
|
|
|
const std::string instance = std::string() + Vibrator::descriptor + "/default";
|
|
binder_status_t status = AServiceManager_addService(vibrator->asBinder().get(), instance.c_str());
|
|
CHECK(status == STATUS_OK);
|
|
|
|
ABinderProcess_joinThreadPool();
|
|
return EXIT_FAILURE; // should not reach
|
|
}
|