• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 use android_hardware_broadcastradio::aidl::android::hardware::broadcastradio::{
17     AmFmRegionConfig::AmFmRegionConfig,
18     AnnouncementType::AnnouncementType,
19     ConfigFlag::ConfigFlag,
20     DabTableEntry::DabTableEntry,
21     IAnnouncementListener::IAnnouncementListener,
22     IBroadcastRadio::IBroadcastRadio,
23     ICloseHandle::ICloseHandle,
24     ITunerCallback::ITunerCallback,
25     ProgramFilter::ProgramFilter,
26     ProgramSelector::ProgramSelector,
27     Properties::Properties,
28     VendorKeyValue::VendorKeyValue,
29 };
30 use binder::{Interface, Result as BinderResult, StatusCode, Strong};
31 use std::vec::Vec;
32 
33 /// This struct is defined to implement IBroadcastRadio AIDL interface.
34 pub struct DefaultBroadcastRadioHal;
35 
36 impl Interface for DefaultBroadcastRadioHal {}
37 
38 impl IBroadcastRadio for DefaultBroadcastRadioHal {
getAmFmRegionConfig(&self, _full : bool) -> BinderResult<AmFmRegionConfig>39     fn getAmFmRegionConfig(&self, _full : bool) -> BinderResult<AmFmRegionConfig> {
40         Err(StatusCode::UNKNOWN_ERROR.into())
41     }
42 
getDabRegionConfig(&self) -> BinderResult<Vec<DabTableEntry>>43     fn getDabRegionConfig(&self) -> BinderResult<Vec<DabTableEntry>> {
44         Err(StatusCode::UNKNOWN_ERROR.into())
45     }
46 
getProperties(&self) -> BinderResult<Properties>47     fn getProperties(&self) -> BinderResult<Properties> {
48         Err(StatusCode::UNKNOWN_ERROR.into())
49     }
50 
getImage(&self, _id : i32) -> BinderResult<Vec<u8>>51     fn getImage(&self, _id : i32) -> BinderResult<Vec<u8>> {
52         Err(StatusCode::UNKNOWN_ERROR.into())
53     }
54 
setTunerCallback(&self, _callback : &Strong<dyn ITunerCallback>) -> BinderResult<()>55     fn setTunerCallback(&self, _callback : &Strong<dyn ITunerCallback>) -> BinderResult<()> {
56         Err(StatusCode::UNKNOWN_ERROR.into())
57     }
58 
unsetTunerCallback(&self) -> BinderResult<()>59     fn unsetTunerCallback(&self) -> BinderResult<()> {
60         Err(StatusCode::UNKNOWN_ERROR.into())
61     }
62 
tune(&self, _program : &ProgramSelector) -> BinderResult<()>63     fn tune(&self, _program : &ProgramSelector) -> BinderResult<()> {
64         Err(StatusCode::UNKNOWN_ERROR.into())
65     }
66 
seek(&self, _direction_up : bool, _skip_sub_channel : bool) -> BinderResult<()>67     fn seek(&self, _direction_up : bool, _skip_sub_channel : bool) -> BinderResult<()> {
68         Err(StatusCode::UNKNOWN_ERROR.into())
69     }
70 
step(&self, _direction_up : bool) -> BinderResult<()>71     fn step(&self, _direction_up : bool) -> BinderResult<()> {
72         Err(StatusCode::UNKNOWN_ERROR.into())
73     }
74 
cancel(&self) -> BinderResult<()>75     fn cancel(&self) -> BinderResult<()> {
76         Err(StatusCode::UNKNOWN_ERROR.into())
77     }
78 
startProgramListUpdates(&self, _filter : &ProgramFilter) -> BinderResult<()>79     fn startProgramListUpdates(&self, _filter : &ProgramFilter) -> BinderResult<()> {
80         Err(StatusCode::UNKNOWN_ERROR.into())
81     }
82 
stopProgramListUpdates(&self) -> BinderResult<()>83     fn stopProgramListUpdates(&self) -> BinderResult<()> {
84         Err(StatusCode::UNKNOWN_ERROR.into())
85     }
86 
isConfigFlagSet(&self, _flag : ConfigFlag) -> BinderResult<bool>87     fn isConfigFlagSet(&self, _flag : ConfigFlag) -> BinderResult<bool> {
88         Err(StatusCode::UNKNOWN_ERROR.into())
89     }
90 
setConfigFlag(&self, _flag : ConfigFlag, _value : bool) -> BinderResult<()>91     fn setConfigFlag(&self, _flag : ConfigFlag, _value : bool) -> BinderResult<()> {
92         Err(StatusCode::UNKNOWN_ERROR.into())
93     }
94 
setParameters(&self, _parameters : &[VendorKeyValue]) -> BinderResult<Vec<VendorKeyValue>>95     fn setParameters(&self, _parameters : &[VendorKeyValue]) -> BinderResult<Vec<VendorKeyValue>> {
96         Err(StatusCode::UNKNOWN_ERROR.into())
97     }
98 
getParameters(&self, _parameters : &[String]) -> BinderResult<Vec<VendorKeyValue>>99     fn getParameters(&self, _parameters : &[String]) -> BinderResult<Vec<VendorKeyValue>> {
100         Err(StatusCode::UNKNOWN_ERROR.into())
101     }
102 
registerAnnouncementListener(&self, _listener : &Strong<dyn IAnnouncementListener>, _enabled : &[AnnouncementType]) -> BinderResult<Strong<dyn ICloseHandle>>103     fn registerAnnouncementListener(&self, _listener : &Strong<dyn IAnnouncementListener>,
104             _enabled : &[AnnouncementType]) -> BinderResult<Strong<dyn ICloseHandle>> {
105         Err(StatusCode::UNKNOWN_ERROR.into())
106     }
107 }
108