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 COMMON_TYPE_H 17 #define COMMON_TYPE_H 18 19 #include <cstdio> 20 #include <list> 21 #include <string> 22 23 #include "call_manager_inner_type.h" 24 #include "telephony_log_wrapper.h" 25 26 const int16_t RINGING_CALL_NUMBER_LEN = 30; 27 const int16_t DIALING_CALL_NUMBER_LEN = 30; 28 const int16_t CONTACT_NAME_LEN = 10; 29 const int16_t FILE_PATH_MAX_LEN = 60; 30 const int16_t CALL_START_ID = 0; 31 const int16_t MIN_MULITY_CALL_COUNT = 2; 32 33 namespace OHOS { 34 namespace Telephony { 35 struct DialParaInfo { DialParaInfoDialParaInfo36 DialParaInfo() : accountId(0), callId(0), index(0), dialType(DialType::DIAL_CARRIER_TYPE), 37 videoState(VideoStateType::TYPE_VOICE), callType(CallType::TYPE_ERR_CALL), 38 callState(TelCallState::CALL_STATUS_IDLE), isDialing(false), isEcc(false) {} 39 int32_t accountId = 0; 40 int32_t callId = 0; 41 int32_t index = 0; 42 std::string number = ""; 43 DialType dialType = DialType::DIAL_CARRIER_TYPE; 44 VideoStateType videoState = VideoStateType::TYPE_VOICE; 45 CallType callType = CallType::TYPE_ERR_CALL; 46 TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; 47 bool isDialing = false; 48 bool isEcc = false; 49 std::string bundleName = ""; 50 int32_t crsType = 0; 51 int32_t originalCallType = 0; 52 VoipCallReportInfo voipCallInfo; 53 }; 54 55 enum PolicyFlag : uint64_t { 56 // Denote playing ring tone 57 POLICY_FLAG_PLAY_RINGTONE = 0x00000001, 58 // Denote vibration prompt 59 POLICY_FLAG_VIBRATING_ALERT = 0x00000002, 60 // Represents the play prompt tone 61 POLICY_FLAG_PLAY_SOUND = 0x00000004, 62 // Represents an audio routing handset 63 POLICY_FLAG_AUDIO_DEVICE_EARPIECE = 0x00000008, 64 // Represents an audio routing speaker 65 POLICY_FLAG_AUDIO_DEVICE_SPEAKER = 0x00000010, 66 // Represents audio routing wired headset 67 POLICY_FLAG_AUDIO_DEVICE_WIRED_HEADSET = 0x00000020, 68 // Represents an audio routing Bluetooth headset 69 POLICY_FLAG_AUDIO_DEVICE_BLUETOOTH = 0x00000040, 70 // Indicates that no audio device is active 71 POLICY_FLAG_AUDIO_DEVICE_DISABLE = 0x00000080, 72 // release the held call and the wait call 73 POLICY_FLAG_HANG_UP_HOLD_WAIT = 0x00000100, 74 // release the active call and recover the held call 75 POLICY_FLAG_HANG_UP_ACTIVE = 0x00000200, 76 // release all calls 77 POLICY_FLAG_HANG_UP_ALL = 0x00000400, 78 }; 79 80 struct ContactInfo { 81 std::string name = ""; 82 std::string number = ""; 83 bool isContacterExists = false; 84 char ringtonePath[FILE_PATH_MAX_LEN] = { 0 }; 85 bool isSendToVoicemail = false; 86 bool isEcc = false; 87 bool isVoiceMail = false; 88 bool isQueryComplete = false; 89 }; 90 } // namespace Telephony 91 } // namespace OHOS 92 93 #endif // COMMON_TYPE_H 94