1 /* 2 * Copyright (C) 2021 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_MANAGER_H 17 #define TELEPHONY_STATE_MANAGER_H 18 19 #include <stdint.h> 20 21 namespace OHOS { 22 template<typename T> 23 class sptr; 24 namespace Telephony { 25 /** 26 * @brief Indicates the detailed state of call. 27 */ 28 enum class TelCallState { 29 /** 30 * Indicates the call is unknown. 31 */ 32 CALL_STATUS_UNKNOWN = -1, 33 /** 34 * Indicates the call is active. 35 */ 36 CALL_STATUS_ACTIVE = 0, 37 /** 38 * Indicates the call is holding. 39 */ 40 CALL_STATUS_HOLDING, 41 /** 42 * Indicates the call is dialing. 43 */ 44 CALL_STATUS_DIALING, 45 /** 46 * Indicates the call is alerting. 47 */ 48 CALL_STATUS_ALERTING, 49 /** 50 * Indicates the call is incoming. 51 */ 52 CALL_STATUS_INCOMING, 53 /** 54 * Indicates the call is waiting. 55 */ 56 CALL_STATUS_WAITING, 57 /** 58 * Indicates the call is disconnected. 59 */ 60 CALL_STATUS_DISCONNECTED, 61 /** 62 * Indicates the call is disconnecting. 63 */ 64 CALL_STATUS_DISCONNECTING, 65 /** 66 * Indicates the call is idle. 67 */ 68 CALL_STATUS_IDLE, 69 }; 70 71 class TelephonyObserverBroker; 72 class TelephonyStateManager { 73 public: 74 static int32_t AddStateObserver(const sptr<TelephonyObserverBroker> &telephonyObserver, 75 int32_t slotId, uint32_t mask, bool notifyNow); 76 static int32_t RemoveStateObserver(int32_t slotId, uint32_t mask); 77 }; 78 } // namespace Telephony 79 } // namespace OHOS 80 #endif // TELEPHONY_STATE_MANAGER_H