blob: bda2f71371d3cf7f76fcac73818a257f5e2b39da [file] [log] [blame]
shubang23aa3ac2020-09-07 18:56:28 -07001/*
Hongguangeae68392021-07-27 20:56:23 -07002 * Copyright (C) 2021 The Android Open Source Project
shubang23aa3ac2020-09-07 18:56:28 -07003 *
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
Hongguangeae68392021-07-27 20:56:23 -070017#include <android-base/logging.h>
shubang23aa3ac2020-09-07 18:56:28 -070018#include <binder/IPCThreadState.h>
19#include <binder/IServiceManager.h>
Hongguangeae68392021-07-27 20:56:23 -070020#include <utils/Log.h>
shubang23aa3ac2020-09-07 18:56:28 -070021
22#include "TunerService.h"
23
Hongguangeae68392021-07-27 20:56:23 -070024using ::aidl::android::media::tv::tuner::TunerService;
25
shubang23aa3ac2020-09-07 18:56:28 -070026using namespace android;
27
Hongguangeae68392021-07-27 20:56:23 -070028int main() {
shubang23aa3ac2020-09-07 18:56:28 -070029 ALOGD("Tuner service starting");
30
shubang23aa3ac2020-09-07 18:56:28 -070031 sp<ProcessState> proc(ProcessState::self());
32 sp<IServiceManager> sm = defaultServiceManager();
shubang23aa3ac2020-09-07 18:56:28 -070033
Amy Zhangb1baabb2021-02-08 19:54:28 -080034 binder_status_t status = TunerService::instantiate();
Hongguangeae68392021-07-27 20:56:23 -070035 CHECK(status == STATUS_OK);
shubang23aa3ac2020-09-07 18:56:28 -070036
37 ProcessState::self()->startThreadPool();
38 IPCThreadState::self()->joinThreadPool();
Hongguangeae68392021-07-27 20:56:23 -070039 return EXIT_FAILURE; // should not reached
shubang23aa3ac2020-09-07 18:56:28 -070040}