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 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 47 | ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) { |
| 48 | rspInfo = info; |
| 49 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 50 | return ndk::ScopedAStatus::ok(); |
| 51 | } |
| 52 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 53 | ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) { |
| 54 | rspInfo = info; |
| 55 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 56 | return ndk::ScopedAStatus::ok(); |
| 57 | } |
| 58 | |
| 59 | ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 60 | const RadioResponseInfo& info, const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) { |
| 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::getGsmBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 67 | const RadioResponseInfo& info, const std::vector<GsmBroadcastSmsConfigInfo>& /*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 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 73 | ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 74 | const std::string& /*smsc*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 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 | |
| 80 | ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 81 | const RadioResponseInfo& info) { |
| 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::sendCdmaSmsExpectMoreResponse( |
| 88 | const RadioResponseInfo& info, const SendSmsResult& sms) { |
| 89 | rspInfo = info; |
| 90 | sendSmsResult = sms; |
| 91 | parent_messaging.notify(info.serial); |
| 92 | return ndk::ScopedAStatus::ok(); |
| 93 | } |
| 94 | |
| 95 | ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioResponseInfo& info, |
| 96 | const SendSmsResult& sms) { |
| 97 | rspInfo = info; |
| 98 | sendSmsResult = sms; |
| 99 | parent_messaging.notify(info.serial); |
| 100 | return ndk::ScopedAStatus::ok(); |
| 101 | } |
| 102 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 103 | ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 104 | const SendSmsResult& /*sms*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 105 | rspInfo = info; |
| 106 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 107 | return ndk::ScopedAStatus::ok(); |
| 108 | } |
| 109 | |
| 110 | ndk::ScopedAStatus RadioMessagingResponse::sendSmsExpectMoreResponse(const RadioResponseInfo& info, |
| 111 | const SendSmsResult& sms) { |
| 112 | rspInfo = info; |
| 113 | sendSmsResult = sms; |
| 114 | parent_messaging.notify(info.serial); |
| 115 | return ndk::ScopedAStatus::ok(); |
| 116 | } |
| 117 | |
| 118 | ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseInfo& info, |
| 119 | const SendSmsResult& sms) { |
| 120 | rspInfo = info; |
| 121 | sendSmsResult = sms; |
| 122 | parent_messaging.notify(info.serial); |
| 123 | return ndk::ScopedAStatus::ok(); |
| 124 | } |
| 125 | |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 126 | ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 127 | const RadioResponseInfo& info) { |
| 128 | rspInfo = info; |
| 129 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 130 | return ndk::ScopedAStatus::ok(); |
| 131 | } |
| 132 | |
| 133 | ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 134 | const RadioResponseInfo& info) { |
| 135 | rspInfo = info; |
| 136 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 137 | return ndk::ScopedAStatus::ok(); |
| 138 | } |
| 139 | |
| 140 | ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 141 | const RadioResponseInfo& info) { |
| 142 | rspInfo = info; |
| 143 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 144 | return ndk::ScopedAStatus::ok(); |
| 145 | } |
| 146 | |
| 147 | ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse( |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 148 | const RadioResponseInfo& info) { |
| 149 | rspInfo = info; |
| 150 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 151 | return ndk::ScopedAStatus::ok(); |
| 152 | } |
| 153 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 154 | ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(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 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 160 | ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 161 | int32_t /*index*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 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::writeSmsToSimResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 168 | int32_t /*index*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 169 | rspInfo = info; |
| 170 | parent_messaging.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 171 | return ndk::ScopedAStatus::ok(); |
| 172 | } |