Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 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 "radio_config_utils.h" |
| 18 | |
| 19 | RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {} |
| 20 | |
| 21 | ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse( |
sandeepjs | 2a01674 | 2022-02-15 11:41:28 +0000 | [diff] [blame^] | 22 | const RadioResponseInfo& info, const std::vector<SimSlotStatus>& slotStatus) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 23 | rspInfo = info; |
sandeepjs | 2a01674 | 2022-02-15 11:41:28 +0000 | [diff] [blame^] | 24 | simSlotStatus = slotStatus; |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 25 | parent_config.notify(info.serial); |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 26 | return ndk::ScopedAStatus::ok(); |
| 27 | } |
| 28 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 29 | ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse(const RadioResponseInfo& info) { |
| 30 | rspInfo = info; |
| 31 | parent_config.notify(info.serial); |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 32 | return ndk::ScopedAStatus::ok(); |
| 33 | } |
| 34 | |
| 35 | ndk::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 | |
| 43 | ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 44 | const RadioResponseInfo& info) { |
| 45 | rspInfo = info; |
| 46 | parent_config.notify(info.serial); |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 47 | return ndk::ScopedAStatus::ok(); |
| 48 | } |
| 49 | |
| 50 | ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 51 | const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) { |
| 52 | rspInfo = info; |
| 53 | parent_config.notify(info.serial); |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 54 | return ndk::ScopedAStatus::ok(); |
| 55 | } |
| 56 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 57 | ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) { |
| 58 | rspInfo = info; |
| 59 | parent_config.notify(info.serial); |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 60 | return ndk::ScopedAStatus::ok(); |
| 61 | } |
| 62 | |
| 63 | ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse( |
| 64 | const RadioResponseInfo& info, bool modemReducedFeatures) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 65 | rspInfo = info; |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 66 | modemReducedFeatureSet1 = modemReducedFeatures; |
| 67 | parent_config.notify(info.serial); |
| 68 | return ndk::ScopedAStatus::ok(); |
| 69 | } |