blob: f0cccb439ca4167075145c06a98839484b1cbbe7 [file] [log] [blame]
Haofan Wange02b8092024-10-28 21:47:27 +00001/*
2 * Copyright (C) 2024 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//! This implements the MediaQuality Example Service.
17use android_hardware_tv_mediaquality::aidl::android::hardware::tv::mediaquality::IMediaQuality::{BnMediaQuality, IMediaQuality};
18use binder::BinderFeatures;
19
20mod hal;
21use hal::media_quality_hal_impl::MediaQualityService;
22
23const LOG_TAG: &str = "mediaquality_service_example_rust";
24
25use log::LevelFilter;
26
27fn main() {
28
29 android_logger::init_once(
30 android_logger::Config::default()
31 .with_tag(LOG_TAG)
32 .with_max_level(LevelFilter::Info),
33 );
34
35 let media_quality_service = MediaQualityService::new();
36 let media_quality_service_binder = BnMediaQuality::new_binder(media_quality_service, BinderFeatures::default());
37
38 let service_name = format!("{}/default", MediaQualityService::get_descriptor());
39 binder::add_service(&service_name, media_quality_service_binder.as_binder())
40 .expect("Failed to register service");
41
42 log::info!("MediaQualityHal service is running...");
43
44 binder::ProcessState::join_thread_pool();
45}