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.
22 lines
687 B
22 lines
687 B
#include <Memtrack.h>
|
|
#include <android-base/logging.h>
|
|
#include <android/binder_manager.h>
|
|
#include <android/binder_process.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
|
|
}
|
|
|