1#!/usr/bin/env python3
2#
3#   Copyright 2016 - Google
4#
5#   Licensed under the Apache License, Version 2.0 (the "License");
6#   you may not use this file except in compliance with the License.
7#   You may obtain a copy of the License at
8#
9#       http://www.apache.org/licenses/LICENSE-2.0
10#
11#   Unless required by applicable law or agreed to in writing, software
12#   distributed under the License is distributed on an "AS IS" BASIS,
13#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14#   See the License for the specific language governing permissions and
15#   limitations under the License.
16
17###############################################
18# TIMERS
19###############################################
20# Max time to wait for phone data/network connection state update
21MAX_WAIT_TIME_CONNECTION_STATE_UPDATE = 60
22
23# Max time to wait for network reselection
24MAX_WAIT_TIME_NW_SELECTION = 180
25
26# Max time to wait for call drop
27MAX_WAIT_TIME_CALL_DROP = 60
28
29# Wait time between state check retry
30WAIT_TIME_BETWEEN_STATE_CHECK = 5
31
32# Max wait time for state change
33MAX_WAIT_TIME_FOR_STATE_CHANGE = 60
34
35# Max time to wait after caller make a call and before
36# callee start ringing
37MAX_WAIT_TIME_CALLEE_RINGING = 90
38
39# country code list
40COUNTRY_CODE_LIST = [
41    "+1", "+44", "+39", "+61", "+49", "+34", "+33", "+47", "+246", "+86",
42    "+850", "+81"
43]
44
45# default pin/password
46DEFAULT_DEVICE_PASSWORD = "1111"
47
48# Wait time after enterring puk code
49WAIT_TIME_SUPPLY_PUK_CODE = 30
50
51# Max time to wait after caller make a call and before
52# callee start ringing
53MAX_WAIT_TIME_ACCEPT_CALL_TO_OFFHOOK_EVENT = 30
54
55# Max time to wait for "onCallStatehangedIdle" event after reject or ignore
56# incoming call
57MAX_WAIT_TIME_CALL_IDLE_EVENT = 60
58
59# Max time to wait after initiating a call for telecom to report in-call
60MAX_WAIT_TIME_CALL_INITIATION = 90
61
62# Time to wait after change Mode Pref for Stress Test
63WAIT_TIME_AFTER_MODE_CHANGE = 60
64
65# Max time to wait for Carrier Config Version to Update in mins
66WAIT_TIME_FOR_CARRIERCONFIG_CHANGE = 20
67
68# Max time to wait for Emergency DB Version to Update in mins
69WAIT_TIME_FOR_ER_DB_CHANGE = 10
70
71# Max time to wait after toggle airplane mode and before
72# get expected event
73MAX_WAIT_TIME_AIRPLANEMODE_EVENT = 90
74
75# Max time to wait after device sent an SMS and before
76# get "onSmsSentSuccess" event
77MAX_WAIT_TIME_SMS_SENT_SUCCESS = 60
78
79# Max time to wait after device sent an SMS and before
80# get "onSmsSentSuccess" event in case of collision.
81MAX_WAIT_TIME_SMS_SENT_SUCCESS_IN_COLLISION = 60
82
83# Max time to wait after MT SMS was sent and before device
84# actually receive this MT SMS.
85MAX_WAIT_TIME_SMS_RECEIVE = 120
86
87# Max time to wait after MT SMS was sent and before device
88# actually receive this MT SMS in case of collision.
89MAX_WAIT_TIME_SMS_RECEIVE_IN_COLLISION = 1200
90
91# Max time to wait for IMS registration
92MAX_WAIT_TIME_IMS_REGISTRATION = 120
93
94# TODO: b/26338156 MAX_WAIT_TIME_VOLTE_ENABLED and MAX_WAIT_TIME_WFC_ENABLED should only
95# be used for wait after IMS registration.
96
97# Max time to wait for VoLTE enabled flag to be True
98MAX_WAIT_TIME_VOLTE_ENABLED = MAX_WAIT_TIME_IMS_REGISTRATION + 60
99
100# Max time to wait for WFC enabled flag to be True
101MAX_WAIT_TIME_WFC_ENABLED = MAX_WAIT_TIME_IMS_REGISTRATION + 120
102
103# Max time to wait for WFC enabled flag to be False
104MAX_WAIT_TIME_WFC_DISABLED = 60
105
106# Max time to wait for WiFi Manager to Connect to an AP
107MAX_WAIT_TIME_WIFI_CONNECTION = 30
108
109# Max time to wait for Video Session Modify Messaging
110MAX_WAIT_TIME_VIDEO_SESSION_EVENT = 10
111
112# Max time to wait after a network connection for ConnectivityManager to
113# report a working user plane data connection
114MAX_WAIT_TIME_USER_PLANE_DATA = 20
115
116# Max time to wait for tethering entitlement check
117MAX_WAIT_TIME_TETHERING_ENTITLEMENT_CHECK = 60
118
119# Max time to wait for voice mail count report correct result.
120MAX_WAIT_TIME_VOICE_MAIL_COUNT = 90
121
122# Max time to wait for data SIM change
123MAX_WAIT_TIME_DATA_SUB_CHANGE = 150
124
125# Max time to wait for telecom Ringing status after receive ringing event
126MAX_WAIT_TIME_TELECOM_RINGING = 5
127
128# Max time to wait for phone get provisioned.
129MAX_WAIT_TIME_PROVISIONING = 300
130
131# Time to wait after call setup before declaring
132# that the call is actually successful
133WAIT_TIME_IN_CALL = 30
134
135# (For IMS, e.g. VoLTE-VoLTE, WFC-WFC, VoLTE-WFC test only)
136# Time to wait after call setup before declaring
137# that the call is actually successful
138WAIT_TIME_IN_CALL_FOR_IMS = 30
139
140# Time to wait after phone receive incoming call before phone reject this call.
141WAIT_TIME_REJECT_CALL = 2
142
143# Time to leave a voice message after callee reject the incoming call
144WAIT_TIME_LEAVE_VOICE_MAIL = 30
145
146# Time to wait after accept video call and before checking state
147WAIT_TIME_ACCEPT_VIDEO_CALL_TO_CHECK_STATE = 2
148
149# Time delay to ensure user actions are performed in
150# 'human' time rather than at the speed of the script
151WAIT_TIME_ANDROID_STATE_SETTLING = 1
152
153# Time to wait after registration to ensure the phone
154# has sufficient time to reconfigure based on new network
155WAIT_TIME_BETWEEN_REG_AND_CALL = 5
156
157# Wait time for data pdn to be up on CBRS
158WAIT_TIME_FOR_CBRS_DATA_SWITCH = 60
159
160# Time to wait for 1xrtt voice attach check
161# After DUT voice network type report 1xrtt (from unknown), it need to wait for
162# several seconds before the DUT can receive incoming call.
163WAIT_TIME_1XRTT_VOICE_ATTACH = 30
164
165# Time to wait for data status change during wifi tethering,.
166WAIT_TIME_DATA_STATUS_CHANGE_DURING_WIFI_TETHERING = 30
167
168# Time to wait for rssi calibration.
169# This is the delay between <WiFi Connected> and <Turn on Screen to get RSSI>.
170WAIT_TIME_WIFI_RSSI_CALIBRATION_WIFI_CONNECTED = 10
171# This is the delay between <Turn on Screen> and <Call API to get WiFi RSSI>.
172WAIT_TIME_WIFI_RSSI_CALIBRATION_SCREEN_ON = 2
173
174# Time to wait for each operation on voice mail box.
175WAIT_TIME_VOICE_MAIL_SERVER_RESPONSE = 10
176
177# Time to wait for radio to up and running after reboot
178WAIT_TIME_AFTER_REBOOT = 10
179
180# Time to wait for radio to up and running after force crash
181WAIT_TIME_AFTER_CRASH = 60
182
183# Time to wait for factory data reset
184WAIT_TIME_AFTER_FDR = 60
185
186# Time to wait for boot complete after reboot
187WAIT_TIME_FOR_BOOT_COMPLETE = 75
188
189# Time to wait for tethering test after reboot
190WAIT_TIME_TETHERING_AFTER_REBOOT = 10
191
192# Time to wait after changing data sub id
193WAIT_TIME_CHANGE_DATA_SUB_ID = 30
194
195# Time to wait after changing voice sub id
196WAIT_TIME_CHANGE_VOICE_SUB_ID = 5
197
198# Time to wait after changing message sub id
199WAIT_TIME_CHANGE_MESSAGE_SUB_ID = 5
200
201# Wait time for Data Stall to detect
202WAIT_TIME_FOR_DATA_STALL = 300
203
204# Wait time for Network Validation Failed detection
205WAIT_TIME_FOR_NW_VALID_FAIL = 300
206
207# Wait time for Data Stall to recover
208WAIT_TIME_FOR_DATA_STALL_RECOVERY = 360
209
210# Callbox Power level which will cause no service on device
211POWER_LEVEL_OUT_OF_SERVICE = -100
212
213# Callbox Power level which will ensure full service on device
214POWER_LEVEL_FULL_SERVICE = -20
215
216
217
218# These are used in phone_number_formatter
219PHONE_NUMBER_STRING_FORMAT_7_DIGIT = 7
220PHONE_NUMBER_STRING_FORMAT_10_DIGIT = 10
221PHONE_NUMBER_STRING_FORMAT_11_DIGIT = 11
222PHONE_NUMBER_STRING_FORMAT_12_DIGIT = 12
223
224# MAX screen-on time during test (in unit of second)
225MAX_SCREEN_ON_TIME = 1800
226
227# In Voice Mail box, press this digit to delete one message.
228VOICEMAIL_DELETE_DIGIT = '7'
229
230# MAX number of saved voice mail in voice mail box.
231MAX_SAVED_VOICE_MAIL = 25
232
233# SIM1 slot index
234SIM1_SLOT_INDEX = 0
235
236# SIM2 slot index
237SIM2_SLOT_INDEX = 1
238
239# invalid Subscription ID
240INVALID_SUB_ID = -1
241
242# invalid SIM slot index
243INVALID_SIM_SLOT_INDEX = -1
244
245# WiFI RSSI is -127 if WiFi is not connected
246INVALID_WIFI_RSSI = -127
247
248# MAX and MIN value for attenuator settings
249ATTEN_MAX_VALUE = 95
250ATTEN_MIN_VALUE = 0
251
252MAX_RSSI_RESERVED_VALUE = 100
253MIN_RSSI_RESERVED_VALUE = -200
254
255# cellular weak RSSI value
256CELL_WEAK_RSSI_VALUE = -105
257# cellular strong RSSI value
258CELL_STRONG_RSSI_VALUE = -70
259# WiFi weak RSSI value
260WIFI_WEAK_RSSI_VALUE = -63
261
262# Emergency call number
263DEFAULT_EMERGENCY_CALL_NUMBER = "911"
264
265EMERGENCY_CALL_NUMBERS = [
266    "08", "000", "110", "112", "118", "119", "911", "999", "*911", "#911"
267]
268
269AOSP_PREFIX = "aosp_"
270
271INCALL_UI_DISPLAY_FOREGROUND = "foreground"
272INCALL_UI_DISPLAY_BACKGROUND = "background"
273INCALL_UI_DISPLAY_DEFAULT = "default"
274
275NETWORK_CONNECTION_TYPE_WIFI = 'wifi'
276NETWORK_CONNECTION_TYPE_CELL = 'cell'
277NETWORK_CONNECTION_TYPE_MMS = 'mms'
278NETWORK_CONNECTION_TYPE_HIPRI = 'hipri'
279NETWORK_CONNECTION_TYPE_UNKNOWN = 'unknown'
280
281TETHERING_MODE_WIFI = 'wifi'
282
283# Tether interface types defined in ConnectivityManager
284TETHERING_INVALID = -1
285TETHERING_WIFI = 0
286TETHERING_USB = 1
287TETHERING_BLUETOOTH = 2
288
289NETWORK_SERVICE_VOICE = 'voice'
290NETWORK_SERVICE_DATA = 'data'
291
292CARRIER_VZW = 'vzw'
293CARRIER_ATT = 'att'
294CARRIER_TMO = 'tmo'
295CARRIER_SPT = 'spt'
296CARRIER_EEUK = 'eeuk'
297CARRIER_VFUK = 'vfuk'
298CARRIER_UNKNOWN = 'unknown'
299CARRIER_GMBH = 'gmbh'
300CARRIER_ITA = 'ita'
301CARRIER_ESP = 'esp'
302CARRIER_ORG = 'org'
303CARRIER_TEL = 'tel'
304CARRIER_TSA = 'tsa'
305CARRIER_SING = 'singtel'
306CARRIER_USCC = 'uscc'
307CARRIER_ROGERS = 'ROGERS'
308CARRIER_TELUS = 'tls'
309CARRIER_KOODO = 'kdo'
310CARRIER_VIDEOTRON = 'vtrn'
311CARRIER_BELL = 'bell'
312CARRIER_FRE = 'fre'
313CARRIER_FI = 'fi'
314CARRIER_NTT_DOCOMO = 'ntt_docomo'
315CARRIER_KDDI = 'kddi'
316CARRIER_RAKUTEN = 'rakuten'
317CARRIER_SBM = 'sbm'
318
319RAT_FAMILY_CDMA = 'cdma'
320RAT_FAMILY_CDMA2000 = 'cdma2000'
321RAT_FAMILY_IDEN = 'iden'
322RAT_FAMILY_GSM = 'gsm'
323RAT_FAMILY_WCDMA = 'wcdma'
324RAT_FAMILY_UMTS = RAT_FAMILY_WCDMA
325RAT_FAMILY_WLAN = 'wlan'
326RAT_FAMILY_LTE = 'lte'
327RAT_FAMILY_NR = 'nr'
328RAT_FAMILY_TDSCDMA = 'tdscdma'
329RAT_FAMILY_UNKNOWN = 'unknown'
330
331CAPABILITY_PHONE = 'phone'
332CAPABILITY_VOLTE = 'volte'
333CAPABILITY_VT = 'vt'
334CAPABILITY_WFC = 'wfc'
335CAPABILITY_MSIM = 'msim'
336CAPABILITY_OMADM = 'omadm'
337CAPABILITY_WFC_MODE_CHANGE = 'wfc_mode_change'
338CAPABILITY_CONFERENCE = 'conference'
339CAPABILITY_VOLTE_PROVISIONING = 'volte_provisioning'
340CAPABILITY_VOLTE_OVERRIDE_WFC_PROVISIONING = 'volte_override_wfc_provisioning'
341CAPABILITY_HIDE_ENHANCED_4G_LTE_BOOL = 'hide_enhanced_4g_lte'
342
343# Carrier Config Versions
344VZW_CARRIER_CONFIG_VERSION = "29999999999.1"
345ATT_CARRIER_CONFIG_VERSION = "28888888888.1"
346
347# Constant for operation direction
348DIRECTION_MOBILE_ORIGINATED = "MO"
349DIRECTION_MOBILE_TERMINATED = "MT"
350
351# Constant for call teardown side
352CALL_TEARDOWN_PHONE = "PHONE"
353CALL_TEARDOWN_REMOTE = "REMOTE"
354
355WIFI_VERBOSE_LOGGING_ENABLED = 1
356WIFI_VERBOSE_LOGGING_DISABLED = 0
357"""
358Begin shared constant define for both Python and Java
359"""
360
361# Constant for WiFi Calling WFC mode
362WFC_MODE_WIFI_ONLY = "WIFI_ONLY"
363WFC_MODE_CELLULAR_PREFERRED = "CELLULAR_PREFERRED"
364WFC_MODE_WIFI_PREFERRED = "WIFI_PREFERRED"
365WFC_MODE_DISABLED = "DISABLED"
366WFC_MODE_UNKNOWN = "UNKNOWN"
367
368# Constant for Video Telephony VT state
369VT_STATE_AUDIO_ONLY = "AUDIO_ONLY"
370VT_STATE_TX_ENABLED = "TX_ENABLED"
371VT_STATE_RX_ENABLED = "RX_ENABLED"
372VT_STATE_BIDIRECTIONAL = "BIDIRECTIONAL"
373VT_STATE_TX_PAUSED = "TX_PAUSED"
374VT_STATE_RX_PAUSED = "RX_PAUSED"
375VT_STATE_BIDIRECTIONAL_PAUSED = "BIDIRECTIONAL_PAUSED"
376VT_STATE_STATE_INVALID = "INVALID"
377
378# Constant for Video Telephony Video quality
379VT_VIDEO_QUALITY_DEFAULT = "DEFAULT"
380VT_VIDEO_QUALITY_UNKNOWN = "UNKNOWN"
381VT_VIDEO_QUALITY_HIGH = "HIGH"
382VT_VIDEO_QUALITY_MEDIUM = "MEDIUM"
383VT_VIDEO_QUALITY_LOW = "LOW"
384VT_VIDEO_QUALITY_INVALID = "INVALID"
385
386# Constant for Call State (for call object)
387CALL_STATE_ACTIVE = "ACTIVE"
388CALL_STATE_NEW = "NEW"
389CALL_STATE_DIALING = "DIALING"
390CALL_STATE_RINGING = "RINGING"
391CALL_STATE_HOLDING = "HOLDING"
392CALL_STATE_DISCONNECTED = "DISCONNECTED"
393CALL_STATE_PRE_DIAL_WAIT = "PRE_DIAL_WAIT"
394CALL_STATE_CONNECTING = "CONNECTING"
395CALL_STATE_DISCONNECTING = "DISCONNECTING"
396CALL_STATE_UNKNOWN = "UNKNOWN"
397CALL_STATE_INVALID = "INVALID"
398
399# Constant for PRECISE Call State (for call object)
400PRECISE_CALL_STATE_ACTIVE = "ACTIVE"
401PRECISE_CALL_STATE_ALERTING = "ALERTING"
402PRECISE_CALL_STATE_DIALING = "DIALING"
403PRECISE_CALL_STATE_INCOMING = "INCOMING"
404PRECISE_CALL_STATE_HOLDING = "HOLDING"
405PRECISE_CALL_STATE_DISCONNECTED = "DISCONNECTED"
406PRECISE_CALL_STATE_WAITING = "WAITING"
407PRECISE_CALL_STATE_DISCONNECTING = "DISCONNECTING"
408PRECISE_CALL_STATE_IDLE = "IDLE"
409PRECISE_CALL_STATE_UNKNOWN = "UNKNOWN"
410PRECISE_CALL_STATE_INVALID = "INVALID"
411
412# Constant for DC POWER STATE
413DC_POWER_STATE_LOW = "LOW"
414DC_POWER_STATE_HIGH = "HIGH"
415DC_POWER_STATE_MEDIUM = "MEDIUM"
416DC_POWER_STATE_UNKNOWN = "UNKNOWN"
417
418# Constant for Audio Route
419AUDIO_ROUTE_EARPIECE = "EARPIECE"
420AUDIO_ROUTE_BLUETOOTH = "BLUETOOTH"
421AUDIO_ROUTE_SPEAKER = "SPEAKER"
422AUDIO_ROUTE_WIRED_HEADSET = "WIRED_HEADSET"
423AUDIO_ROUTE_WIRED_OR_EARPIECE = "WIRED_OR_EARPIECE"
424
425# Constant for Call Capability
426CALL_CAPABILITY_HOLD = "HOLD"
427CALL_CAPABILITY_SUPPORT_HOLD = "SUPPORT_HOLD"
428CALL_CAPABILITY_MERGE_CONFERENCE = "MERGE_CONFERENCE"
429CALL_CAPABILITY_SWAP_CONFERENCE = "SWAP_CONFERENCE"
430CALL_CAPABILITY_UNUSED_1 = "UNUSED_1"
431CALL_CAPABILITY_RESPOND_VIA_TEXT = "RESPOND_VIA_TEXT"
432CALL_CAPABILITY_MUTE = "MUTE"
433CALL_CAPABILITY_MANAGE_CONFERENCE = "MANAGE_CONFERENCE"
434CALL_CAPABILITY_SUPPORTS_VT_LOCAL_RX = "SUPPORTS_VT_LOCAL_RX"
435CALL_CAPABILITY_SUPPORTS_VT_LOCAL_TX = "SUPPORTS_VT_LOCAL_TX"
436CALL_CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = "SUPPORTS_VT_LOCAL_BIDIRECTIONAL"
437CALL_CAPABILITY_SUPPORTS_VT_REMOTE_RX = "SUPPORTS_VT_REMOTE_RX"
438CALL_CAPABILITY_SUPPORTS_VT_REMOTE_TX = "SUPPORTS_VT_REMOTE_TX"
439CALL_CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = "SUPPORTS_VT_REMOTE_BIDIRECTIONAL"
440CALL_CAPABILITY_SEPARATE_FROM_CONFERENCE = "SEPARATE_FROM_CONFERENCE"
441CALL_CAPABILITY_DISCONNECT_FROM_CONFERENCE = "DISCONNECT_FROM_CONFERENCE"
442CALL_CAPABILITY_SPEED_UP_MT_AUDIO = "SPEED_UP_MT_AUDIO"
443CALL_CAPABILITY_CAN_UPGRADE_TO_VIDEO = "CAN_UPGRADE_TO_VIDEO"
444CALL_CAPABILITY_CAN_PAUSE_VIDEO = "CAN_PAUSE_VIDEO"
445CALL_CAPABILITY_UNKOWN = "UNKOWN"
446
447# Constant for Call Property
448CALL_PROPERTY_HIGH_DEF_AUDIO = "HIGH_DEF_AUDIO"
449CALL_PROPERTY_CONFERENCE = "CONFERENCE"
450CALL_PROPERTY_GENERIC_CONFERENCE = "GENERIC_CONFERENCE"
451CALL_PROPERTY_WIFI = "WIFI"
452CALL_PROPERTY_EMERGENCY_CALLBACK_MODE = "EMERGENCY_CALLBACK_MODE"
453CALL_PROPERTY_UNKNOWN = "UNKNOWN"
454
455# Constant for Call Presentation
456CALL_PRESENTATION_ALLOWED = "ALLOWED"
457CALL_PRESENTATION_RESTRICTED = "RESTRICTED"
458CALL_PRESENTATION_PAYPHONE = "PAYPHONE"
459CALL_PRESENTATION_UNKNOWN = "UNKNOWN"
460
461# Constant for Network Generation
462GEN_2G = "2G"
463GEN_3G = "3G"
464GEN_4G = "4G"
465GEN_5G = "5G"
466GEN_UNKNOWN = "UNKNOWN"
467
468# Constant for Network RAT
469RAT_IWLAN = "IWLAN"
470RAT_NR = "NR"
471RAT_LTE = "LTE"
472RAT_5G = "5G"
473RAT_4G = "4G"
474RAT_3G = "3G"
475RAT_2G = "2G"
476RAT_WCDMA = "WCDMA"
477RAT_UMTS = "UMTS"
478RAT_1XRTT = "1XRTT"
479RAT_EDGE = "EDGE"
480RAT_GPRS = "GPRS"
481RAT_HSDPA = "HSDPA"
482RAT_HSUPA = "HSUPA"
483RAT_CDMA = "CDMA"
484RAT_EVDO = "EVDO"
485RAT_EVDO_0 = "EVDO_0"
486RAT_EVDO_A = "EVDO_A"
487RAT_EVDO_B = "EVDO_B"
488RAT_IDEN = "IDEN"
489RAT_EHRPD = "EHRPD"
490RAT_HSPA = "HSPA"
491RAT_HSPAP = "HSPAP"
492RAT_GSM = "GSM"
493RAT_TD_SCDMA = "TD_SCDMA"
494RAT_GLOBAL = "GLOBAL"
495RAT_LTE_CA = "LTE_CA"  # LTE Carrier Aggregation
496RAT_UNKNOWN = "UNKNOWN"
497
498# Constant for Phone Type
499PHONE_TYPE_GSM = "GSM"
500PHONE_TYPE_NONE = "NONE"
501PHONE_TYPE_CDMA = "CDMA"
502PHONE_TYPE_SIP = "SIP"
503
504# Constant for SIM Power State
505CARD_POWER_DOWN = 0
506CARD_POWER_UP = 1
507CARD_POWER_UP_PASS_THROUGH = 2
508
509# Constant for SIM State
510SIM_STATE_READY = "READY"
511SIM_STATE_UNKNOWN = "UNKNOWN"
512SIM_STATE_ABSENT = "ABSENT"
513SIM_STATE_PUK_REQUIRED = "PUK_REQUIRED"
514SIM_STATE_PIN_REQUIRED = "PIN_REQUIRED"
515SIM_STATE_NETWORK_LOCKED = "NETWORK_LOCKED"
516SIM_STATE_NOT_READY = "NOT_READY"
517SIM_STATE_PERM_DISABLED = "PERM_DISABLED"
518SIM_STATE_CARD_IO_ERROR = "CARD_IO_ERROR"
519SIM_STATE_LOADED = "LOADED"
520
521SINGLE_SIM_CONFIG = "ssss"
522MULTI_SIM_CONFIG = "dsds"
523
524# Constant for Data Connection State
525DATA_STATE_CONNECTED = "CONNECTED"
526DATA_STATE_DISCONNECTED = "DISCONNECTED"
527DATA_STATE_CONNECTING = "CONNECTING"
528DATA_STATE_SUSPENDED = "SUSPENDED"
529DATA_STATE_UNKNOWN = "UNKNOWN"
530
531# Constant for Data Roaming State
532DATA_ROAMING_ENABLE = 1
533DATA_ROAMING_DISABLE = 0
534
535# Constant for ConnectivityManager Data Connection
536TYPE_MOBILE = 0
537TYPE_WIFI = 1
538
539# Constant for Telephony Manager Call State
540TELEPHONY_STATE_RINGING = "RINGING"
541TELEPHONY_STATE_IDLE = "IDLE"
542TELEPHONY_STATE_OFFHOOK = "OFFHOOK"
543TELEPHONY_STATE_UNKNOWN = "UNKNOWN"
544
545# Constant for TTY Mode
546TTY_MODE_FULL = "FULL"
547TTY_MODE_HCO = "HCO"
548TTY_MODE_OFF = "OFF"
549TTY_MODE_VCO = "VCO"
550
551# Constant for Service State
552SERVICE_STATE_EMERGENCY_ONLY = "EMERGENCY_ONLY"
553SERVICE_STATE_IN_SERVICE = "IN_SERVICE"
554SERVICE_STATE_OUT_OF_SERVICE = "OUT_OF_SERVICE"
555SERVICE_STATE_POWER_OFF = "POWER_OFF"
556SERVICE_STATE_UNKNOWN = "UNKNOWN"
557
558# Service State Mapping
559SERVICE_STATE_MAPPING = {
560    "-1": SERVICE_STATE_UNKNOWN,
561    "0": SERVICE_STATE_IN_SERVICE,
562    "1": SERVICE_STATE_OUT_OF_SERVICE,
563    "2": SERVICE_STATE_EMERGENCY_ONLY,
564    "3": SERVICE_STATE_POWER_OFF
565}
566
567# Constant for VoLTE Hand-over Service State
568VOLTE_SERVICE_STATE_HANDOVER_STARTED = "STARTED"
569VOLTE_SERVICE_STATE_HANDOVER_COMPLETED = "COMPLETED"
570VOLTE_SERVICE_STATE_HANDOVER_FAILED = "FAILED"
571VOLTE_SERVICE_STATE_HANDOVER_CANCELED = "CANCELED"
572VOLTE_SERVICE_STATE_HANDOVER_UNKNOWN = "UNKNOWN"
573
574# Constant for precise call state state listen level
575PRECISE_CALL_STATE_LISTEN_LEVEL_FOREGROUND = "FOREGROUND"
576PRECISE_CALL_STATE_LISTEN_LEVEL_RINGING = "RINGING"
577PRECISE_CALL_STATE_LISTEN_LEVEL_BACKGROUND = "BACKGROUND"
578
579# Constants used to register or de-register for call callback events
580EVENT_CALL_STATE_CHANGED = "EVENT_STATE_CHANGED"
581EVENT_CALL_CHILDREN_CHANGED = "EVENT_CHILDREN_CHANGED"
582
583# Constants used to register or de-register for video call callback events
584EVENT_VIDEO_SESSION_MODIFY_REQUEST_RECEIVED = "EVENT_VIDEO_SESSION_MODIFY_REQUEST_RECEIVED"
585EVENT_VIDEO_SESSION_MODIFY_RESPONSE_RECEIVED = "EVENT_VIDEO_SESSION_MODIFY_RESPONSE_RECEIVED"
586EVENT_VIDEO_SESSION_EVENT = "EVENT_VIDEO_SESSION_EVENT"
587EVENT_VIDEO_PEER_DIMENSIONS_CHANGED = "EVENT_VIDEO_PEER_DIMENSIONS_CHANGED"
588EVENT_VIDEO_QUALITY_CHANGED = "EVENT_VIDEO_QUALITY_CHANGED"
589EVENT_VIDEO_DATA_USAGE_CHANGED = "EVENT_VIDEO_DATA_USAGE_CHANGED"
590EVENT_VIDEO_CAMERA_CAPABILITIES_CHANGED = "EVENT_VIDEO_CAMERA_CAPABILITIES_CHANGED"
591EVENT_VIDEO_INVALID = "EVENT_VIDEO_INVALID"
592
593# Constant for Video Call Session Event Name
594SESSION_EVENT_RX_PAUSE = "SESSION_EVENT_RX_PAUSE"
595SESSION_EVENT_RX_RESUME = "SESSION_EVENT_RX_RESUME"
596SESSION_EVENT_TX_START = "SESSION_EVENT_TX_START"
597SESSION_EVENT_TX_STOP = "SESSION_EVENT_TX_STOP"
598SESSION_EVENT_CAMERA_FAILURE = "SESSION_EVENT_CAMERA_FAILURE"
599SESSION_EVENT_CAMERA_READY = "SESSION_EVENT_CAMERA_READY"
600SESSION_EVENT_UNKNOWN = "SESSION_EVENT_UNKNOWN"
601
602NETWORK_MODE_WCDMA_PREF = "NETWORK_MODE_WCDMA_PREF"
603NETWORK_MODE_GSM_ONLY = "NETWORK_MODE_GSM_ONLY"
604NETWORK_MODE_WCDMA_ONLY = "NETWORK_MODE_WCDMA_ONLY"
605NETWORK_MODE_GSM_UMTS = "NETWORK_MODE_GSM_UMTS"
606NETWORK_MODE_CDMA = "NETWORK_MODE_CDMA"
607NETWORK_MODE_CDMA_NO_EVDO = "NETWORK_MODE_CDMA_NO_EVDO"
608NETWORK_MODE_EVDO_NO_CDMA = "NETWORK_MODE_EVDO_NO_CDMA"
609NETWORK_MODE_GLOBAL = "NETWORK_MODE_GLOBAL"
610NETWORK_MODE_LTE_CDMA_EVDO = "NETWORK_MODE_LTE_CDMA_EVDO"
611NETWORK_MODE_LTE_GSM_WCDMA = "NETWORK_MODE_LTE_GSM_WCDMA"
612NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA"
613NETWORK_MODE_LTE_ONLY = "NETWORK_MODE_LTE_ONLY"
614NETWORK_MODE_LTE_WCDMA = "NETWORK_MODE_LTE_WCDMA"
615NETWORK_MODE_TDSCDMA_ONLY = "NETWORK_MODE_TDSCDMA_ONLY"
616NETWORK_MODE_TDSCDMA_WCDMA = "NETWORK_MODE_TDSCDMA_WCDMA"
617NETWORK_MODE_LTE_TDSCDMA = "NETWORK_MODE_LTE_TDSCDMA"
618NETWORK_MODE_TDSCDMA_GSM = "NETWORK_MODE_TDSCDMA_GSM"
619NETWORK_MODE_LTE_TDSCDMA_GSM = "NETWORK_MODE_LTE_TDSCDMA_GSM"
620NETWORK_MODE_TDSCDMA_GSM_WCDMA = "NETWORK_MODE_TDSCDMA_GSM_WCDMA"
621NETWORK_MODE_LTE_TDSCDMA_WCDMA = "NETWORK_MODE_LTE_TDSCDMA_WCDMA"
622NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = "NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA"
623NETWORK_MODE_TDSCDMA_CDMA_EVDO_WCDMA = "NETWORK_MODE_TDSCDMA_CDMA_EVDO_WCDMA"
624NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA"
625NETWORK_MODE_NR_LTE_GSM_WCDMA = "NETWORK_MODE_NR_LTE_GSM_WCDMA"
626NETWORK_MODE_NR_ONLY = "NETWORK_MODE_NR_ONLY"
627NETWORK_MODE_NR_LTE = "NETWORK_MODE_NR_LTE"
628NETWORK_MODE_NR_LTE_CDMA_EVDO = "NETWORK_MODE_NR_LTE_CDMA_EVDO"
629NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA"
630NETWORK_MODE_NR_LTE_WCDMA = "NETWORK_MODE_NR_LTE_WCDMA"
631NETWORK_MODE_NR_LTE_TDSCDMA = "NETWORK_MODE_NR_LTE_TDSCDMA"
632NETWORK_MODE_NR_LTE_TDSCDMA_GSM = "NETWORK_MODE_NR_LTE_TDSCDMA_GSM"
633NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA = "NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA"
634NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA = "NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA"
635NETWORK_MODE_NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA"
636
637# Carrier Config Update
638CARRIER_ID_VERSION = "3"
639ER_DB_ID_VERSION = "99999"
640
641CARRIER_ID_VERSION_P = "5"
642WAIT_TIME_FOR_CARRIERID_CHANGE = 6
643CARRIER_ID_METADATA_URL = "am broadcast -a com.google.android.gms." \
644     "phenotype.FLAG_OVERRIDE --es package 'com.google.android.configupdater'" \
645     " --es user '\*' --esa flags 'CarrierIdentification__metadata_url' " \
646     "--esa values 'https://www.gstatic.com/android/config_update/110618-" \
647     "carrier-id-metadata.txt' --esa types 'string' com.google.android.gms"
648
649CARRIER_ID_METADATA_URL_P = "am broadcast -a com.google.android.gms." \
650     "phenotype.FLAG_OVERRIDE --es package 'com.google.android.configupdater'" \
651     " --es user '\*' --esa flags 'CarrierIdentification__metadata_url' " \
652     "--esa values 'https://www.gstatic.com/android/telephony/carrierid/" \
653     "030419-p-carrier-id-metadata.txt' --esa types 'string' com.google.android.gms"
654
655CARRIER_ID_CONTENT_URL = "am broadcast -a com.google.android.gms." \
656     "phenotype.FLAG_OVERRIDE --es package 'com.google.android.configupdater'" \
657     " --es user '\*' --esa flags 'CarrierIdentification__content_url' " \
658     "--esa values 'https://www.gstatic.com/android/config_update/110618-" \
659     "carrier-id.pb' --esa types 'string' com.google.android.gms"
660
661CARRIER_ID_CONTENT_URL_P = "am broadcast -a com.google.android.gms." \
662     "phenotype.FLAG_OVERRIDE --es package 'com.google.android.configupdater'" \
663     " --es user '\*' --esa flags 'CarrierIdentification__content_url' " \
664     "--esa values 'https://www.gstatic.com/android/telephony/carrierid/" \
665     "030419-p-carrier-id.pb' --esa types 'string' com.google.android.gms"
666
667# Constant for Messaging Event Name
668EventSmsDeliverSuccess = "SmsDeliverSuccess"
669EventSmsDeliverFailure = "SmsDeliverFailure"
670EventSmsSentSuccess = "SmsSentSuccess"
671EventSmsSentFailure = "SmsSentFailure"
672EventSmsReceived = "SmsReceived"
673EventMmsSentSuccess = "MmsSentSuccess"
674EventMmsSentFailure = "MmsSentFailure"
675EventMmsDownloaded = "MmsDownloaded"
676EventWapPushReceived = "WapPushReceived"
677EventDataSmsReceived = "DataSmsReceived"
678EventCmasReceived = "CmasReceived"
679EventEtwsReceived = "EtwsReceived"
680
681# Constants for Telecom Call Management Event Name (see InCallService.java).
682EventTelecomCallAdded = "TelecomCallAdded"
683EventTelecomCallRemoved = "TelecomCallRemoved"
684
685# Constant for Telecom Call Event Name (see Call.java)
686EventTelecomCallStateChanged = "TelecomCallStateChanged"
687EventTelecomCallParentChanged = "TelecomCallParentChanged"
688EventTelecomCallChildrenChanged = "TelecomCallChildrenChanged"
689EventTelecomCallDetailsChanged = "TelecomCallDetailsChanged"
690EventTelecomCallCannedTextResponsesLoaded = "TelecomCallCannedTextResponsesLoaded"
691EventTelecomCallPostDialWait = "TelecomCallPostDialWait"
692EventTelecomCallVideoCallChanged = "TelecomCallVideoCallChanged"
693EventTelecomCallDestroyed = "TelecomCallDestroyed"
694EventTelecomCallConferenceableCallsChanged = "TelecomCallConferenceableCallsChanged"
695
696# Constant for Video Call Event Name
697EventTelecomVideoCallSessionModifyRequestReceived = "TelecomVideoCallSessionModifyRequestReceived"
698EventTelecomVideoCallSessionModifyResponseReceived = "TelecomVideoCallSessionModifyResponseReceived"
699EventTelecomVideoCallSessionEvent = "TelecomVideoCallSessionEvent"
700EventTelecomVideoCallPeerDimensionsChanged = "TelecomVideoCallPeerDimensionsChanged"
701EventTelecomVideoCallVideoQualityChanged = "TelecomVideoCallVideoQualityChanged"
702EventTelecomVideoCallDataUsageChanged = "TelecomVideoCallDataUsageChanged"
703EventTelecomVideoCallCameraCapabilities = "TelecomVideoCallCameraCapabilities"
704
705# Constant for Other Event Name
706EventCallStateChanged = "CallStateChanged"
707EventPreciseStateChanged = "PreciseStateChanged"
708EventDataConnectionRealTimeInfoChanged = "DataConnectionRealTimeInfoChanged"
709EventDataConnectionStateChanged = "DataConnectionStateChanged"
710EventServiceStateChanged = "ServiceStateChanged"
711EventSignalStrengthChanged = "SignalStrengthChanged"
712EventVolteServiceStateChanged = "VolteServiceStateChanged"
713EventMessageWaitingIndicatorChanged = "MessageWaitingIndicatorChanged"
714EventConnectivityChanged = "ConnectivityChanged"
715EventActiveDataSubIdChanged = "ActiveDataSubIdChanged"
716EventDisplayInfoChanged = "DisplayInfoChanged"
717
718# Constant for Packet Keep Alive Call Back
719EventPacketKeepaliveCallback = "PacketKeepaliveCallback"
720PacketKeepaliveCallbackStarted = "Started"
721PacketKeepaliveCallbackStopped = "Stopped"
722PacketKeepaliveCallbackError = "Error"
723PacketKeepaliveCallbackInvalid = "Invalid"
724
725# Constant for Network Call Back
726EventNetworkCallback = "NetworkCallback"
727NetworkCallbackPreCheck = "PreCheck"
728NetworkCallbackAvailable = "Available"
729NetworkCallbackLosing = "Losing"
730NetworkCallbackLost = "Lost"
731NetworkCallbackUnavailable = "Unavailable"
732NetworkCallbackCapabilitiesChanged = "CapabilitiesChanged"
733NetworkCallbackSuspended = "Suspended"
734NetworkCallbackResumed = "Resumed"
735NetworkCallbackLinkPropertiesChanged = "LinkPropertiesChanged"
736NetworkCallbackInvalid = "Invalid"
737
738class SignalStrengthContainer:
739    SIGNAL_STRENGTH_GSM = "gsmSignalStrength"
740    SIGNAL_STRENGTH_GSM_DBM = "gsmDbm"
741    SIGNAL_STRENGTH_GSM_LEVEL = "gsmLevel"
742    SIGNAL_STRENGTH_GSM_ASU_LEVEL = "gsmAsuLevel"
743    SIGNAL_STRENGTH_GSM_BIT_ERROR_RATE = "gsmBitErrorRate"
744    SIGNAL_STRENGTH_CDMA_DBM = "cdmaDbm"
745    SIGNAL_STRENGTH_CDMA_LEVEL = "cdmaLevel"
746    SIGNAL_STRENGTH_CDMA_ASU_LEVEL = "cdmaAsuLevel"
747    SIGNAL_STRENGTH_CDMA_ECIO = "cdmaEcio"
748    SIGNAL_STRENGTH_EVDO_DBM = "evdoDbm"
749    SIGNAL_STRENGTH_EVDO_ECIO = "evdoEcio"
750    SIGNAL_STRENGTH_LTE = "lteSignalStrength"
751    SIGNAL_STRENGTH_LTE_DBM = "lteDbm"
752    SIGNAL_STRENGTH_LTE_LEVEL = "lteLevel"
753    SIGNAL_STRENGTH_LTE_ASU_LEVEL = "lteAsuLevel"
754    SIGNAL_STRENGTH_DBM = "dbm"
755    SIGNAL_STRENGTH_LEVEL = "level"
756    SIGNAL_STRENGTH_ASU_LEVEL = "asuLevel"
757
758
759class MessageWaitingIndicatorContainer:
760    IS_MESSAGE_WAITING = "isMessageWaiting"
761
762
763class CallStateContainer:
764    INCOMING_NUMBER = "incomingNumber"
765    SUBSCRIPTION_ID = "subscriptionId"
766    CALL_STATE = "callState"
767
768class DisplayInfoContainer:
769    TIME = "time"
770    NETWORK = "network"
771    OVERRIDE = "override"
772    SUBSCRIPTION_ID = "subscriptionId"
773
774class OverrideNetworkContainer:
775    OVERRIDE_NETWORK_TYPE_NONE = "NONE"
776    OVERRIDE_NETWORK_TYPE_LTE_CA = "LTE_CA"
777    OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = "LTE_ADVANCED_PRO"
778    OVERRIDE_NETWORK_TYPE_NR_NSA = "NR_NSA"
779    OVERRIDE_NETWORK_TYPE_NR_MMWAVE = "NR_MMWAVE"
780
781class PreciseCallStateContainer:
782    TYPE = "type"
783    CAUSE = "cause"
784    SUBSCRIPTION_ID = "subscriptionId"
785    PRECISE_CALL_STATE = "preciseCallState"
786
787
788class DataConnectionRealTimeInfoContainer:
789    TYPE = "type"
790    TIME = "time"
791    SUBSCRIPTION_ID = "subscriptionId"
792    DATA_CONNECTION_POWER_STATE = "dataConnectionPowerState"
793
794
795class DataConnectionStateContainer:
796    TYPE = "type"
797    DATA_NETWORK_TYPE = "dataNetworkType"
798    STATE_CODE = "stateCode"
799    SUBSCRIPTION_ID = "subscriptionId"
800    DATA_CONNECTION_STATE = "dataConnectionState"
801
802
803class ServiceStateContainer:
804    VOICE_REG_STATE = "voiceRegState"
805    VOICE_NETWORK_TYPE = "voiceNetworkType"
806    DATA_REG_STATE = "dataRegState"
807    DATA_NETWORK_TYPE = "dataNetworkType"
808    OPERATOR_NAME = "operatorName"
809    OPERATOR_ID = "operatorId"
810    IS_MANUAL_NW_SELECTION = "isManualNwSelection"
811    ROAMING = "roaming"
812    IS_EMERGENCY_ONLY = "isEmergencyOnly"
813    NETWORK_ID = "networkId"
814    SYSTEM_ID = "systemId"
815    SUBSCRIPTION_ID = "subscriptionId"
816    SERVICE_STATE = "serviceState"
817
818
819class PacketKeepaliveContainer:
820    ID = "id"
821    PACKET_KEEPALIVE_EVENT = "packetKeepaliveEvent"
822
823
824class NetworkCallbackContainer:
825    ID = "id"
826    NETWORK_CALLBACK_EVENT = "networkCallbackEvent"
827    MAX_MS_TO_LIVE = "maxMsToLive"
828    RSSI = "rssi"
829
830
831class CarrierConfigs:
832    NAME_STRING = "carrier_name_string"
833    SUPPORT_CONFERENCE_CALL_BOOL = "support_conference_call_bool"
834    VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool"
835    VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool"
836    VOLTE_PROVISIONING_REQUIRED_BOOL = "carrier_volte_provisioning_required_bool"
837    VOLTE_OVERRIDE_WFC_BOOL = "carrier_volte_override_wfc_provisioning_bool"
838    VT_AVAILABLE_BOOL = "carrier_vt_available_bool"
839    ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL = "enhanced_4g_lte_on_by_default_bool"
840    HIDE_ENHANCED_4G_LTE_BOOL = "hide_enhanced_4g_lte_bool"
841    WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool"
842    WFC_SUPPORTS_WIFI_ONLY_BOOL = "carrier_wfc_supports_wifi_only_bool"
843    EDITABLE_ENHANCED_4G_LTE_BOOL = "editable_enhanced_4g_lte_bool"
844    EDITABLE_WFC_MODE_BOOL = "editable_wfc_mode_bool"
845    EDITABLE_WFC_ROAMING_MODE_BOOL = "editable_wfc_roaming_mode_bool"
846    DEFAULT_DATA_ROAMING_ENABLED_BOOL = "carrier_default_data_roaming_enabled_bool"
847    DEFAULT_WFC_IMS_ROAMING_ENABLED_BOOL = "carrier_default_wfc_ims_roaming_enabled_bool"
848    DEFAULT_WFC_IMS_ENABLED_BOOL = "carrier_default_wfc_ims_enabled_bool"
849    DEFAULT_WFC_IMS_MODE_INT = "carrier_default_wfc_ims_mode_int"
850    DEFAULT_WFC_IMS_ROAMING_ENABLED_BOOL = "carrier_default_wfc_ims_roaming_enabled_bool"
851    DEFAULT_WFC_IMS_ROAMING_MODE_INT = "carrier_default_wfc_ims_roaming_mode_int"
852
853
854"""
855End shared constant define for both Python and Java
856"""
857