• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 #pragma once
18 #include <functional>
19 #include <future>
20 #include <memory>
21 #include <mutex>
22 
23 #include <aidl/android/hardware/radio/config/BnRadioConfig.h>
24 #include "AtChannel.h"
25 
26 namespace aidl {
27 namespace android {
28 namespace hardware {
29 namespace radio {
30 namespace implementation {
31 using ::ndk::ScopedAStatus;
32 
33 struct RadioConfig : public config::BnRadioConfig {
34     RadioConfig(std::shared_ptr<AtChannel> atChannel);
35 
36     ScopedAStatus getHalDeviceCapabilities(int32_t serial) override;
37     ScopedAStatus getNumOfLiveModems(int32_t serial) override;
38     ScopedAStatus getPhoneCapability(int32_t serial) override;
39     ScopedAStatus getSimultaneousCallingSupport(int32_t serial) override;
40     ScopedAStatus getSimSlotsStatus(int32_t serial) override;
41     ScopedAStatus setNumOfLiveModems(int32_t serial, int8_t numOfLiveModems) override;
42     ScopedAStatus setPreferredDataModem(int32_t serial, int8_t modemId) override;
43     ScopedAStatus setSimSlotsMapping(
44             int32_t serial, const std::vector<config::SlotPortMapping>& slotMap) override;
45 
46     void atResponseSink(const AtResponsePtr& response);
handleUnsolicitedRadioConfig47     template <class IGNORE> void handleUnsolicited(const IGNORE&) {}
48 
49     ScopedAStatus setResponseFunctions(
50             const std::shared_ptr<config::IRadioConfigResponse>& radioConfigResponse,
51             const std::shared_ptr<config::IRadioConfigIndication>& radioConfigIndication) override;
52 
53 private:
54     const std::shared_ptr<AtChannel> mAtChannel;
55     AtChannel::Conversation mAtConversation;
56     std::shared_ptr<config::IRadioConfigResponse> mRadioConfigResponse;
57     std::shared_ptr<config::IRadioConfigIndication> mRadioConfigIndication;
58 
59 };
60 
61 }  // namespace implementation
62 }  // namespace radio
63 }  // namespace hardware
64 }  // namespace android
65 }  // namespace aidl
66