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 #pragma once
17 
18 #include "RadioCompatBase.h"
19 
20 #include <aidl/android/hardware/radio/messaging/BnRadioMessaging.h>
21 
22 namespace android::hardware::radio::compat {
23 
24 class RadioMessaging : public RadioCompatBase,
25                        public aidl::android::hardware::radio::messaging::BnRadioMessaging {
26     ::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success,
27                                                           const std::string& ackPdu) override;
28     ::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms(
29             int32_t serial,
30             const ::aidl::android::hardware::radio::messaging::CdmaSmsAck& smsAck) override;
31     ::ndk::ScopedAStatus acknowledgeLastIncomingGsmSms(
32             int32_t serial, bool success,
33             ::aidl::android::hardware::radio::messaging::SmsAcknowledgeFailCause cause) override;
34     ::ndk::ScopedAStatus deleteSmsOnRuim(int32_t serial, int32_t index) override;
35     ::ndk::ScopedAStatus deleteSmsOnSim(int32_t serial, int32_t index) override;
36     ::ndk::ScopedAStatus getCdmaBroadcastConfig(int32_t serial) override;
37     ::ndk::ScopedAStatus getGsmBroadcastConfig(int32_t serial) override;
38     ::ndk::ScopedAStatus getSmscAddress(int32_t serial) override;
39     ::ndk::ScopedAStatus reportSmsMemoryStatus(int32_t serial, bool available) override;
40     ::ndk::ScopedAStatus responseAcknowledgement() override;
41     ::ndk::ScopedAStatus sendCdmaSms(
42             int32_t serial,
43             const ::aidl::android::hardware::radio::messaging::CdmaSmsMessage& sms) override;
44     ::ndk::ScopedAStatus sendCdmaSmsExpectMore(
45             int32_t serial,
46             const ::aidl::android::hardware::radio::messaging::CdmaSmsMessage& sms) override;
47     ::ndk::ScopedAStatus sendImsSms(
48             int32_t serial,
49             const ::aidl::android::hardware::radio::messaging::ImsSmsMessage& message) override;
50     ::ndk::ScopedAStatus sendSms(
51             int32_t serial,
52             const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& message) override;
53     ::ndk::ScopedAStatus sendSmsExpectMore(
54             int32_t serial,
55             const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& message) override;
56     ::ndk::ScopedAStatus setCdmaBroadcastActivation(int32_t serial, bool activate) override;
57     ::ndk::ScopedAStatus setCdmaBroadcastConfig(
58             int32_t serial,
59             const std::vector<
60                     ::aidl::android::hardware::radio::messaging::CdmaBroadcastSmsConfigInfo>&
61                     configInfo) override;
62     ::ndk::ScopedAStatus setGsmBroadcastActivation(int32_t serial, bool activate) override;
63     ::ndk::ScopedAStatus setGsmBroadcastConfig(
64             int32_t serial,
65             const std::vector<
66                     ::aidl::android::hardware::radio::messaging::GsmBroadcastSmsConfigInfo>&
67                     configInfo) override;
68     ::ndk::ScopedAStatus setResponseFunctions(
69             const std::shared_ptr<
70                     ::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>&
71                     radioMessagingResponse,
72             const std::shared_ptr<
73                     ::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>&
74                     radioMessagingIndication) override;
75     ::ndk::ScopedAStatus setSmscAddress(int32_t serial, const std::string& smsc) override;
76     ::ndk::ScopedAStatus writeSmsToRuim(
77             int32_t serial,
78             const ::aidl::android::hardware::radio::messaging::CdmaSmsWriteArgs& cdmaSms) override;
79     ::ndk::ScopedAStatus writeSmsToSim(
80             int32_t serial,
81             const ::aidl::android::hardware::radio::messaging::SmsWriteArgs& smsWriteArgs) override;
82 
83   protected:
84     std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond();
85 
86   public:
87     using RadioCompatBase::RadioCompatBase;
88 };
89 
90 }  // namespace android::hardware::radio::compat
91