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 27 namespace OHOS { 28 namespace Telephony { 29 class CallAbilityReportProxy : public CallStateListenerBase, 30 public std::enable_shared_from_this<CallAbilityReportProxy> { 31 DECLARE_DELAYED_SINGLETON(CallAbilityReportProxy) 32 public: 33 int32_t RegisterCallBack(sptr<ICallAbilityCallback> callback, const std::string &bundleName); 34 int32_t UnRegisterCallBack(const std::string &bundleName); 35 void CallStateUpdated(sptr<CallBase> &callObjectPtr, TelCallState priorState, TelCallState nextState) override; 36 void CallEventUpdated(CallEventInfo &info) override; 37 void CallDestroyed(const DisconnectedDetails &details) override; 38 int32_t ReportAsyncResults(const CallResultReportId reportId, AppExecFwk::PacMap &resultInfo); 39 int32_t OttCallRequest(OttCallRequestId requestId, AppExecFwk::PacMap &info); 40 int32_t ReportMmiCodeResult(const MmiCodeInfo &info); 41 int32_t ReportAudioDeviceChange(const AudioDeviceInfo &info); 42 int32_t ReportCallStateInfo(const CallAttributeInfo &info); 43 int32_t ReportPostDialDelay(const std::string &str); 44 45 private: 46 int32_t ReportCallEvent(const CallEventInfo &info); 47 48 private: 49 std::list<sptr<ICallAbilityCallback>> callbackPtrList_; 50 sptr<ICallAbilityCallback> callAbilityCallbackPtr_; 51 std::mutex mutex_; 52 }; 53 } // namespace Telephony 54 } // namespace OHOS 55 56 #endif // CALL_ABILITY_REPORT_IPC_PROXY_H 57