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