blob: c532440dcc3ceece8002b6408fb20a2cc1437ec8 [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(
Grant Menke3bc635e2024-01-04 11:48:48 -080044 const RadioResponseInfo& info, const std::vector<int32_t>& enabledLogicalSlots) {
Grant Menke37cc14d2023-11-29 19:28:28 -080045 rspInfo = info;
Grant Menke3bc635e2024-01-04 11:48:48 -080046 currentEnabledLogicalSlots = enabledLogicalSlots;
Grant Menke37cc14d2023-11-29 19:28:28 -080047 parent_config.notify(info.serial);
48 return ndk::ScopedAStatus::ok();
49}
50
Sarah Chinc83bce42021-12-29 00:35:12 -080051ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080052 const RadioResponseInfo& info) {
53 rspInfo = info;
54 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080055 return ndk::ScopedAStatus::ok();
56}
57
58ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080059 const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) {
60 rspInfo = info;
61 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080062 return ndk::ScopedAStatus::ok();
63}
64
Sarah Chin912bdf32022-01-28 01:02:16 -080065ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) {
66 rspInfo = info;
67 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080068 return ndk::ScopedAStatus::ok();
69}
70
71ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse(
72 const RadioResponseInfo& info, bool modemReducedFeatures) {
Sarah Chin912bdf32022-01-28 01:02:16 -080073 rspInfo = info;
Sarah Chinc83bce42021-12-29 00:35:12 -080074 modemReducedFeatureSet1 = modemReducedFeatures;
75 parent_config.notify(info.serial);
76 return ndk::ScopedAStatus::ok();
77}