diff options
author | Steven Moreland <smoreland@google.com> | 2016-10-20 17:42:01 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2016-10-21 19:33:06 +0000 |
commit | 22566b891381af660c670a5385385a38fa1882af (patch) | |
tree | dfbbbcce0f96ca3521d9f00be296f9d2bcaf3b68 /memtrack/1.0 | |
parent | 00dfbca81f5700880e261debce317b932f7460fa (diff) | |
download | platform_hardware_interfaces-22566b891381af660c670a5385385a38fa1882af.tar.gz platform_hardware_interfaces-22566b891381af660c670a5385385a38fa1882af.tar.bz2 platform_hardware_interfaces-22566b891381af660c670a5385385a38fa1882af.zip |
Use defaultPassthroughServiceImplementation.
Bug: 32279541
Bug: 32282345
Test: mma
Change-Id: Ic0222963c99bea41de7637e5f20c19d7c541cb97
Diffstat (limited to 'memtrack/1.0')
-rw-r--r-- | memtrack/1.0/default/service.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/memtrack/1.0/default/service.cpp b/memtrack/1.0/default/service.cpp index 63ac6957eb..f705b157ef 100644 --- a/memtrack/1.0/default/service.cpp +++ b/memtrack/1.0/default/service.cpp @@ -15,37 +15,13 @@ */ #define LOG_TAG "android.hardware.memtrack@1.0-service" -#include <utils/Log.h> - -#include <iostream> -#include <unistd.h> #include <android/hardware/memtrack/1.0/IMemtrack.h> - -#include <hidl/IServiceManager.h> -#include <hwbinder/IPCThreadState.h> -#include <hwbinder/ProcessState.h> -#include <utils/Errors.h> -#include <utils/StrongPointer.h> - -using android::sp; - -using android::hardware::IPCThreadState; -using android::hardware::ProcessState; +#include <hidl/LegacySupport.h> using android::hardware::memtrack::V1_0::IMemtrack; +using android::hardware::defaultPassthroughServiceImplementation; int main() { - const char instance[] = "memtrack"; - android::sp<IMemtrack> service = IMemtrack::getService(instance, true); - if (service.get() == nullptr) { - ALOGE("IMemtrack::getService returned NULL, exiting"); - return -1; - } - LOG_FATAL_IF(service->isRemote(), "Implementation is REMOTE!"); - service->registerAsService(instance); - - ProcessState::self()->setThreadPoolMaxThreadCount(0); - ProcessState::self()->startThreadPool(); - IPCThreadState::self()->joinThreadPool(); + return defaultPassthroughServiceImplementation<IMemtrack>("memtrack"); } |