xref: /aosp_15_r20/hardware/interfaces/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
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/voice/BnRadioVoice.h>
21 
22 namespace android::hardware::radio::compat {
23 
24 class RadioVoice : public RadioCompatBase,
25                    public aidl::android::hardware::radio::voice::BnRadioVoice {
26     ::ndk::ScopedAStatus acceptCall(int32_t serial) override;
27     ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override;
28     ::ndk::ScopedAStatus conference(int32_t serial) override;
29     ::ndk::ScopedAStatus dial(
30             int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo) override;
31     ::ndk::ScopedAStatus emergencyDial(
32             int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo,
33             int32_t categories, const std::vector<std::string>& urns,
34             ::aidl::android::hardware::radio::voice::EmergencyCallRouting routing,
35             bool hasKnownUserIntentEmergency, bool isTesting) override;
36     ::ndk::ScopedAStatus exitEmergencyCallbackMode(int32_t serial) override;
37     ::ndk::ScopedAStatus explicitCallTransfer(int32_t serial) override;
38     ::ndk::ScopedAStatus getCallForwardStatus(
39             int32_t serial,
40             const ::aidl::android::hardware::radio::voice::CallForwardInfo& callInfo) override;
41     ::ndk::ScopedAStatus getCallWaiting(int32_t serial, int32_t serviceClass) override;
42     ::ndk::ScopedAStatus getClip(int32_t serial) override;
43     ::ndk::ScopedAStatus getClir(int32_t serial) override;
44     ::ndk::ScopedAStatus getCurrentCalls(int32_t serial) override;
45     ::ndk::ScopedAStatus getLastCallFailCause(int32_t serial) override;
46     ::ndk::ScopedAStatus getMute(int32_t serial) override;
47     ::ndk::ScopedAStatus getPreferredVoicePrivacy(int32_t serial) override;
48     ::ndk::ScopedAStatus getTtyMode(int32_t serial) override;
49     ::ndk::ScopedAStatus handleStkCallSetupRequestFromSim(int32_t serial, bool accept) override;
50     ::ndk::ScopedAStatus hangup(int32_t serial, int32_t gsmIndex) override;
51     ::ndk::ScopedAStatus hangupForegroundResumeBackground(int32_t serial) override;
52     ::ndk::ScopedAStatus hangupWaitingOrBackground(int32_t serial) override;
53     ::ndk::ScopedAStatus isVoNrEnabled(int32_t serial) override;
54     ::ndk::ScopedAStatus rejectCall(int32_t serial) override;
55     ::ndk::ScopedAStatus responseAcknowledgement() override;
56     ::ndk::ScopedAStatus sendBurstDtmf(int32_t serial, const std::string& dtmf, int32_t on,
57                                        int32_t off) override;
58     ::ndk::ScopedAStatus sendCdmaFeatureCode(int32_t serial, const std::string& fcode) override;
59     ::ndk::ScopedAStatus sendDtmf(int32_t serial, const std::string& s) override;
60     ::ndk::ScopedAStatus sendUssd(int32_t serial, const std::string& ussd) override;
61     ::ndk::ScopedAStatus separateConnection(int32_t serial, int32_t gsmIndex) override;
62     ::ndk::ScopedAStatus setCallForward(
63             int32_t serial,
64             const ::aidl::android::hardware::radio::voice::CallForwardInfo& callInfo) override;
65     ::ndk::ScopedAStatus setCallWaiting(int32_t serial, bool enable, int32_t serviceClass) override;
66     ::ndk::ScopedAStatus setClir(int32_t serial, int32_t status) override;
67     ::ndk::ScopedAStatus setMute(int32_t serial, bool enable) override;
68     ::ndk::ScopedAStatus setPreferredVoicePrivacy(int32_t serial, bool enable) override;
69     ::ndk::ScopedAStatus setResponseFunctions(
70             const std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse>&
71                     radioVoiceResponse,
72             const std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication>&
73                     radioVoiceIndication) override;
74     ::ndk::ScopedAStatus setTtyMode(int32_t serial,
75                                     ::aidl::android::hardware::radio::voice::TtyMode mode) override;
76     ::ndk::ScopedAStatus setVoNrEnabled(int32_t serial, bool enable) override;
77     ::ndk::ScopedAStatus startDtmf(int32_t serial, const std::string& s) override;
78     ::ndk::ScopedAStatus stopDtmf(int32_t serial) override;
79     ::ndk::ScopedAStatus switchWaitingOrHoldingAndActive(int32_t serial) override;
80 
81   protected:
82     std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond();
83 
84   public:
85     using RadioCompatBase::RadioCompatBase;
86 };
87 
88 }  // namespace android::hardware::radio::compat
89