1 /*
2  * Copyright (C) 2016 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 #ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_0_UTILS_H
17 #define ANDROID_HARDWARE_BROADCASTRADIO_V1_0_UTILS_H
18 
19 #include <android/hardware/broadcastradio/1.0/types.h>
20 #include <hardware/radio.h>
21 
22 namespace android {
23 namespace hardware {
24 namespace broadcastradio {
25 namespace V1_0 {
26 namespace implementation {
27 
28 class Utils {
29 public:
30     static const char * getClassString(Class ClassId);
31     static Result convertHalResult(int rc);
32     static void convertBandConfigFromHal(BandConfig *config,
33             const radio_hal_band_config_t *halConfig);
34     static void convertPropertiesFromHal(Properties *properties,
35             const radio_hal_properties_t *halProperties);
36     static void convertBandConfigToHal(radio_hal_band_config_t *halConfig,
37             const BandConfig *config);
38     static void convertProgramInfoFromHal(ProgramInfo *info,
39                                           radio_program_info_t *halInfo);
40     static int convertMetaDataFromHal(hidl_vec<MetaData>& metadata,
41                                        radio_metadata_t *halMetadata);
42 private:
43     static const char * sClassModuleNames[];
44 
45 };
46 
47 }  // namespace implementation
48 }  // namespace V1_0
49 }  // namespace broadcastradio
50 }  // namespace hardware
51 }  // namespace android
52 
53 #endif  // ANDROID_HARDWARE_BROADCASTRADIO_V1_0_UTILS_H
54