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_data_utils.h" |
| 18 | |
Sarah Chin | 91997ac | 2021-12-29 00:35:12 -0800 | [diff] [blame] | 19 | RadioDataResponse::RadioDataResponse(RadioServiceTest& parent) : parent_data(parent) {} |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 20 | |
| 21 | ndk::ScopedAStatus RadioDataResponse::acknowledgeRequest(int32_t /*serial*/) { |
| 22 | return ndk::ScopedAStatus::ok(); |
| 23 | } |
| 24 | |
| 25 | ndk::ScopedAStatus RadioDataResponse::allocatePduSessionIdResponse(const RadioResponseInfo& info, |
| 26 | int32_t id) { |
| 27 | rspInfo = info; |
| 28 | allocatedPduSessionId = id; |
| 29 | parent_data.notify(info.serial); |
| 30 | return ndk::ScopedAStatus::ok(); |
| 31 | } |
| 32 | |
| 33 | ndk::ScopedAStatus RadioDataResponse::cancelHandoverResponse(const RadioResponseInfo& info) { |
| 34 | rspInfo = info; |
| 35 | parent_data.notify(info.serial); |
| 36 | return ndk::ScopedAStatus::ok(); |
| 37 | } |
| 38 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 39 | ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse(const RadioResponseInfo& info) { |
| 40 | rspInfo = info; |
| 41 | parent_data.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 42 | return ndk::ScopedAStatus::ok(); |
| 43 | } |
| 44 | |
| 45 | ndk::ScopedAStatus RadioDataResponse::getDataCallListResponse( |
| 46 | const RadioResponseInfo& info, const std::vector<SetupDataCallResult>& /*dcResponse*/) { |
| 47 | rspInfo = info; |
| 48 | parent_data.notify(info.serial); |
| 49 | return ndk::ScopedAStatus::ok(); |
| 50 | } |
| 51 | |
| 52 | ndk::ScopedAStatus RadioDataResponse::getSlicingConfigResponse( |
| 53 | const RadioResponseInfo& info, const SlicingConfig& /*slicingConfig*/) { |
| 54 | rspInfo = info; |
| 55 | parent_data.notify(info.serial); |
| 56 | return ndk::ScopedAStatus::ok(); |
| 57 | } |
| 58 | |
| 59 | ndk::ScopedAStatus RadioDataResponse::releasePduSessionIdResponse(const RadioResponseInfo& info) { |
| 60 | rspInfo = info; |
| 61 | parent_data.notify(info.serial); |
| 62 | return ndk::ScopedAStatus::ok(); |
| 63 | } |
| 64 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 65 | ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& info) { |
| 66 | rspInfo = info; |
| 67 | parent_data.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 68 | return ndk::ScopedAStatus::ok(); |
| 69 | } |
| 70 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 71 | ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& info) { |
| 72 | rspInfo = info; |
| 73 | parent_data.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 74 | return ndk::ScopedAStatus::ok(); |
| 75 | } |
| 76 | |
| 77 | ndk::ScopedAStatus RadioDataResponse::setDataThrottlingResponse(const RadioResponseInfo& info) { |
| 78 | rspInfo = info; |
| 79 | parent_data.notify(info.serial); |
| 80 | return ndk::ScopedAStatus::ok(); |
| 81 | } |
| 82 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 83 | ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) { |
| 84 | rspInfo = info; |
| 85 | parent_data.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 86 | return ndk::ScopedAStatus::ok(); |
| 87 | } |
| 88 | |
| 89 | ndk::ScopedAStatus RadioDataResponse::setupDataCallResponse(const RadioResponseInfo& info, |
| 90 | const SetupDataCallResult& dcResponse) { |
| 91 | rspInfo = info; |
| 92 | setupDataCallResult = dcResponse; |
| 93 | parent_data.notify(info.serial); |
| 94 | return ndk::ScopedAStatus::ok(); |
| 95 | } |
| 96 | |
| 97 | ndk::ScopedAStatus RadioDataResponse::startHandoverResponse(const RadioResponseInfo& info) { |
| 98 | rspInfo = info; |
| 99 | parent_data.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 RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& info, |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 104 | const KeepaliveStatus& /*status*/) { |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 105 | rspInfo = info; |
| 106 | parent_data.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 107 | return ndk::ScopedAStatus::ok(); |
| 108 | } |
| 109 | |
Sarah Chin | 52de0ad | 2022-01-28 01:02:16 -0800 | [diff] [blame] | 110 | ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& info) { |
| 111 | rspInfo = info; |
| 112 | parent_data.notify(info.serial); |
Sarah Chin | d2a4119 | 2021-12-21 11:34:00 -0800 | [diff] [blame] | 113 | return ndk::ScopedAStatus::ok(); |
| 114 | } |