2 * Copyright 2020 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
7 #define LOG_TAG "AllocatorService"
9 #include <hidl/LegacySupport.h>
11 #include "cros_gralloc/gralloc4/CrosGralloc4Allocator.h"
14 using android::hardware::configureRpcThreadpool;
15 using android::hardware::joinRpcThreadpool;
16 using android::hardware::graphics::allocator::V4_0::IAllocator;
18 int main(int, char**) {
19 sp<IAllocator> allocator = new CrosGralloc4Allocator();
20 configureRpcThreadpool(4, true /* callerWillJoin */);
21 if (allocator->registerAsService() != android::NO_ERROR) {
22 ALOGE("failed to register graphics IAllocator 4.0 service");
26 ALOGI("graphics IAllocator 4.0 service is initialized");
27 android::hardware::joinRpcThreadpool();
28 ALOGI("graphics IAllocator 4.0 service is terminating");