• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_config_utils.h"
18 
RadioConfigResponse(RadioServiceTest & parent)19 RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {}
20 
getSimSlotsStatusResponse(const RadioResponseInfo & info,const std::vector<SimSlotStatus> & slotStatus)21 ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse(
22         const RadioResponseInfo& info, const std::vector<SimSlotStatus>& slotStatus) {
23     rspInfo = info;
24     simSlotStatus = slotStatus;
25     parent_config.notify(info.serial);
26     return ndk::ScopedAStatus::ok();
27 }
28 
setSimSlotsMappingResponse(const RadioResponseInfo & info)29 ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse(const RadioResponseInfo& info) {
30     rspInfo = info;
31     parent_config.notify(info.serial);
32     return ndk::ScopedAStatus::ok();
33 }
34 
getPhoneCapabilityResponse(const RadioResponseInfo & info,const PhoneCapability & phoneCapability)35 ndk::ScopedAStatus RadioConfigResponse::getPhoneCapabilityResponse(
36         const RadioResponseInfo& info, const PhoneCapability& phoneCapability) {
37     rspInfo = info;
38     phoneCap = phoneCapability;
39     parent_config.notify(info.serial);
40     return ndk::ScopedAStatus::ok();
41 }
42 
setPreferredDataModemResponse(const RadioResponseInfo & info)43 ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
44         const RadioResponseInfo& info) {
45     rspInfo = info;
46     parent_config.notify(info.serial);
47     return ndk::ScopedAStatus::ok();
48 }
49 
getNumOfLiveModemsResponse(const RadioResponseInfo & info,const int8_t)50 ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse(
51         const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) {
52     rspInfo = info;
53     parent_config.notify(info.serial);
54     return ndk::ScopedAStatus::ok();
55 }
56 
setNumOfLiveModemsResponse(const RadioResponseInfo & info)57 ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) {
58     rspInfo = info;
59     parent_config.notify(info.serial);
60     return ndk::ScopedAStatus::ok();
61 }
62 
getHalDeviceCapabilitiesResponse(const RadioResponseInfo & info,bool modemReducedFeatures)63 ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse(
64         const RadioResponseInfo& info, bool modemReducedFeatures) {
65     rspInfo = info;
66     modemReducedFeatureSet1 = modemReducedFeatures;
67     parent_config.notify(info.serial);
68     return ndk::ScopedAStatus::ok();
69 }
70