blob: a733b89a158d2401028484db8986b3d29ee0b1d8 [file] [log] [blame]
/*
* Copyright (C) 2022-2023 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "ChargingControl.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using ::aidl::vendor::lineage::health::ChargingControl;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<ChargingControl> lh = ndk::SharedRefBase::make<ChargingControl>();
const std::string instance = std::string() + ChargingControl::descriptor + "/default";
binder_status_t status = AServiceManager_addService(lh->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}