• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-2022 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_ABILITY_REPORT_PROXY_H
17 #define CALL_ABILITY_REPORT_PROXY_H
18 
19 #include <list>
20 
21 #include "singleton.h"
22 
23 #include "i_call_ability_callback.h"
24 
25 #include "call_state_listener_base.h"
26 #include "app_state_observer.h"
27 
28 namespace OHOS {
29 namespace Telephony {
30 class CallAbilityReportProxy : public CallStateListenerBase,
31                                public std::enable_shared_from_this<CallAbilityReportProxy> {
32     DECLARE_DELAYED_SINGLETON(CallAbilityReportProxy)
33 public:
34     int32_t RegisterCallBack(sptr<ICallAbilityCallback> callback, const std::string &bundleInfo);
35     int32_t UnRegisterCallBack(const std::string &bundleInfo);
36     int32_t UnRegisterCallBack(sptr<IRemoteObject> object);
37     void CallStateUpdated(sptr<CallBase> &callObjectPtr, TelCallState priorState, TelCallState nextState) override;
38     void MeeTimeStateUpdated(CallAttributeInfo info, TelCallState priorState, TelCallState nextState) override;
39     void CallEventUpdated(CallEventInfo &info) override;
40     void CallDestroyed(const DisconnectedDetails &details) override;
41     int32_t ReportAsyncResults(const CallResultReportId reportId, AppExecFwk::PacMap &resultInfo);
42     int32_t OttCallRequest(OttCallRequestId requestId, AppExecFwk::PacMap &info);
43     int32_t ReportMmiCodeResult(const MmiCodeInfo &info);
44     int32_t ReportAudioDeviceChange(const AudioDeviceInfo &info);
45     int32_t ReportCallStateInfo(const CallAttributeInfo &info);
46     int32_t ReportMeeTimeStateInfo(const CallAttributeInfo &info);
47     int32_t ReportCallStateInfo(const CallAttributeInfo &info, std::string bundleInfo);
48     int32_t ReportPostDialDelay(const std::string &str);
49     int32_t ReportImsCallModeChange(const CallMediaModeInfo &imsCallModeInfo);
50     int32_t ReportCallSessionEventChange(const CallSessionEvent &callSessionEventOptions);
51     int32_t ReportPeerDimensionsChange(const PeerDimensionsDetail &peerDimensionsDetail);
52     int32_t ReportCallDataUsageChange(const int64_t dataUsage);
53     int32_t ReportCameraCapabilities(const CameraCapabilities &cameraCapabilities);
54     int32_t ReportPhoneStateChange(int32_t numActive, int32_t numHeld, int32_t callState, const std::string &number);
55 
56 private:
57     int32_t ReportCallEvent(const CallEventInfo &info);
58 
59 private:
60     std::list<sptr<ICallAbilityCallback>> callbackPtrList_;
61     sptr<ICallAbilityCallback> callAbilityCallbackPtr_;
62     sptr<ApplicationStateObserver> appStateObserver;
63     sptr<AppExecFwk::IAppMgr> appMgrProxy = nullptr;
64     std::mutex mutex_;
65 };
66 } // namespace Telephony
67 } // namespace OHOS
68 
69 #endif // CALL_ABILITY_REPORT_IPC_PROXY_H
70