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
RadioDataResponse(RadioServiceTest & parent)19 RadioDataResponse::RadioDataResponse(RadioServiceTest& parent) : parent_data(parent) {}
20
acknowledgeRequest(int32_t)21 ndk::ScopedAStatus RadioDataResponse::acknowledgeRequest(int32_t /*serial*/) {
22 return ndk::ScopedAStatus::ok();
23 }
24
allocatePduSessionIdResponse(const RadioResponseInfo & info,int32_t id)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
cancelHandoverResponse(const RadioResponseInfo & info)33 ndk::ScopedAStatus RadioDataResponse::cancelHandoverResponse(const RadioResponseInfo& info) {
34 rspInfo = info;
35 parent_data.notify(info.serial);
36 return ndk::ScopedAStatus::ok();
37 }
38
deactivateDataCallResponse(const RadioResponseInfo & info)39 ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse(const RadioResponseInfo& info) {
40 rspInfo = info;
41 parent_data.notify(info.serial);
42 return ndk::ScopedAStatus::ok();
43 }
44
getDataCallListResponse(const RadioResponseInfo & info,const std::vector<SetupDataCallResult> &)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
getSlicingConfigResponse(const RadioResponseInfo & info,const SlicingConfig &)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
releasePduSessionIdResponse(const RadioResponseInfo & info)59 ndk::ScopedAStatus RadioDataResponse::releasePduSessionIdResponse(const RadioResponseInfo& info) {
60 rspInfo = info;
61 parent_data.notify(info.serial);
62 return ndk::ScopedAStatus::ok();
63 }
64
setDataAllowedResponse(const RadioResponseInfo & info)65 ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& info) {
66 rspInfo = info;
67 parent_data.notify(info.serial);
68 return ndk::ScopedAStatus::ok();
69 }
70
setDataProfileResponse(const RadioResponseInfo & info)71 ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& info) {
72 rspInfo = info;
73 parent_data.notify(info.serial);
74 return ndk::ScopedAStatus::ok();
75 }
76
setDataThrottlingResponse(const RadioResponseInfo & info)77 ndk::ScopedAStatus RadioDataResponse::setDataThrottlingResponse(const RadioResponseInfo& info) {
78 rspInfo = info;
79 parent_data.notify(info.serial);
80 return ndk::ScopedAStatus::ok();
81 }
82
setInitialAttachApnResponse(const RadioResponseInfo & info)83 ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) {
84 rspInfo = info;
85 parent_data.notify(info.serial);
86 return ndk::ScopedAStatus::ok();
87 }
88
setupDataCallResponse(const RadioResponseInfo & info,const SetupDataCallResult & dcResponse)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
startHandoverResponse(const RadioResponseInfo & info)97 ndk::ScopedAStatus RadioDataResponse::startHandoverResponse(const RadioResponseInfo& info) {
98 rspInfo = info;
99 parent_data.notify(info.serial);
100 return ndk::ScopedAStatus::ok();
101 }
102
startKeepaliveResponse(const RadioResponseInfo & info,const KeepaliveStatus &)103 ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& info,
104 const KeepaliveStatus& /*status*/) {
105 rspInfo = info;
106 parent_data.notify(info.serial);
107 return ndk::ScopedAStatus::ok();
108 }
109
stopKeepaliveResponse(const RadioResponseInfo & info)110 ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& info) {
111 rspInfo = info;
112 parent_data.notify(info.serial);
113 return ndk::ScopedAStatus::ok();
114 }
115