• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CALL_REQUEST_PROCESS_H
17 #define CALL_REQUEST_PROCESS_H
18 
19 #include <mutex>
20 
21 #include "call_object_manager.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 class CallRequestProcess : public CallObjectManager {
26 public:
27     CallRequestProcess();
28     ~CallRequestProcess();
29 
30     int32_t DialRequest();
31     int32_t HandleDialRequest(DialParaInfo &info);
32     void AnswerRequest(int32_t callId, int32_t videoState);
33     void AnswerRequestForDsda(sptr<CallBase> call, int32_t callId, int32_t videoState);
34     void RejectRequest(int32_t callId, bool isSendSms, std::string &content);
35     void HangUpRequest(int32_t callId);
36     bool HangUpForDsdaRequest(sptr<CallBase> call);
37     void HandleHoldAfterHangUp(TelCallState state, int32_t waitingCallNum);
38     void HoldRequest(int32_t callId);
39     void UnHoldRequest(int32_t callId);
40     void SwitchRequest(int32_t callId);
41     void CombineConferenceRequest(int32_t mainCallId);
42     void SeparateConferenceRequest(int32_t callId);
43     void KickOutFromConferenceRequest(int32_t callId);
44     void StartRttRequest(int32_t callId, std::u16string &msg);
45     void StopRttRequest(int32_t callId);
46     void JoinConference(int32_t callId, std::vector<std::string> &numberList);
47     bool IsDsdsMode3();
48     bool IsDsdsMode5();
49     bool HasActivedCall(bool isIncludeVoipCall);
50     bool HasConnectingCall(bool isIncludeVoipCall);
51     bool NeedAnswerVTAndEndActiveVO(int32_t callId, int32_t videoState);
52     bool NeedAnswerVOAndEndActiveVT(int32_t callId, int32_t videoState);
53     void DisconnectOtherSubIdCall(int32_t callId, int32_t slotId, int32_t videoState);
54     void DisconnectOtherCallForVideoCall(int32_t callId);
55     void HandleCallWaitingNumTwo(sptr<CallBase> incomingCall, sptr<CallBase> call, int32_t slotId,
56         int32_t activeCallNum, bool &flagForConference);
57     void HandleCallWaitingNumOne(sptr<CallBase> incomingCall, sptr<CallBase> call, int32_t slotId,
58         int32_t activeCallNum, bool &flagForConference);
59     void HandleCallWaitingNumOneNext(sptr<CallBase> incomingCall, sptr<CallBase> call, sptr<CallBase> holdCall,
60         int32_t slotId, bool &flagForConference);
61     void HandleCallWaitingNumZero(sptr<CallBase> incomingCall, sptr<CallBase> call, int32_t slotId,
62         int32_t activeCallNum, bool &flagForConference);
63     void HoldOrDisconnectedCall(int32_t callId, int32_t slotId, int32_t videoState);
64     bool HandleDsdaIncomingCall(
65         sptr<CallBase> call, int32_t activeCallNum, int32_t slotId, int32_t videoState, sptr<CallBase> incomingCall);
66     void IsExistCallOtherSlot(std::list<int32_t> &list, int32_t slotId, bool &noOtherCall);
67     int32_t HandleDialingInfo(std::string newPhoneNum, DialParaInfo &info);
68 
69 private:
70     int32_t CarrierDialProcess(DialParaInfo &info);
71     int32_t IsDialCallForDsda(DialParaInfo &info);
72     int32_t HandleEccCallForDsda(std::string newPhoneNum, DialParaInfo &info, bool &isEcc);
73     int32_t VoiceMailDialProcess(DialParaInfo &info);
74     int32_t OttDialProcess(DialParaInfo &info);
75     int32_t PackCellularCallInfo(DialParaInfo &info, CellularCallInfo &callInfo);
76     bool IsFdnNumber(std::vector<std::u16string> fdnNumberList, std::string phoneNumber);
77     int32_t UpdateCallReportInfo(const DialParaInfo &info, TelCallState state);
78     int32_t HandleStartDial(bool isMMiCode, DialParaInfo &info);
79     int32_t HandleDialFail();
80     int32_t GetOtherRingingCall(int32_t currentCallId);
81     int32_t EccDialPolicy();
82     int32_t BluetoothDialProcess(DialParaInfo &info);
83     void GetDialingCall(sptr<CallBase> &call);
84 
85 private:
86     std::mutex mutex_;
87 };
88 } // namespace Telephony
89 } // namespace OHOS
90 
91 #endif // CALL_REQUEST_PROCESS_H
92