Tomasz Wasilczyk | 6301e8f | 2021-10-18 16:53:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 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 | |
| 17 | #include "commonStructs.h" |
| 18 | |
| 19 | namespace android::hardware::radio::compat { |
| 20 | |
| 21 | namespace aidl = ::aidl::android::hardware::radio; |
| 22 | |
| 23 | V1_6::RadioResponseInfo notSupported(int32_t serial) { |
| 24 | return { |
| 25 | .type = V1_0::RadioResponseType::SOLICITED, |
| 26 | .serial = serial, |
| 27 | .error = V1_6::RadioError::REQUEST_NOT_SUPPORTED, |
| 28 | }; |
| 29 | } |
| 30 | |
| 31 | aidl::RadioIndicationType toAidl(V1_0::RadioIndicationType type) { |
| 32 | return aidl::RadioIndicationType(type); |
| 33 | } |
| 34 | |
| 35 | aidl::RadioResponseType toAidl(V1_0::RadioResponseType type) { |
| 36 | return aidl::RadioResponseType(type); |
| 37 | } |
| 38 | |
| 39 | aidl::RadioError toAidl(V1_0::RadioError err) { |
| 40 | return aidl::RadioError(err); |
| 41 | } |
| 42 | |
| 43 | aidl::RadioError toAidl(V1_6::RadioError err) { |
| 44 | return aidl::RadioError(err); |
| 45 | } |
| 46 | |
| 47 | aidl::RadioResponseInfo toAidl(const V1_0::RadioResponseInfo& info) { |
| 48 | return { |
| 49 | .type = toAidl(info.type), |
| 50 | .serial = info.serial, |
| 51 | .error = toAidl(info.error), |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | aidl::RadioResponseInfo toAidl(const V1_6::RadioResponseInfo& info) { |
| 56 | return { |
| 57 | .type = toAidl(info.type), |
| 58 | .serial = info.serial, |
| 59 | .error = toAidl(info.error), |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | } // namespace android::hardware::radio::compat |