• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 };
50 
51 enum PolicyFlag : uint64_t {
52     // Denote playing ring tone
53     POLICY_FLAG_PLAY_RINGTONE = 0x00000001,
54     // Denote vibration prompt
55     POLICY_FLAG_VIBRATING_ALERT = 0x00000002,
56     // Represents the play prompt tone
57     POLICY_FLAG_PLAY_SOUND = 0x00000004,
58     // Represents an audio routing handset
59     POLICY_FLAG_AUDIO_DEVICE_EARPIECE = 0x00000008,
60     // Represents an audio routing speaker
61     POLICY_FLAG_AUDIO_DEVICE_SPEAKER = 0x00000010,
62     // Represents audio routing wired headset
63     POLICY_FLAG_AUDIO_DEVICE_WIRED_HEADSET = 0x00000020,
64     // Represents an audio routing Bluetooth headset
65     POLICY_FLAG_AUDIO_DEVICE_BLUETOOTH = 0x00000040,
66     // Indicates that no audio device is active
67     POLICY_FLAG_AUDIO_DEVICE_DISABLE = 0x00000080,
68     // release the held call and the wait call
69     POLICY_FLAG_HANG_UP_HOLD_WAIT = 0x00000100,
70     // release the active call and recover the held call
71     POLICY_FLAG_HANG_UP_ACTIVE = 0x00000200,
72     // release all calls
73     POLICY_FLAG_HANG_UP_ALL = 0x00000400,
74 };
75 
76 struct ContactInfo {
77     char name[CONTACT_NAME_LEN] = { 0 };
78     char number[kMaxNumberLen] = { 0 };
79     bool isContacterExists = false;
80     char ringtonePath[FILE_PATH_MAX_LEN] = { 0 };
81     bool isSendToVoicemail = false;
82     bool isEcc = false;
83     bool isVoiceMail = false;
84 };
85 } // namespace Telephony
86 } // namespace OHOS
87 
88 #endif // COMMON_TYPE_H
89