1#!/usr/bin/env python3.4 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. 16from acts.utils import NexusModelNames 17from acts.test_utils.tel import tel_defines 18 19 20def rat_family_from_rat(rat_type): 21 return _TelTables.technology_tbl[rat_type]['rat_family'] 22 23 24def rat_generation_from_rat(rat_type): 25 return _TelTables.technology_tbl[rat_type]['generation'] 26 27 28def network_preference_for_generaton(generation, operator): 29 return _TelTables.operator_network_tbl[operator][generation][ 30 'network_preference'] 31 32 33def rat_families_for_network_preference(network_preference): 34 return _TelTables.network_preference_tbl[network_preference][ 35 'rat_family_list'] 36 37 38def rat_family_for_generation(generation, operator): 39 return _TelTables.operator_network_tbl[operator][generation]['rat_family'] 40 41 42def operator_name_from_plmn_id(plmn_id): 43 return _TelTables.operator_id_to_name[plmn_id] 44 45 46def is_valid_rat(rat_type): 47 return True if rat_type in _TelTables.technology_tbl else False 48 49 50def is_valid_generation(gen): 51 return True if gen in _TelTables.technology_gen_tbl else False 52 53 54def is_rat_svd_capable(rat): 55 return _TelTables.technology_tbl[rat]["simultaneous_voice_data"] 56 57 58def connection_type_from_type_string(input_string): 59 if input_string in _ConnectionTables.connection_type_tbl: 60 return _ConnectionTables.connection_type_tbl[input_string] 61 return tel_defines.NETWORK_CONNECTION_TYPE_UNKNOWN 62 63 64def is_user_plane_data_type(connection_type): 65 if connection_type in _ConnectionTables.user_plane_data_type: 66 return _ConnectionTables.user_plane_data_type[connection_type] 67 return False 68 69 70# For TMO, to check if voice mail count is correct after leaving a new voice message. 71def check_tmo_voice_mail_count(voice_mail_count_before, 72 voice_mail_count_after): 73 return (voice_mail_count_after == -1) 74 75 76# For ATT, to check if voice mail count is correct after leaving a new voice message. 77def check_att_voice_mail_count(voice_mail_count_before, 78 voice_mail_count_after): 79 return (voice_mail_count_after == (voice_mail_count_before + 1)) 80 81 82# For SPT, to check if voice mail count is correct after leaving a new voice message. 83def check_spt_voice_mail_count(voice_mail_count_before, 84 voice_mail_count_after): 85 return (voice_mail_count_after == (voice_mail_count_before + 1)) 86 87 88# For TMO, get the voice mail number 89def get_tmo_voice_mail_number(): 90 return "123" 91 92 93# For ATT, get the voice mail number 94def get_att_voice_mail_number(): 95 return None 96 97 98# For SPT, get the voice mail number 99def get_spt_voice_mail_number(): 100 return None 101 102 103def get_voice_mail_number_function(operator): 104 return _TelTables.voice_mail_number_get_function_tbl[operator] 105 106 107def get_voice_mail_count_check_function(operator): 108 return _TelTables.voice_mail_count_check_function_tbl[operator] 109 110 111def get_allowable_network_preference(operator): 112 return _TelTables.allowable_network_preference_tbl[operator] 113 114 115class _ConnectionTables(): 116 connection_type_tbl = { 117 'WIFI': tel_defines.NETWORK_CONNECTION_TYPE_WIFI, 118 'WIFI_P2P': tel_defines.NETWORK_CONNECTION_TYPE_WIFI, 119 'MOBILE': tel_defines.NETWORK_CONNECTION_TYPE_CELL, 120 'MOBILE_DUN': tel_defines.NETWORK_CONNECTION_TYPE_CELL, 121 'MOBILE_HIPRI': tel_defines.NETWORK_CONNECTION_TYPE_HIPRI, 122 # TODO: b/26296489 add support for 'MOBILE_SUPL', 'MOBILE_HIPRI', 123 # 'MOBILE_FOTA', 'MOBILE_IMS', 'MOBILE_CBS', 'MOBILE_IA', 124 # 'MOBILE_EMERGENCY' 125 'MOBILE_MMS': tel_defines.NETWORK_CONNECTION_TYPE_MMS 126 } 127 128 user_plane_data_type = { 129 tel_defines.NETWORK_CONNECTION_TYPE_WIFI: True, 130 tel_defines.NETWORK_CONNECTION_TYPE_CELL: False, 131 tel_defines.NETWORK_CONNECTION_TYPE_MMS: False, 132 tel_defines.NETWORK_CONNECTION_TYPE_UNKNOWN: False 133 } 134 135 136class _TelTables(): 137 # Operator id mapping to operator name 138 # Reference: Pages 43-50 in 139 # https://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.212B-2013-PDF-E.pdf [2013] 140 141 operator_id_to_name = { 142 143 #VZW (Verizon Wireless) 144 '310010': tel_defines.CARRIER_VZW, 145 '310012': tel_defines.CARRIER_VZW, 146 '310013': tel_defines.CARRIER_VZW, 147 '310590': tel_defines.CARRIER_VZW, 148 '310890': tel_defines.CARRIER_VZW, 149 '310910': tel_defines.CARRIER_VZW, 150 '310110': tel_defines.CARRIER_VZW, 151 '311270': tel_defines.CARRIER_VZW, 152 '311271': tel_defines.CARRIER_VZW, 153 '311272': tel_defines.CARRIER_VZW, 154 '311273': tel_defines.CARRIER_VZW, 155 '311274': tel_defines.CARRIER_VZW, 156 '311275': tel_defines.CARRIER_VZW, 157 '311276': tel_defines.CARRIER_VZW, 158 '311277': tel_defines.CARRIER_VZW, 159 '311278': tel_defines.CARRIER_VZW, 160 '311279': tel_defines.CARRIER_VZW, 161 '311280': tel_defines.CARRIER_VZW, 162 '311281': tel_defines.CARRIER_VZW, 163 '311282': tel_defines.CARRIER_VZW, 164 '311283': tel_defines.CARRIER_VZW, 165 '311284': tel_defines.CARRIER_VZW, 166 '311285': tel_defines.CARRIER_VZW, 167 '311286': tel_defines.CARRIER_VZW, 168 '311287': tel_defines.CARRIER_VZW, 169 '311288': tel_defines.CARRIER_VZW, 170 '311289': tel_defines.CARRIER_VZW, 171 '311390': tel_defines.CARRIER_VZW, 172 '311480': tel_defines.CARRIER_VZW, 173 '311481': tel_defines.CARRIER_VZW, 174 '311482': tel_defines.CARRIER_VZW, 175 '311483': tel_defines.CARRIER_VZW, 176 '311484': tel_defines.CARRIER_VZW, 177 '311485': tel_defines.CARRIER_VZW, 178 '311486': tel_defines.CARRIER_VZW, 179 '311487': tel_defines.CARRIER_VZW, 180 '311488': tel_defines.CARRIER_VZW, 181 '311489': tel_defines.CARRIER_VZW, 182 183 #TMO (T-Mobile USA) 184 '310160': tel_defines.CARRIER_TMO, 185 '310200': tel_defines.CARRIER_TMO, 186 '310210': tel_defines.CARRIER_TMO, 187 '310220': tel_defines.CARRIER_TMO, 188 '310230': tel_defines.CARRIER_TMO, 189 '310240': tel_defines.CARRIER_TMO, 190 '310250': tel_defines.CARRIER_TMO, 191 '310260': tel_defines.CARRIER_TMO, 192 '310270': tel_defines.CARRIER_TMO, 193 '310310': tel_defines.CARRIER_TMO, 194 '310490': tel_defines.CARRIER_TMO, 195 '310660': tel_defines.CARRIER_TMO, 196 '310800': tel_defines.CARRIER_TMO, 197 198 #ATT (AT&T and Cingular) 199 '310070': tel_defines.CARRIER_ATT, 200 '310560': tel_defines.CARRIER_ATT, 201 '310670': tel_defines.CARRIER_ATT, 202 '310680': tel_defines.CARRIER_ATT, 203 '310150': tel_defines.CARRIER_ATT, #Cingular 204 '310170': tel_defines.CARRIER_ATT, #Cingular 205 '310410': tel_defines.CARRIER_ATT, #Cingular 206 '311180': 207 tel_defines.CARRIER_ATT, #Cingular Licensee Pacific Telesis Mobile Services, LLC 208 209 #Sprint (and Sprint-Nextel) 210 '310120': tel_defines.CARRIER_SPT, 211 '311490': tel_defines.CARRIER_SPT, 212 '311870': tel_defines.CARRIER_SPT, 213 '311880': tel_defines.CARRIER_SPT, 214 '312190': tel_defines.CARRIER_SPT, #Sprint-Nextel Communications Inc 215 '316010': tel_defines.CARRIER_SPT, #Sprint-Nextel Communications Inc 216 '23433': tel_defines.CARRIER_EEUK, #Orange 217 '23434': tel_defines.CARRIER_EEUK, #Orange 218 '23430': tel_defines.CARRIER_EEUK, #T-Mobile UK 219 '23431': tel_defines.CARRIER_EEUK, #Virgin Mobile (MVNO) 220 '23432': tel_defines.CARRIER_EEUK, #Virgin Mobile (MVNO) 221 '23415': tel_defines.CARRIER_VFUK 222 } 223 224 technology_gen_tbl = [tel_defines.GEN_2G, tel_defines.GEN_3G, 225 tel_defines.GEN_4G] 226 227 technology_tbl = { 228 tel_defines.RAT_1XRTT: { 229 'is_voice_rat': True, 230 'is_data_rat': False, 231 'generation': tel_defines.GEN_3G, 232 'simultaneous_voice_data': False, 233 'rat_family': tel_defines.RAT_FAMILY_CDMA2000 234 }, 235 tel_defines.RAT_EDGE: { 236 'is_voice_rat': False, 237 'is_data_rat': True, 238 'generation': tel_defines.GEN_2G, 239 'simultaneous_voice_data': False, 240 'rat_family': tel_defines.RAT_FAMILY_GSM 241 }, 242 tel_defines.RAT_GPRS: { 243 'is_voice_rat': False, 244 'is_data_rat': True, 245 'generation': tel_defines.GEN_2G, 246 'simultaneous_voice_data': False, 247 'rat_family': tel_defines.RAT_FAMILY_GSM 248 }, 249 tel_defines.RAT_GSM: { 250 'is_voice_rat': True, 251 'is_data_rat': False, 252 'generation': tel_defines.GEN_2G, 253 'simultaneous_voice_data': False, 254 'rat_family': tel_defines.RAT_FAMILY_GSM 255 }, 256 tel_defines.RAT_UMTS: { 257 'is_voice_rat': True, 258 'is_data_rat': True, 259 'generation': tel_defines.GEN_3G, 260 'simultaneous_voice_data': True, 261 'rat_family': tel_defines.RAT_FAMILY_WCDMA 262 }, 263 tel_defines.RAT_WCDMA: { 264 'is_voice_rat': True, 265 'is_data_rat': True, 266 'generation': tel_defines.GEN_3G, 267 'simultaneous_voice_data': True, 268 'rat_family': tel_defines.RAT_FAMILY_WCDMA 269 }, 270 tel_defines.RAT_HSDPA: { 271 'is_voice_rat': False, 272 'is_data_rat': True, 273 'generation': tel_defines.GEN_3G, 274 'simultaneous_voice_data': False, 275 'rat_family': tel_defines.RAT_FAMILY_WCDMA 276 }, 277 tel_defines.RAT_HSUPA: { 278 'is_voice_rat': False, 279 'is_data_rat': True, 280 'generation': tel_defines.GEN_3G, 281 'simultaneous_voice_data': False, 282 'rat_family': tel_defines.RAT_FAMILY_WCDMA 283 }, 284 tel_defines.RAT_CDMA: { 285 'is_voice_rat': True, 286 'is_data_rat': False, 287 'generation': tel_defines.GEN_2G, 288 'simultaneous_voice_data': False, 289 'rat_family': tel_defines.RAT_FAMILY_CDMA 290 }, 291 tel_defines.RAT_EVDO: { 292 'is_voice_rat': False, 293 'is_data_rat': True, 294 'generation': tel_defines.GEN_3G, 295 'simultaneous_voice_data': False, 296 'rat_family': tel_defines.RAT_FAMILY_CDMA2000 297 }, 298 tel_defines.RAT_EVDO_0: { 299 'is_voice_rat': False, 300 'is_data_rat': True, 301 'generation': tel_defines.GEN_3G, 302 'simultaneous_voice_data': False, 303 'rat_family': tel_defines.RAT_FAMILY_CDMA2000 304 }, 305 tel_defines.RAT_EVDO_A: { 306 'is_voice_rat': False, 307 'is_data_rat': True, 308 'generation': tel_defines.GEN_3G, 309 'simultaneous_voice_data': False, 310 'rat_family': tel_defines.RAT_FAMILY_CDMA2000 311 }, 312 tel_defines.RAT_EVDO_B: { 313 'is_voice_rat': False, 314 'is_data_rat': True, 315 'generation': tel_defines.GEN_3G, 316 'simultaneous_voice_data': False, 317 'rat_family': tel_defines.RAT_FAMILY_CDMA2000 318 }, 319 tel_defines.RAT_IDEN: { 320 'is_voice_rat': False, 321 'is_data_rat': True, 322 'generation': tel_defines.GEN_2G, 323 'simultaneous_voice_data': False, 324 'rat_family': tel_defines.RAT_FAMILY_IDEN 325 }, 326 tel_defines.RAT_LTE_CA: { 327 'is_voice_rat': True, 328 'is_data_rat': True, 329 'generation': tel_defines.GEN_4G, 330 'simultaneous_voice_data': True, 331 'rat_family': tel_defines.RAT_FAMILY_LTE 332 }, 333 tel_defines.RAT_LTE: { 334 'is_voice_rat': True, 335 'is_data_rat': True, 336 'generation': tel_defines.GEN_4G, 337 'simultaneous_voice_data': True, 338 'rat_family': tel_defines.RAT_FAMILY_LTE 339 }, 340 tel_defines.RAT_EHRPD: { 341 'is_voice_rat': False, 342 'is_data_rat': True, 343 'generation': tel_defines.GEN_3G, 344 'simultaneous_voice_data': False, 345 'rat_family': tel_defines.RAT_FAMILY_CDMA2000 346 }, 347 tel_defines.RAT_HSPA: { 348 'is_voice_rat': False, 349 'is_data_rat': True, 350 'generation': tel_defines.GEN_3G, 351 'simultaneous_voice_data': True, 352 'rat_family': tel_defines.RAT_FAMILY_WCDMA 353 }, 354 tel_defines.RAT_HSPAP: { 355 'is_voice_rat': False, 356 'is_data_rat': True, 357 'generation': tel_defines.GEN_3G, 358 'simultaneous_voice_data': True, 359 'rat_family': tel_defines.RAT_FAMILY_WCDMA 360 }, 361 tel_defines.RAT_IWLAN: { 362 'is_voice_rat': True, 363 'is_data_rat': True, 364 'generation': tel_defines.GEN_4G, 365 'simultaneous_voice_data': True, 366 'rat_family': tel_defines.RAT_FAMILY_WLAN 367 }, 368 tel_defines.RAT_TD_SCDMA: { 369 'is_voice_rat': True, 370 'is_data_rat': True, 371 'generation': tel_defines.GEN_3G, 372 'simultaneous_voice_data': True, 373 'rat_family': tel_defines.RAT_FAMILY_TDSCDMA 374 }, 375 tel_defines.RAT_UNKNOWN: { 376 'is_voice_rat': False, 377 'is_data_rat': False, 378 'generation': tel_defines.GEN_UNKNOWN, 379 'simultaneous_voice_data': False, 380 'rat_family': tel_defines.RAT_FAMILY_UNKNOWN 381 }, 382 tel_defines.RAT_GLOBAL: { 383 'is_voice_rat': False, 384 'is_data_rat': False, 385 'generation': tel_defines.GEN_UNKNOWN, 386 'simultaneous_voice_data': False, 387 'rat_family': tel_defines.RAT_FAMILY_UNKNOWN 388 } 389 } 390 391 network_preference_tbl = { 392 tel_defines.NETWORK_MODE_LTE_GSM_WCDMA: { 393 'rat_family_list': [tel_defines.RAT_FAMILY_LTE, 394 tel_defines.RAT_FAMILY_WCDMA, 395 tel_defines.RAT_FAMILY_GSM] 396 }, 397 tel_defines.NETWORK_MODE_GSM_UMTS: { 398 'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA, 399 tel_defines.RAT_FAMILY_GSM] 400 }, 401 tel_defines.NETWORK_MODE_GSM_ONLY: { 402 'rat_family_list': [tel_defines.RAT_FAMILY_GSM] 403 }, 404 tel_defines.NETWORK_MODE_LTE_CDMA_EVDO: { 405 'rat_family_list': [tel_defines.RAT_FAMILY_LTE, 406 tel_defines.RAT_FAMILY_CDMA2000, 407 tel_defines.RAT_FAMILY_CDMA] 408 }, 409 tel_defines.NETWORK_MODE_CDMA: { 410 'rat_family_list': [tel_defines.RAT_FAMILY_CDMA2000, 411 tel_defines.RAT_FAMILY_CDMA] 412 }, 413 tel_defines.NETWORK_MODE_CDMA_NO_EVDO: { 414 'rat_family_list': [tel_defines.RAT_FAMILY_CDMA2000, 415 tel_defines.RAT_FAMILY_CDMA] 416 }, 417 tel_defines.NETWORK_MODE_WCDMA_PREF: { 418 'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA, 419 tel_defines.RAT_FAMILY_GSM] 420 }, 421 tel_defines.NETWORK_MODE_WCDMA_ONLY: { 422 'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA] 423 }, 424 tel_defines.NETWORK_MODE_EVDO_NO_CDMA: { 425 'rat_family_list': [tel_defines.RAT_FAMILY_CDMA2000] 426 }, 427 tel_defines.NETWORK_MODE_GLOBAL: { 428 'rat_family_list': 429 [tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_TDSCDMA, 430 tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_GSM, 431 tel_defines.RAT_FAMILY_CDMA2000, tel_defines.RAT_FAMILY_CDMA] 432 }, 433 tel_defines.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA: { 434 'rat_family_list': 435 [tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_WCDMA, 436 tel_defines.RAT_FAMILY_GSM, tel_defines.RAT_FAMILY_CDMA2000, 437 tel_defines.RAT_FAMILY_CDMA] 438 }, 439 tel_defines.NETWORK_MODE_LTE_ONLY: { 440 'rat_family_list': [tel_defines.RAT_FAMILY_LTE] 441 }, 442 tel_defines.NETWORK_MODE_LTE_WCDMA: { 443 'rat_family_list': [tel_defines.RAT_FAMILY_LTE, 444 tel_defines.RAT_FAMILY_WCDMA] 445 }, 446 tel_defines.NETWORK_MODE_TDSCDMA_ONLY: { 447 'rat_family_list': [tel_defines.RAT_FAMILY_TDSCDMA] 448 }, 449 tel_defines.NETWORK_MODE_TDSCDMA_WCDMA: { 450 'rat_family_list': [tel_defines.RAT_FAMILY_TDSCDMA, 451 tel_defines.RAT_FAMILY_WCDMA] 452 }, 453 tel_defines.NETWORK_MODE_LTE_TDSCDMA: { 454 'rat_family_list': [tel_defines.RAT_FAMILY_LTE, 455 tel_defines.RAT_FAMILY_TDSCDMA] 456 }, 457 tel_defines.NETWORK_MODE_TDSCDMA_GSM: { 458 'rat_family_list': [tel_defines.RAT_FAMILY_TDSCDMA, 459 tel_defines.RAT_FAMILY_GSM] 460 }, 461 tel_defines.NETWORK_MODE_LTE_TDSCDMA_GSM: { 462 'rat_family_list': [tel_defines.RAT_FAMILY_LTE, 463 tel_defines.RAT_FAMILY_TDSCDMA, 464 tel_defines.RAT_FAMILY_GSM] 465 }, 466 tel_defines.NETWORK_MODE_TDSCDMA_GSM_WCDMA: { 467 'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA, 468 tel_defines.RAT_FAMILY_TDSCDMA, 469 tel_defines.RAT_FAMILY_GSM] 470 }, 471 tel_defines.NETWORK_MODE_LTE_TDSCDMA_WCDMA: { 472 'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA, 473 tel_defines.RAT_FAMILY_TDSCDMA, 474 tel_defines.RAT_FAMILY_LTE] 475 }, 476 tel_defines.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA: { 477 'rat_family_list': 478 [tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_TDSCDMA, 479 tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_GSM] 480 }, 481 tel_defines.NETWORK_MODE_TDSCDMA_CDMA_EVDO_WCDMA: { 482 'rat_family_list': 483 [tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_TDSCDMA, 484 tel_defines.RAT_FAMILY_CDMA2000, tel_defines.RAT_FAMILY_CDMA] 485 }, 486 tel_defines.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA: { 487 'rat_family_list': 488 [tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_TDSCDMA, 489 tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_GSM, 490 tel_defines.RAT_FAMILY_CDMA2000, tel_defines.RAT_FAMILY_CDMA] 491 } 492 } 493 default_umts_operator_network_tbl = { 494 tel_defines.GEN_4G: { 495 'rat_family': tel_defines.RAT_FAMILY_LTE, 496 'network_preference': tel_defines.NETWORK_MODE_LTE_GSM_WCDMA 497 }, 498 tel_defines.GEN_3G: { 499 'rat_family': tel_defines.RAT_FAMILY_WCDMA, 500 'network_preference': tel_defines.NETWORK_MODE_GSM_UMTS 501 }, 502 tel_defines.GEN_2G: { 503 'rat_family': tel_defines.RAT_FAMILY_GSM, 504 'network_preference': tel_defines.NETWORK_MODE_GSM_ONLY 505 } 506 } 507 default_cdma_operator_network_tbl = { 508 tel_defines.GEN_4G: { 509 'rat_family': tel_defines.RAT_FAMILY_LTE, 510 'network_preference': tel_defines.NETWORK_MODE_LTE_CDMA_EVDO 511 }, 512 tel_defines.GEN_3G: { 513 'rat_family': tel_defines.RAT_FAMILY_CDMA2000, 514 'network_preference': tel_defines.NETWORK_MODE_CDMA 515 }, 516 tel_defines.GEN_2G: { 517 'rat_family': tel_defines.RAT_FAMILY_CDMA2000, 518 'network_preference': tel_defines.NETWORK_MODE_CDMA_NO_EVDO 519 } 520 } 521 operator_network_tbl = { 522 tel_defines.CARRIER_TMO: default_umts_operator_network_tbl, 523 tel_defines.CARRIER_ATT: default_umts_operator_network_tbl, 524 tel_defines.CARRIER_VZW: default_cdma_operator_network_tbl, 525 tel_defines.CARRIER_SPT: default_cdma_operator_network_tbl, 526 tel_defines.CARRIER_EEUK: default_umts_operator_network_tbl, 527 tel_defines.CARRIER_VFUK: default_umts_operator_network_tbl 528 } 529 530 umts_allowable_network_preference_tbl = \ 531 [tel_defines.NETWORK_MODE_LTE_GSM_WCDMA, 532 tel_defines.NETWORK_MODE_WCDMA_PREF, 533 tel_defines.NETWORK_MODE_GSM_ONLY] 534 535 cdma_allowable_network_preference_tbl = \ 536 [tel_defines.NETWORK_MODE_LTE_CDMA_EVDO, 537 tel_defines.NETWORK_MODE_CDMA, 538 tel_defines.NETWORK_MODE_CDMA_NO_EVDO, 539 tel_defines.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA] 540 541 allowable_network_preference_tbl = { 542 tel_defines.CARRIER_TMO: umts_allowable_network_preference_tbl, 543 tel_defines.CARRIER_ATT: umts_allowable_network_preference_tbl, 544 tel_defines.CARRIER_VZW: cdma_allowable_network_preference_tbl, 545 tel_defines.CARRIER_SPT: cdma_allowable_network_preference_tbl, 546 tel_defines.CARRIER_EEUK: umts_allowable_network_preference_tbl, 547 tel_defines.CARRIER_VFUK: umts_allowable_network_preference_tbl 548 } 549 550 voice_mail_number_get_function_tbl = { 551 tel_defines.CARRIER_TMO: get_tmo_voice_mail_number, 552 tel_defines.CARRIER_ATT: get_att_voice_mail_number, 553 tel_defines.CARRIER_SPT: get_spt_voice_mail_number 554 } 555 556 voice_mail_count_check_function_tbl = { 557 tel_defines.CARRIER_TMO: check_tmo_voice_mail_count, 558 tel_defines.CARRIER_ATT: check_att_voice_mail_count, 559 tel_defines.CARRIER_SPT: check_spt_voice_mail_count 560 } 561 562 563device_capabilities = { 564 NexusModelNames.ONE: 565 [tel_defines.CAPABILITY_PHONE, tel_defines.CAPABILITY_MSIM], 566 NexusModelNames.N5: [tel_defines.CAPABILITY_PHONE], 567 NexusModelNames.N5v2: 568 [tel_defines.CAPABILITY_PHONE, tel_defines.CAPABILITY_OMADM, 569 tel_defines.CAPABILITY_VOLTE, tel_defines.CAPABILITY_WFC], 570 NexusModelNames.N6: [tel_defines.CAPABILITY_PHONE, 571 tel_defines.CAPABILITY_OMADM, 572 tel_defines.CAPABILITY_VOLTE, 573 tel_defines.CAPABILITY_WFC], 574 NexusModelNames.N6v2: [tel_defines.CAPABILITY_PHONE, 575 tel_defines.CAPABILITY_OMADM, 576 tel_defines.CAPABILITY_VOLTE, 577 tel_defines.CAPABILITY_WFC], 578 NexusModelNames.N5v3: [tel_defines.CAPABILITY_PHONE, 579 tel_defines.CAPABILITY_OMADM, 580 tel_defines.CAPABILITY_VOLTE, 581 tel_defines.CAPABILITY_WFC, 582 tel_defines.CAPABILITY_VT], 583 NexusModelNames.N6v3: [tel_defines.CAPABILITY_PHONE, 584 tel_defines.CAPABILITY_OMADM, 585 tel_defines.CAPABILITY_VOLTE, 586 tel_defines.CAPABILITY_WFC, 587 tel_defines.CAPABILITY_VT] 588} 589 590operator_capabilities = { 591 tel_defines.CARRIER_VZW: [tel_defines.CAPABILITY_PHONE, 592 tel_defines.CAPABILITY_OMADM, 593 tel_defines.CAPABILITY_VOLTE, 594 tel_defines.CAPABILITY_WFC, 595 tel_defines.CAPABILITY_VT], 596 tel_defines.CARRIER_ATT: [tel_defines.CAPABILITY_PHONE], 597 tel_defines.CARRIER_TMO: [tel_defines.CAPABILITY_PHONE, 598 tel_defines.CAPABILITY_VOLTE, 599 tel_defines.CAPABILITY_WFC, 600 tel_defines.CAPABILITY_VT], 601 tel_defines.CARRIER_SPT: [tel_defines.CAPABILITY_PHONE], 602 tel_defines.CARRIER_EEUK: [tel_defines.CAPABILITY_PHONE, 603 tel_defines.CAPABILITY_VOLTE, 604 tel_defines.CAPABILITY_WFC], 605 tel_defines.CARRIER_VFUK: [tel_defines.CAPABILITY_PHONE] 606} 607