1 /* 2 * Copyright (C) 2021-2023 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 TELEPHONY_STATE_REGISTRY_PROXY_H 17 #define TELEPHONY_STATE_REGISTRY_PROXY_H 18 19 #include "iremote_proxy.h" 20 21 #include "i_telephony_state_notify.h" 22 #include "state_registry_ipc_interface_code.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class TelephonyStateRegistryProxy : public IRemoteProxy<ITelephonyStateNotify> { 27 public: TelephonyStateRegistryProxy(const sptr<IRemoteObject> & impl)28 explicit TelephonyStateRegistryProxy(const sptr<IRemoteObject> &impl) 29 : IRemoteProxy<ITelephonyStateNotify>(impl) 30 {} 31 32 virtual ~TelephonyStateRegistryProxy() = default; 33 34 int32_t UpdateCellularDataConnectState( 35 int32_t slotId, int32_t dataState, int32_t networkState) override; 36 int32_t UpdateCellularDataFlow( 37 int32_t slotId, int32_t dataFlowType) override; 38 int32_t UpdateCallState( 39 int32_t callStatus, const std::u16string &number) override; 40 int32_t UpdateCallStateForSlotId( 41 int32_t slotId, int32_t callStatus, const std::u16string &number) override; 42 int32_t UpdateSignalInfo( 43 int32_t slotId, const std::vector<sptr<SignalInformation>> &vec) override; 44 int32_t UpdateCellInfo( 45 int32_t slotId, const std::vector<sptr<CellInformation>> &vec) override; 46 int32_t UpdateNetworkState( 47 int32_t slotId, const sptr<NetworkState> &networkState) override; 48 int32_t UpdateSimState( 49 int32_t slotId, CardType type, SimState state, LockReason reason) override; 50 int32_t UpdateCfuIndicator(int32_t slotId, bool cfuResult) override; 51 int32_t UpdateVoiceMailMsgIndicator(int32_t slotId, bool voiceMailMsgResult) override; 52 int32_t UpdateIccAccount() override; 53 54 int32_t RegisterStateChange(const sptr<TelephonyObserverBroker> &telephonyObserver, 55 int32_t slotId, uint32_t mask, bool isUpdate) override; 56 int32_t UnregisterStateChange(int32_t slotId, uint32_t mask) override; 57 58 private: 59 static inline BrokerDelegator<TelephonyStateRegistryProxy> delegator_; 60 }; 61 } // namespace Telephony 62 } // namespace OHOS 63 #endif // TELEPHONY_STATE_REGISTRY_PROXY_H 64