Sarah Chin | fc5603b | 2021-12-21 11:34:00 -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_modem_utils.h" |
| 18 | |
Sarah Chin | c83bce4 | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 19 | RadioModemResponse::RadioModemResponse(RadioServiceTest& parent) : parent_modem(parent) {} |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 20 | |
| 21 | ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) { |
| 22 | return ndk::ScopedAStatus::ok(); |
| 23 | } |
| 24 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 25 | ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& info) { |
| 26 | rspInfo = info; |
| 27 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 28 | return ndk::ScopedAStatus::ok(); |
| 29 | } |
| 30 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 31 | ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 32 | const std::string& /*version*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 33 | rspInfo = info; |
| 34 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 35 | return ndk::ScopedAStatus::ok(); |
| 36 | } |
| 37 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 38 | ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 39 | const std::string& /*imei*/, |
| 40 | const std::string& /*imeisv*/, |
| 41 | const std::string& /*esn*/, |
| 42 | const std::string& /*meid*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 43 | rspInfo = info; |
| 44 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 45 | return ndk::ScopedAStatus::ok(); |
| 46 | } |
| 47 | |
| 48 | ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 49 | const RadioResponseInfo& info, const std::vector<HardwareConfig>& /*config*/) { |
| 50 | rspInfo = info; |
| 51 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 52 | return ndk::ScopedAStatus::ok(); |
| 53 | } |
| 54 | |
| 55 | ndk::ScopedAStatus RadioModemResponse::getModemActivityInfoResponse( |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 56 | const RadioResponseInfo& info, const ActivityStatsInfo& /*activityInfo*/) { |
| 57 | rspInfo = info; |
| 58 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 59 | return ndk::ScopedAStatus::ok(); |
| 60 | } |
| 61 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 62 | ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse(const RadioResponseInfo& info, |
| 63 | const bool enabled) { |
| 64 | rspInfo = info; |
| 65 | isModemEnabled = enabled; |
| 66 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 67 | return ndk::ScopedAStatus::ok(); |
| 68 | } |
| 69 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 70 | ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 71 | const RadioCapability& /*rc*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 72 | rspInfo = info; |
| 73 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 74 | return ndk::ScopedAStatus::ok(); |
| 75 | } |
| 76 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 77 | ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 78 | const std::string& /*result*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 79 | rspInfo = info; |
| 80 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 81 | return ndk::ScopedAStatus::ok(); |
| 82 | } |
| 83 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 84 | ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& info) { |
| 85 | rspInfo = info; |
| 86 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 87 | return ndk::ScopedAStatus::ok(); |
| 88 | } |
| 89 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 90 | ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) { |
| 91 | rspInfo = info; |
| 92 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 93 | return ndk::ScopedAStatus::ok(); |
| 94 | } |
| 95 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 96 | ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& info) { |
| 97 | rspInfo = info; |
| 98 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 99 | return ndk::ScopedAStatus::ok(); |
| 100 | } |
| 101 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 102 | ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& info) { |
| 103 | rspInfo = info; |
| 104 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 105 | return ndk::ScopedAStatus::ok(); |
| 106 | } |
| 107 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 108 | ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& info) { |
| 109 | rspInfo = info; |
| 110 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 111 | return ndk::ScopedAStatus::ok(); |
| 112 | } |
| 113 | |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 114 | ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& info, |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 115 | const RadioCapability& /*rc*/) { |
Sarah Chin | 912bdf3 | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 116 | rspInfo = info; |
| 117 | parent_modem.notify(info.serial); |
Sarah Chin | fc5603b | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 118 | return ndk::ScopedAStatus::ok(); |
| 119 | } |
| 120 | |
| 121 | ndk::ScopedAStatus RadioModemResponse::setRadioPowerResponse(const RadioResponseInfo& info) { |
| 122 | rspInfo = info; |
| 123 | parent_modem.notify(info.serial); |
| 124 | return ndk::ScopedAStatus::ok(); |
| 125 | } |