Jiwen 'Steve' Cai | d9f2abe | 2018-10-20 17:03:13 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <bufferhub/BufferHubService.h> |
| 18 | #include <hidl/HidlTransportSupport.h> |
| 19 | #include <hwbinder/IPCThreadState.h> |
| 20 | #include <log/log.h> |
| 21 | |
| 22 | using android::sp; |
| 23 | using android::frameworks::bufferhub::V1_0::IBufferHub; |
| 24 | using android::frameworks::bufferhub::V1_0::implementation::BufferHubService; |
| 25 | |
| 26 | int main(int /*argc*/, char** /*argv*/) { |
| 27 | ALOGI("Bootstrap bufferhub HIDL service."); |
| 28 | |
| 29 | android::hardware::configureRpcThreadpool(/*numThreads=*/1, /*willJoin=*/true); |
| 30 | |
| 31 | sp<IBufferHub> service = new BufferHubService(); |
| 32 | LOG_ALWAYS_FATAL_IF(service->registerAsService() != android::OK, "Failed to register service"); |
| 33 | |
| 34 | android::hardware::joinRpcThreadpool(); |
| 35 | |
| 36 | return 0; |
| 37 | } |