• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_I_TELEPHONY_STATE_NOTIFY_H
17 #define OHOS_I_TELEPHONY_STATE_NOTIFY_H
18 
19 #include "telephony_observer_broker.h"
20 
21 namespace OHOS {
22 namespace Telephony {
23 class ITelephonyStateNotify : public IRemoteBroker {
24 public:
25     /**
26      * UpdateCellularDataConnectState
27      *
28      * @param slotId sim slot id
29      * @param dataState cellular data link state
30      * @param networkState network state
31      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
32      */
33     virtual int32_t UpdateCellularDataConnectState(int32_t slotId, int32_t dataState, int32_t networkState) = 0;
34 
35     /**
36      * UpdateCellularDataFlow
37      *
38      * @param slotId sim slot id
39      * @param dataFlowType cellular data flow state
40      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
41      */
42     virtual int32_t UpdateCellularDataFlow(int32_t slotId, int32_t dataFlowType) = 0;
43 
44     /**
45      * UpdateSimState
46      *
47      * @param slotId sim slot id
48      * @param CardType sim card type
49      * @param state sim state
50      * @param reason
51      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
52      */
53     virtual int32_t UpdateSimState(int32_t slotId, CardType type, SimState state, LockReason reason) = 0;
54 
55     /**
56      * UpdateCallState
57      *
58      * @param slotId sim slot id
59      * @param callStatus call status
60      * @param number call number
61      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
62      */
63     virtual int32_t UpdateCallState(int32_t slotId, int32_t callStatus, const std::u16string &number) = 0;
64 
65     /**
66      * UpdateCallStateForSlotId
67      *
68      * @param slotId sim slot id
69      * @param callId call id
70      * @param callStatus call status
71      * @param number incoming number
72      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
73      */
74     virtual int32_t UpdateCallStateForSlotId(
75         int32_t slotId, int32_t callId, int32_t callStatus, const std::u16string &incomingNumber) = 0;
76 
77     /**
78      * UpdateSignalInfo
79      *
80      * @param slotId sim slot id
81      * @param vec networkType search signal information
82      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
83      */
84     virtual int32_t UpdateSignalInfo(int32_t slotId, const std::vector<sptr<SignalInformation>> &vec) = 0;
85 
86     /**
87      * UpdateCellInfo
88      *
89      * @param slotId sim slot id
90      * @param vec cell info
91      * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
92      */
93     virtual int32_t UpdateCellInfo(int32_t slotId, const std::vector<sptr<CellInformation>> &vec) = 0;
94 
95     /**
96      * UpdateNetworkState
97      *
98      * @param slotId sim slot id
99      * @param networkStatus network status
100      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
101      */
102     virtual int32_t UpdateNetworkState(int32_t slotId, const sptr<NetworkState> &networkState) = 0;
103 
104     /**
105      * Update call forward unconditionally indicator
106      *
107      * @param slotId sim slot id
108      * @param cfuResult set the result of call forwarding
109      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
110      */
111     virtual int32_t UpdateCfuIndicator(int32_t slotId, bool cfuResult) = 0;
112 
113     virtual int32_t UpdateIccAccount() = 0;
114 
115     /**
116      * Update voice mail message indicator
117      *
118      * @param slotId sim slot id
119      * @param voiceMailMsgResult voice mail message indicator
120      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
121      */
122     virtual int32_t UpdateVoiceMailMsgIndicator(int32_t slotId, bool voiceMailMsgResult) = 0;
123 
124     /**
125      * RegisterStateChange
126      *
127      * @param telephonyObserver api callback
128      * @param slotId sim slot id
129      * @param mask listening type bitmask
130      * @param isUpdate Whether to update immediately
131      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
132      */
133     virtual int32_t RegisterStateChange(
134         const sptr<TelephonyObserverBroker> &telephonyObserver, int32_t slotId, uint32_t mask, bool isUpdate) = 0;
135 
136     /**
137      * UnregisterStateChange
138      *
139      * @param slotId sim slot id
140      * @param mask listening type bitmask
141      * @return int32_t TELEPHONY_SUCCESS on success, others on failure.
142      */
143     virtual int32_t UnregisterStateChange(int32_t slotId, uint32_t mask) = 0;
144 
145 public:
146     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ITelephonyStateNotify");
147 };
148 } // namespace Telephony
149 } // namespace OHOS
150 #endif // OHOS_I_TELEPHONY_STATE_NOTIFY_H
151