You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
688 B

#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include "Memtrack.h"
#undef LOG_TAG
#define LOG_TAG "memtrack-service"
using aidl::android::hardware::memtrack::Memtrack;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<Memtrack> memtrack = ndk::SharedRefBase::make<Memtrack>();
const std::string instance = std::string() + Memtrack::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(memtrack->asBinder().get(), instance.c_str());
CHECK(status == STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // Unreachable
}