summaryrefslogtreecommitdiff
path: root/graphics/allocator/2.0/default/service.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2016-10-20 17:42:01 -0700
committerSteven Moreland <smoreland@google.com>2016-10-21 19:33:06 +0000
commit22566b891381af660c670a5385385a38fa1882af (patch)
treedfbbbcce0f96ca3521d9f00be296f9d2bcaf3b68 /graphics/allocator/2.0/default/service.cpp
parent00dfbca81f5700880e261debce317b932f7460fa (diff)
Use defaultPassthroughServiceImplementation.
Bug: 32279541 Bug: 32282345 Test: mma Change-Id: Ic0222963c99bea41de7637e5f20c19d7c541cb97
Diffstat (limited to 'graphics/allocator/2.0/default/service.cpp')
-rw-r--r--graphics/allocator/2.0/default/service.cpp35
1 files changed, 6 insertions, 29 deletions
diff --git a/graphics/allocator/2.0/default/service.cpp b/graphics/allocator/2.0/default/service.cpp
index fd89aa8054..525b342af8 100644
--- a/graphics/allocator/2.0/default/service.cpp
+++ b/graphics/allocator/2.0/default/service.cpp
@@ -14,38 +14,15 @@
* limitations under the License.
*/
-#define LOG_TAG "GrallocService"
+#define LOG_TAG "android.hardware.graphics.allocator@2.0-service"
#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
-#include <hwbinder/IPCThreadState.h>
-#include <hwbinder/ProcessState.h>
-#include <utils/StrongPointer.h>
-using android::sp;
-using android::hardware::IPCThreadState;
-using android::hardware::ProcessState;
-using android::hardware::graphics::allocator::V2_0::IAllocator;
-
-int main()
-{
- const char instance[] = "gralloc";
-
- ALOGI("Service is starting.");
-
- sp<IAllocator> service = IAllocator::getService(instance,
- true /* getStub */);
- if (service == nullptr) {
- ALOGI("getService returned NULL");
- return -1;
- }
+#include <hidl/LegacySupport.h>
- LOG_FATAL_IF(service->isRemote(), "Service is REMOTE!");
-
- service->registerAsService(instance);
-
- ProcessState::self()->setThreadPoolMaxThreadCount(0);
- ProcessState::self()->startThreadPool();
- IPCThreadState::self()->joinThreadPool();
+using android::hardware::graphics::allocator::V2_0::IAllocator;
+using android::hardware::defaultPassthroughServiceImplementation;
- return 0;
+int main() {
+ return defaultPassthroughServiceImplementation<IAllocator>("gralloc");
}