• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 STATE_REGISTRY_OBSERVER_H
17 #define STATE_REGISTRY_OBSERVER_H
18 
19 #include "string_ex.h"
20 #include "telephony_log_wrapper.h"
21 #include "telephony_observer.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 class StateRegistryObserver : public Telephony::TelephonyObserver {
26 public:
27     StateRegistryObserver() = default;
28     ~StateRegistryObserver() = default;
29 
OnCallStateUpdated(int32_t slotId,int32_t callState,const std::u16string & phoneNumber)30     void OnCallStateUpdated(int32_t slotId, int32_t callState, const std::u16string &phoneNumber)
31     {
32         TELEPHONY_LOGI(
33             "StateRegistryObserver%{public}d::OnCallStateUpdated callState is %{public}d", slotId, callState);
34     }
35 
OnSignalInfoUpdated(int32_t slotId,const std::vector<sptr<SignalInformation>> & vec)36     void OnSignalInfoUpdated(int32_t slotId, const std::vector<sptr<SignalInformation>> &vec)
37     {
38         TELEPHONY_LOGI("StateRegistryObserver%{public}d::OnSignalInfoUpdated", slotId);
39     }
40 
OnNetworkStateUpdated(int32_t slotId,const sptr<NetworkState> & networkState)41     void OnNetworkStateUpdated(int32_t slotId, const sptr<NetworkState> &networkState)
42     {
43         TELEPHONY_LOGI("StateRegistryObserver%{public}d::OnNetworkStateUpdated", slotId);
44     }
45 
OnCellInfoUpdated(int32_t slotId,const std::vector<sptr<CellInformation>> & vec)46     void OnCellInfoUpdated(int32_t slotId, const std::vector<sptr<CellInformation>> &vec)
47     {
48         TELEPHONY_LOGI("StateRegistryObserver%{public}d::OnCellInfoUpdated", slotId);
49     }
50 
OnSimStateUpdated(int32_t slotId,CardType type,SimState state,LockReason reason)51     void OnSimStateUpdated(int32_t slotId, CardType type, SimState state, LockReason reason)
52     {
53         TELEPHONY_LOGI("StateRegistryObserver%{public}d::OnSimStateUpdated state is %{public}d", slotId, state);
54     }
55 
OnCellularDataConnectStateUpdated(int32_t slotId,int32_t dataState,int32_t networkType)56     void OnCellularDataConnectStateUpdated(int32_t slotId, int32_t dataState, int32_t networkType)
57     {
58         TELEPHONY_LOGI("StateRegistryObserver%{public}d::OnCellularDataConnectStateUpdated dataState is %{public}d",
59             slotId, dataState);
60     }
61 
OnCellularDataFlowUpdated(int32_t slotId,int32_t dataFlowType)62     void OnCellularDataFlowUpdated(int32_t slotId, int32_t dataFlowType)
63     {
64         TELEPHONY_LOGI("StateRegistryObserver%{public}d::OnCellularDataFlowUpdated dataFlowType is %{public}d", slotId,
65             dataFlowType);
66     }
67 
OnCfuIndicatorUpdated(int32_t slotId,bool cfuResult)68     void OnCfuIndicatorUpdated(int32_t slotId, bool cfuResult)
69     {
70         TELEPHONY_LOGI(
71             "StateRegistryObserver%{public}d::OnCfuIndicatorUpdated cfuResult is %{public}d", slotId, cfuResult);
72     }
73 
OnVoiceMailMsgIndicatorUpdated(int32_t slotId,bool voiceMailMsgResult)74     void OnVoiceMailMsgIndicatorUpdated(int32_t slotId, bool voiceMailMsgResult)
75     {
76         TELEPHONY_LOGI(
77             "StateRegistryObserver%{public}d::OnVoiceMailMsgIndicatorUpdated voiceMailMsgResult is %{public}d", slotId,
78             voiceMailMsgResult);
79     }
80 
OnIccAccountUpdated()81     void OnIccAccountUpdated()
82     {
83         TELEPHONY_LOGI("StateRegistryObserver::OnIccAccountUpdated");
84     }
85 };
86 } // namespace Telephony
87 } // namespace OHOS
88 #endif // STATE_REGISTRY_OBSERVER_H