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