blob: d2715a819830130b88f6727416462fa14d5890e8 [file] [log] [blame]
Sarah Chinfc5603b2021-12-21 11:34:00 -08001/*
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_modem_utils.h"
18
Sarah Chinc83bce42021-12-29 00:35:12 -080019RadioModemResponse::RadioModemResponse(RadioServiceTest& parent) : parent_modem(parent) {}
Sarah Chinfc5603b2021-12-21 11:34:00 -080020
21ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) {
22 return ndk::ScopedAStatus::ok();
23}
24
Sarah Chin912bdf32022-01-28 01:02:16 -080025ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& info) {
26 rspInfo = info;
27 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080028 return ndk::ScopedAStatus::ok();
29}
30
Sarah Chin912bdf32022-01-28 01:02:16 -080031ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080032 const std::string& /*version*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080033 rspInfo = info;
34 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080035 return ndk::ScopedAStatus::ok();
36}
37
Sarah Chin912bdf32022-01-28 01:02:16 -080038ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080039 const std::string& /*imei*/,
40 const std::string& /*imeisv*/,
41 const std::string& /*esn*/,
42 const std::string& /*meid*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080043 rspInfo = info;
44 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080045 return ndk::ScopedAStatus::ok();
46}
47
48ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080049 const RadioResponseInfo& info, const std::vector<HardwareConfig>& /*config*/) {
50 rspInfo = info;
51 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080052 return ndk::ScopedAStatus::ok();
53}
54
55ndk::ScopedAStatus RadioModemResponse::getModemActivityInfoResponse(
Sarah Chin912bdf32022-01-28 01:02:16 -080056 const RadioResponseInfo& info, const ActivityStatsInfo& /*activityInfo*/) {
57 rspInfo = info;
58 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080059 return ndk::ScopedAStatus::ok();
60}
61
Sarah Chin912bdf32022-01-28 01:02:16 -080062ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse(const RadioResponseInfo& info,
63 const bool enabled) {
64 rspInfo = info;
65 isModemEnabled = enabled;
66 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080067 return ndk::ScopedAStatus::ok();
68}
69
Sarah Chin912bdf32022-01-28 01:02:16 -080070ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080071 const RadioCapability& /*rc*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080072 rspInfo = info;
73 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080074 return ndk::ScopedAStatus::ok();
75}
76
Sarah Chin912bdf32022-01-28 01:02:16 -080077ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -080078 const std::string& /*result*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -080079 rspInfo = info;
80 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080081 return ndk::ScopedAStatus::ok();
82}
83
Sarah Chin912bdf32022-01-28 01:02:16 -080084ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& info) {
85 rspInfo = info;
86 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080087 return ndk::ScopedAStatus::ok();
88}
89
Sarah Chin912bdf32022-01-28 01:02:16 -080090ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) {
91 rspInfo = info;
92 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080093 return ndk::ScopedAStatus::ok();
94}
95
Sarah Chin912bdf32022-01-28 01:02:16 -080096ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& info) {
97 rspInfo = info;
98 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -080099 return ndk::ScopedAStatus::ok();
100}
101
Sarah Chin912bdf32022-01-28 01:02:16 -0800102ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& info) {
103 rspInfo = info;
104 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800105 return ndk::ScopedAStatus::ok();
106}
107
Sarah Chin912bdf32022-01-28 01:02:16 -0800108ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& info) {
109 rspInfo = info;
110 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800111 return ndk::ScopedAStatus::ok();
112}
113
Sarah Chin912bdf32022-01-28 01:02:16 -0800114ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& info,
Sarah Chinfc5603b2021-12-21 11:34:00 -0800115 const RadioCapability& /*rc*/) {
Sarah Chin912bdf32022-01-28 01:02:16 -0800116 rspInfo = info;
117 parent_modem.notify(info.serial);
Sarah Chinfc5603b2021-12-21 11:34:00 -0800118 return ndk::ScopedAStatus::ok();
119}
120
121ndk::ScopedAStatus RadioModemResponse::setRadioPowerResponse(const RadioResponseInfo& info) {
122 rspInfo = info;
123 parent_modem.notify(info.serial);
124 return ndk::ScopedAStatus::ok();
125}