blob: 7384f87adc1421917d48d9ddf64ed25cb9fab864 [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
43ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080044 const RadioResponseInfo& info) {
45 rspInfo = info;
46 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080047 return ndk::ScopedAStatus::ok();
48}
49
50ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080051 const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) {
52 rspInfo = info;
53 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080054 return ndk::ScopedAStatus::ok();
55}
56
Sarah Chin912bdf32022-01-28 01:02:16 -080057ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) {
58 rspInfo = info;
59 parent_config.notify(info.serial);
Sarah Chinc83bce42021-12-29 00:35:12 -080060 return ndk::ScopedAStatus::ok();
61}
62
63ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse(
64 const RadioResponseInfo& info, bool modemReducedFeatures) {
Sarah Chin912bdf32022-01-28 01:02:16 -080065 rspInfo = info;
Sarah Chinc83bce42021-12-29 00:35:12 -080066 modemReducedFeatureSet1 = modemReducedFeatures;
67 parent_config.notify(info.serial);
68 return ndk::ScopedAStatus::ok();
69}