1 /*
2  * Copyright (C) 2022 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_ims_utils.h"
18 
RadioImsResponse(RadioServiceTest & parent)19 RadioImsResponse::RadioImsResponse(RadioServiceTest& parent) : parent_ims(parent) {}
20 
setSrvccCallInfoResponse(const RadioResponseInfo & info)21 ndk::ScopedAStatus RadioImsResponse::setSrvccCallInfoResponse(const RadioResponseInfo& info) {
22     rspInfo = info;
23     parent_ims.notify(info.serial);
24     return ndk::ScopedAStatus::ok();
25 }
26 
updateImsRegistrationInfoResponse(const RadioResponseInfo & info)27 ndk::ScopedAStatus RadioImsResponse::updateImsRegistrationInfoResponse(
28         const RadioResponseInfo& info) {
29     rspInfo = info;
30     parent_ims.notify(info.serial);
31     return ndk::ScopedAStatus::ok();
32 }
33 
startImsTrafficResponse(const RadioResponseInfo & info,const std::optional<ConnectionFailureInfo> & response)34 ndk::ScopedAStatus RadioImsResponse::startImsTrafficResponse(const RadioResponseInfo& info,
35         const std::optional<ConnectionFailureInfo>& response) {
36     rspInfo = info;
37     startImsTrafficResp = response;
38     parent_ims.notify(info.serial);
39     return ndk::ScopedAStatus::ok();
40 }
41 
stopImsTrafficResponse(const RadioResponseInfo & info)42 ndk::ScopedAStatus RadioImsResponse::stopImsTrafficResponse(const RadioResponseInfo& info) {
43     rspInfo = info;
44     parent_ims.notify(info.serial);
45     return ndk::ScopedAStatus::ok();
46 }
47 
triggerEpsFallbackResponse(const RadioResponseInfo & info)48 ndk::ScopedAStatus RadioImsResponse::triggerEpsFallbackResponse(const RadioResponseInfo& info) {
49     rspInfo = info;
50     parent_ims.notify(info.serial);
51     return ndk::ScopedAStatus::ok();
52 }
53 
sendAnbrQueryResponse(const RadioResponseInfo & info)54 ndk::ScopedAStatus RadioImsResponse::sendAnbrQueryResponse(const RadioResponseInfo& info) {
55     rspInfo = info;
56     parent_ims.notify(info.serial);
57     return ndk::ScopedAStatus::ok();
58 }
59 
updateImsCallStatusResponse(const RadioResponseInfo & info)60 ndk::ScopedAStatus RadioImsResponse::updateImsCallStatusResponse(const RadioResponseInfo& info) {
61     rspInfo = info;
62     parent_ims.notify(info.serial);
63     return ndk::ScopedAStatus::ok();
64 }
65