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 | |
Tomasz Wasilczyk | 6902a75 | 2021-12-13 17:13:48 -0800 | [diff] [blame^] | 17 | #include <libradiocompat/RadioConfigIndication.h> |
Tomasz Wasilczyk | 6301e8f | 2021-10-18 16:53:40 -0700 | [diff] [blame] | 18 | |
| 19 | #include "commonStructs.h" |
| 20 | #include "debug.h" |
| 21 | #include "structs.h" |
| 22 | |
| 23 | #include "collections.h" |
| 24 | |
| 25 | #define RADIO_MODULE "ConfigIndication" |
| 26 | |
| 27 | namespace android::hardware::radio::compat { |
| 28 | |
| 29 | namespace aidl = ::aidl::android::hardware::radio::config; |
| 30 | |
Tomasz Wasilczyk | 6902a75 | 2021-12-13 17:13:48 -0800 | [diff] [blame^] | 31 | void RadioConfigIndication::setResponseFunction( |
| 32 | std::shared_ptr<aidl::IRadioConfigIndication> callback) { |
| 33 | mCallback = callback; |
| 34 | } |
| 35 | |
| 36 | std::shared_ptr<aidl::IRadioConfigIndication> RadioConfigIndication::indicate() { |
| 37 | return mCallback.get(); |
| 38 | } |
Tomasz Wasilczyk | 6301e8f | 2021-10-18 16:53:40 -0700 | [diff] [blame] | 39 | |
| 40 | Return<void> RadioConfigIndication::simSlotsStatusChanged( |
| 41 | V1_0::RadioIndicationType type, const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) { |
| 42 | LOG_CALL << type; |
Tomasz Wasilczyk | 6902a75 | 2021-12-13 17:13:48 -0800 | [diff] [blame^] | 43 | indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); |
Tomasz Wasilczyk | 6301e8f | 2021-10-18 16:53:40 -0700 | [diff] [blame] | 44 | return {}; |
| 45 | } |
| 46 | |
| 47 | Return<void> RadioConfigIndication::simSlotsStatusChanged_1_2( |
| 48 | V1_0::RadioIndicationType type, const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) { |
| 49 | LOG_CALL << type; |
Tomasz Wasilczyk | 6902a75 | 2021-12-13 17:13:48 -0800 | [diff] [blame^] | 50 | indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); |
Tomasz Wasilczyk | 6301e8f | 2021-10-18 16:53:40 -0700 | [diff] [blame] | 51 | return {}; |
| 52 | } |
| 53 | |
| 54 | } // namespace android::hardware::radio::compat |