summaryrefslogtreecommitdiff
path: root/ir/service.cpp
blob: ad32be2bd538bbd6be6e5869cd43fe29ba339101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright 2016 The Android Open Source Project
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#define LOG_TAG "android.hardware.ir@1.0-service.xiaomi_sdm660"

#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "ConsumerIr.h"

using android::hardware::ir::V1_0::IConsumerIr;
using android::hardware::ir::V1_0::implementation::ConsumerIr;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;

int main() {
    android::sp<IConsumerIr> service = new ConsumerIr();

    configureRpcThreadpool(1, true /*callerWillJoin*/);

    android::status_t status = service->registerAsService();
    if (status != android::OK) {
        LOG(ERROR) << "Cannot register ConsumerIr service";
        return 1;
    }

    joinRpcThreadpool();

    return 1; // should never get here
}