1 
2 /*
3  * Copyright (C) 2023 Huawei Device Co., Ltd.
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 #ifndef TELEPHONY_SATELLITE_CALL_PROXY_H
18 #define TELEPHONY_SATELLITE_CALL_PROXY_H
19 
20 #include "iremote_proxy.h"
21 #include "satellite_call_interface.h"
22 #include "satellite_call_ipc_interface_code.h"
23 #include "telephony_log_wrapper.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class SatelliteCallProxy : public IRemoteProxy<SatelliteCallInterface> {
28 public:
SatelliteCallProxy(const sptr<IRemoteObject> & impl)29     explicit SatelliteCallProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<SatelliteCallInterface>(impl) {}
30     ~SatelliteCallProxy() = default;
31     int32_t Dial(const SatelliteCallInfo &callInfo, CLIRMode mode) override;
32     int32_t HangUp(int32_t slotId, int32_t index) override;
33     int32_t Reject(int32_t slotId) override;
34     int32_t Answer(int32_t slotId) override;
35     int32_t GetSatelliteCallsDataRequest(int32_t slotId) override;
36     int32_t RegisterSatelliteCallCallback(const sptr<SatelliteCallCallbackInterface> &callback) override;
37 
38 private:
39     int32_t WriteCommonInfo(int32_t slotId, std::string funcName, MessageParcel &in);
40     int32_t WriteCommonInfo(int32_t slotId, std::string funcName, MessageParcel &in, int32_t callType);
41     int32_t SendRequest(MessageParcel &in, int32_t eventId);
42     int32_t SendRequest(int32_t slotId, MessageParcel &in, int32_t eventId);
43 
44 private:
45     static inline BrokerDelegator<SatelliteCallProxy> delegator_;
46 };
47 } // namespace Telephony
48 } // namespace OHOS
49 
50 #endif // TELEPHONY_SATELLITE_CALL_PROXY_H
51