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