Sarah Chin | d2a4119 | 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_messaging_utils.h" |
| 18 | |
Sarah Chin | 91997ac | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 19 | RadioMessagingResponse::RadioMessagingResponse(RadioServiceTest& parent) |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 20 | : parent_messaging(parent) {} |
| 21 | |
| 22 | ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 23 | const RadioResponseInfo& info) { |
| 24 | rspInfo = info; |
| 25 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 26 | return ndk::ScopedAStatus::ok(); |
| 27 | } |
| 28 | |
| 29 | ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 30 | const RadioResponseInfo& info) { |
| 31 | rspInfo = info; |
| 32 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 33 | return ndk::ScopedAStatus::ok(); |
| 34 | } |
| 35 | |
| 36 | ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 37 | const RadioResponseInfo& info) { |
| 38 | rspInfo = info; |
| 39 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 40 | return ndk::ScopedAStatus::ok(); |
| 41 | } |
| 42 | |
| 43 | ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/) { |
| 44 | return ndk::ScopedAStatus::ok(); |
| 45 | } |
| 46 | |
| 47 | ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 48 | const RadioResponseInfo& info) { |
| 49 | rspInfo = info; |
| 50 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 51 | return ndk::ScopedAStatus::ok(); |
| 52 | } |
| 53 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 54 | ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) { |
| 55 | rspInfo = info; |
| 56 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 57 | return ndk::ScopedAStatus::ok(); |
| 58 | } |
| 59 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 60 | ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) { |
| 61 | rspInfo = info; |
| 62 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 63 | return ndk::ScopedAStatus::ok(); |
| 64 | } |
| 65 | |
| 66 | ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 67 | const RadioResponseInfo& info, const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) { |
| 68 | rspInfo = info; |
| 69 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 70 | return ndk::ScopedAStatus::ok(); |
| 71 | } |
| 72 | |
| 73 | ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 74 | const RadioResponseInfo& info, const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) { |
| 75 | rspInfo = info; |
| 76 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 77 | return ndk::ScopedAStatus::ok(); |
| 78 | } |
| 79 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 80 | ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 81 | const std::string& /*smsc*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 82 | rspInfo = info; |
| 83 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 84 | return ndk::ScopedAStatus::ok(); |
| 85 | } |
| 86 | |
| 87 | ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 88 | const RadioResponseInfo& info) { |
| 89 | rspInfo = info; |
| 90 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 91 | return ndk::ScopedAStatus::ok(); |
| 92 | } |
| 93 | |
| 94 | ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsExpectMoreResponse( |
| 95 | const RadioResponseInfo& info, const SendSmsResult& sms) { |
| 96 | rspInfo = info; |
| 97 | sendSmsResult = sms; |
| 98 | parent_messaging.notify(info.serial); |
| 99 | return ndk::ScopedAStatus::ok(); |
| 100 | } |
| 101 | |
| 102 | ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioResponseInfo& info, |
| 103 | const SendSmsResult& sms) { |
| 104 | rspInfo = info; |
| 105 | sendSmsResult = sms; |
| 106 | parent_messaging.notify(info.serial); |
| 107 | return ndk::ScopedAStatus::ok(); |
| 108 | } |
| 109 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 110 | ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 111 | const SendSmsResult& /*sms*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 112 | rspInfo = info; |
| 113 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 114 | return ndk::ScopedAStatus::ok(); |
| 115 | } |
| 116 | |
| 117 | ndk::ScopedAStatus RadioMessagingResponse::sendSmsExpectMoreResponse(const RadioResponseInfo& info, |
| 118 | const SendSmsResult& sms) { |
| 119 | rspInfo = info; |
| 120 | sendSmsResult = sms; |
| 121 | parent_messaging.notify(info.serial); |
| 122 | return ndk::ScopedAStatus::ok(); |
| 123 | } |
| 124 | |
| 125 | ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseInfo& info, |
| 126 | const SendSmsResult& sms) { |
| 127 | rspInfo = info; |
| 128 | sendSmsResult = sms; |
| 129 | parent_messaging.notify(info.serial); |
| 130 | return ndk::ScopedAStatus::ok(); |
| 131 | } |
| 132 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 133 | ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& info) { |
| 134 | rspInfo = info; |
| 135 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 136 | return ndk::ScopedAStatus::ok(); |
| 137 | } |
| 138 | |
| 139 | ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 140 | const RadioResponseInfo& info) { |
| 141 | rspInfo = info; |
| 142 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 143 | return ndk::ScopedAStatus::ok(); |
| 144 | } |
| 145 | |
| 146 | ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 147 | const RadioResponseInfo& info) { |
| 148 | rspInfo = info; |
| 149 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 150 | return ndk::ScopedAStatus::ok(); |
| 151 | } |
| 152 | |
| 153 | ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 154 | const RadioResponseInfo& info) { |
| 155 | rspInfo = info; |
| 156 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 157 | return ndk::ScopedAStatus::ok(); |
| 158 | } |
| 159 | |
| 160 | ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 161 | const RadioResponseInfo& info) { |
| 162 | rspInfo = info; |
| 163 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 164 | return ndk::ScopedAStatus::ok(); |
| 165 | } |
| 166 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 167 | ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(const RadioResponseInfo& info) { |
| 168 | rspInfo = info; |
| 169 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 170 | return ndk::ScopedAStatus::ok(); |
| 171 | } |
| 172 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 173 | ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 174 | int32_t /*index*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 175 | rspInfo = info; |
| 176 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 177 | return ndk::ScopedAStatus::ok(); |
| 178 | } |
| 179 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 180 | ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 181 | int32_t /*index*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame^] | 182 | rspInfo = info; |
| 183 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 184 | return ndk::ScopedAStatus::ok(); |
| 185 | } |