blob: 84d57b2d5889f89fef928d91f29960aebeaedac4 [file] [log] [blame]
Thomas Nguyen7ea5df62022-11-28 16:41:46 -08001/*
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_satellite_utils.h"
18
19RadioSatelliteResponse::RadioSatelliteResponse(RadioServiceTest& parent)
20 : parent_satellite(parent) {}
21
22ndk::ScopedAStatus RadioSatelliteResponse::acknowledgeRequest(int32_t /*serial*/) {
23 return ndk::ScopedAStatus::ok();
24}
25
26ndk::ScopedAStatus RadioSatelliteResponse::getCapabilitiesResponse(
27 const RadioResponseInfo& info, const SatelliteCapabilities& /*capabilities*/) {
28 rspInfo = info;
29 parent_satellite.notify(info.serial);
30 return ndk::ScopedAStatus::ok();
31}
32
33ndk::ScopedAStatus RadioSatelliteResponse::setPowerResponse(const RadioResponseInfo& info) {
34 rspInfo = info;
35 parent_satellite.notify(info.serial);
36 return ndk::ScopedAStatus::ok();
37}
38
39ndk::ScopedAStatus RadioSatelliteResponse::getPowerStateResponse(const RadioResponseInfo& info,
40 bool /*on*/) {
41 rspInfo = info;
42 parent_satellite.notify(info.serial);
43 return ndk::ScopedAStatus::ok();
44}
45
46ndk::ScopedAStatus RadioSatelliteResponse::provisionServiceResponse(const RadioResponseInfo& info,
47 bool /*provisioned*/) {
48 rspInfo = info;
49 parent_satellite.notify(info.serial);
50 return ndk::ScopedAStatus::ok();
51}
52
53ndk::ScopedAStatus RadioSatelliteResponse::addAllowedSatelliteContactsResponse(
54 const RadioResponseInfo& info) {
55 rspInfo = info;
56 parent_satellite.notify(info.serial);
57 return ndk::ScopedAStatus::ok();
58}
59
60ndk::ScopedAStatus RadioSatelliteResponse::removeAllowedSatelliteContactsResponse(
61 const RadioResponseInfo& info) {
62 rspInfo = info;
63 parent_satellite.notify(info.serial);
64 return ndk::ScopedAStatus::ok();
65}
66
67ndk::ScopedAStatus RadioSatelliteResponse::sendMessagesResponse(const RadioResponseInfo& info) {
68 rspInfo = info;
69 parent_satellite.notify(info.serial);
70 return ndk::ScopedAStatus::ok();
71}
72
73ndk::ScopedAStatus RadioSatelliteResponse::getPendingMessagesResponse(
74 const RadioResponseInfo& info, const std::vector<std::string>& /*messages*/) {
75 rspInfo = info;
76 parent_satellite.notify(info.serial);
77 return ndk::ScopedAStatus::ok();
78}
79
80ndk::ScopedAStatus RadioSatelliteResponse::getSatelliteModeResponse(
81 const RadioResponseInfo& info, SatelliteMode /*mode*/, NTRadioTechnology /*technology*/) {
82 rspInfo = info;
83 parent_satellite.notify(info.serial);
84 return ndk::ScopedAStatus::ok();
85}
86
87ndk::ScopedAStatus RadioSatelliteResponse::setIndicationFilterResponse(
88 const RadioResponseInfo& info) {
89 rspInfo = info;
90 parent_satellite.notify(info.serial);
91 return ndk::ScopedAStatus::ok();
92}
93
94ndk::ScopedAStatus RadioSatelliteResponse::startSendingSatellitePointingInfoResponse(
95 const RadioResponseInfo& info) {
96 rspInfo = info;
97 parent_satellite.notify(info.serial);
98 return ndk::ScopedAStatus::ok();
99}
100
101ndk::ScopedAStatus RadioSatelliteResponse::stopSendingSatellitePointingInfoResponse(
102 const RadioResponseInfo& info) {
103 rspInfo = info;
104 parent_satellite.notify(info.serial);
105 return ndk::ScopedAStatus::ok();
106}
107
108ndk::ScopedAStatus RadioSatelliteResponse::getMaxCharactersPerTextMessageResponse(
109 const RadioResponseInfo& info, int32_t /*charLimit*/) {
110 rspInfo = info;
111 parent_satellite.notify(info.serial);
112 return ndk::ScopedAStatus::ok();
113}
114
115ndk::ScopedAStatus RadioSatelliteResponse::getTimeForNextSatelliteVisibilityResponse(
116 const RadioResponseInfo& info, int32_t /*timeInSeconds*/) {
117 rspInfo = info;
118 parent_satellite.notify(info.serial);
119 return ndk::ScopedAStatus::ok();
120}