blob: dccbd0e9c5ade9a8be8b6cd130f6e016f0bbe16e [file] [log] [blame]
Sarah Chinc83bce42021-12-29 00:35:12 -08001/*
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 "radio_config_utils.h"
18
19RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {}
20
21ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse(
sandeepjs2a016742022-02-15 11:41:28 +000022 const RadioResponseInfo& info, const std::vector<SimSlotStatus>& slotStatus) {
Sarah Chin912bdf32022-01-28 01:02:16 -080023 rspInfo = info;
sandeepjs2a016742022-02-15 11:41:28 +000024 simSlotStatus = slotStatus;
Sarah Chin912bdf32022-01-28 01:02:16 -080025 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080026 return ndk::ScopedAStatus::ok();
27}
28
Sarah Chin912bdf32022-01-28 01:02:16 -080029ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse(const RadioResponseInfo& info) {
30 rspInfo = info;
31 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080032 return ndk::ScopedAStatus::ok();
33}
34
35ndk::ScopedAStatus RadioConfigResponse::getPhoneCapabilityResponse(
36 const RadioResponseInfo& info, const PhoneCapability& phoneCapability) {
37 rspInfo = info;
38 phoneCap = phoneCapability;
39 parent_config.notify(info.serial);
40 return ndk::ScopedAStatus::ok();
41}
42
Grant Menke37cc14d2023-11-29 19:28:28 -080043ndk::ScopedAStatus RadioConfigResponse::getSimultaneousCallingSupportResponse(
44 const RadioResponseInfo& info, const std::vector<int32_t>& /* enabledLogicalSlots */) {
45 rspInfo = info;
46 parent_config.notify(info.serial);
47 return ndk::ScopedAStatus::ok();
48}
49
Sarah Chinc83bce42021-12-29 00:35:12 -080050ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080051 const RadioResponseInfo& info) {
52 rspInfo = info;
53 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080054 return ndk::ScopedAStatus::ok();
55}
56
57ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080058 const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) {
59 rspInfo = info;
60 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080061 return ndk::ScopedAStatus::ok();
62}
63
Sarah Chin912bdf32022-01-28 01:02:16 -080064ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) {
65 rspInfo = info;
66 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080067 return ndk::ScopedAStatus::ok();
68}
69
70ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse(
71 const RadioResponseInfo& info, bool modemReducedFeatures) {
Sarah Chin912bdf32022-01-28 01:02:16 -080072 rspInfo = info;
Sarah Chinc83bce42021-12-29 00:35:12 -080073 modemReducedFeatureSet1 = modemReducedFeatures;
74 parent_config.notify(info.serial);
75 return ndk::ScopedAStatus::ok();
76}