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 <libradiocompat/RadioConfigIndication.h>
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 
setResponseFunction(std::shared_ptr<aidl::IRadioConfigIndication> callback)31 void RadioConfigIndication::setResponseFunction(
32         std::shared_ptr<aidl::IRadioConfigIndication> callback) {
33     mCallback = callback;
34 }
35 
indicate()36 std::shared_ptr<aidl::IRadioConfigIndication> RadioConfigIndication::indicate() {
37     return mCallback.get();
38 }
39 
simSlotsStatusChanged(V1_0::RadioIndicationType type,const hidl_vec<config::V1_0::SimSlotStatus> & slotStatus)40 Return<void> RadioConfigIndication::simSlotsStatusChanged(
41         V1_0::RadioIndicationType type, const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
42     LOG_CALL << type;
43     indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
44     return {};
45 }
46 
simSlotsStatusChanged_1_2(V1_0::RadioIndicationType type,const hidl_vec<config::V1_2::SimSlotStatus> & slotStatus)47 Return<void> RadioConfigIndication::simSlotsStatusChanged_1_2(
48         V1_0::RadioIndicationType type, const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
49     LOG_CALL << type;
50     indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
51     return {};
52 }
53 
54 }  // namespace android::hardware::radio::compat
55