blob: 7066ae46c6c48f4f382e3b17adee563768265ad9 [file] [log] [blame]
Tomasz Wasilczyk6301e8f2021-10-18 16:53:40 -07001/*
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 "RadioConfigResponse.h"
18
19#include "commonStructs.h"
20#include "debug.h"
21#include "structs.h"
22
23#include "collections.h"
24
25#define RADIO_MODULE "ConfigResponse"
26
27namespace android::hardware::radio::compat {
28
29namespace aidl = ::aidl::android::hardware::radio::config;
30
31RadioConfigResponse::RadioConfigResponse(std::shared_ptr<aidl::IRadioConfigResponse> callback)
32 : mCallback(callback) {}
33
34Return<void> RadioConfigResponse::getSimSlotsStatusResponse(
35 const V1_0::RadioResponseInfo& info,
36 const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
37 LOG_CALL << info.serial;
38 mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
39 return {};
40};
41
42Return<void> RadioConfigResponse::getSimSlotsStatusResponse_1_2(
43 const V1_0::RadioResponseInfo& info,
44 const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
45 LOG_CALL << info.serial;
46 mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
47 return {};
48};
49
50Return<void> RadioConfigResponse::setSimSlotsMappingResponse(const V1_0::RadioResponseInfo& info) {
51 LOG_CALL << info.serial;
52 mCallback->setSimSlotsMappingResponse(toAidl(info));
53 return {};
54};
55
56Return<void> RadioConfigResponse::getPhoneCapabilityResponse(
57 const V1_0::RadioResponseInfo& info, const config::V1_1::PhoneCapability& phoneCapability) {
58 LOG_CALL << info.serial;
59 mCallback->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability));
60 return {};
61};
62
63Return<void> RadioConfigResponse::setPreferredDataModemResponse(
64 const V1_0::RadioResponseInfo& info) {
65 LOG_CALL << info.serial;
66 mCallback->setPreferredDataModemResponse(toAidl(info));
67 return {};
68};
69
70Return<void> RadioConfigResponse::setModemsConfigResponse(const V1_0::RadioResponseInfo& info) {
71 LOG_CALL << info.serial;
72 mCallback->setNumOfLiveModemsResponse(toAidl(info));
73 return {};
74};
75
76Return<void> RadioConfigResponse::getModemsConfigResponse(
77 const V1_0::RadioResponseInfo& info, const config::V1_1::ModemsConfig& modemsConfig) {
78 LOG_CALL << info.serial;
79 mCallback->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems);
80 return {};
81};
82
83Return<void> RadioConfigResponse::getHalDeviceCapabilitiesResponse(
84 const V1_6::RadioResponseInfo& info, bool modemReducedFeatureSet1) {
85 LOG_CALL << info.serial;
86 mCallback->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1);
87 return {};
88};
89
90} // namespace android::hardware::radio::compat