• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: {
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_EHRPD: {
334            'is_voice_rat': False,
335            'is_data_rat': True,
336            'generation': tel_defines.GEN_3G,
337            'simultaneous_voice_data': False,
338            'rat_family': tel_defines.RAT_FAMILY_CDMA2000
339        },
340        tel_defines.RAT_HSPA: {
341            'is_voice_rat': False,
342            'is_data_rat': True,
343            'generation': tel_defines.GEN_3G,
344            'simultaneous_voice_data': True,
345            'rat_family': tel_defines.RAT_FAMILY_WCDMA
346        },
347        tel_defines.RAT_HSPAP: {
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_IWLAN: {
355            'is_voice_rat': True,
356            'is_data_rat': True,
357            'generation': tel_defines.GEN_4G,
358            'simultaneous_voice_data': True,
359            'rat_family': tel_defines.RAT_FAMILY_WLAN
360        },
361        tel_defines.RAT_TD_SCDMA: {
362            'is_voice_rat': True,
363            'is_data_rat': True,
364            'generation': tel_defines.GEN_3G,
365            'simultaneous_voice_data': True,
366            'rat_family': tel_defines.RAT_FAMILY_TDSCDMA
367        },
368        tel_defines.RAT_UNKNOWN: {
369            'is_voice_rat': False,
370            'is_data_rat': False,
371            'generation': tel_defines.GEN_UNKNOWN,
372            'simultaneous_voice_data': False,
373            'rat_family': tel_defines.RAT_FAMILY_UNKNOWN
374        },
375        tel_defines.RAT_GLOBAL: {
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    }
383
384    network_preference_tbl = {
385        tel_defines.NETWORK_MODE_LTE_GSM_WCDMA: {
386            'rat_family_list': [tel_defines.RAT_FAMILY_LTE,
387                                tel_defines.RAT_FAMILY_WCDMA,
388                                tel_defines.RAT_FAMILY_GSM]
389        },
390        tel_defines.NETWORK_MODE_GSM_UMTS: {
391            'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA,
392                                tel_defines.RAT_FAMILY_GSM]
393        },
394        tel_defines.NETWORK_MODE_GSM_ONLY: {
395            'rat_family_list': [tel_defines.RAT_FAMILY_GSM]
396        },
397        tel_defines.NETWORK_MODE_LTE_CDMA_EVDO: {
398            'rat_family_list': [tel_defines.RAT_FAMILY_LTE,
399                                tel_defines.RAT_FAMILY_CDMA2000,
400                                tel_defines.RAT_FAMILY_CDMA]
401        },
402        tel_defines.NETWORK_MODE_CDMA: {
403            'rat_family_list': [tel_defines.RAT_FAMILY_CDMA2000,
404                                tel_defines.RAT_FAMILY_CDMA]
405        },
406        tel_defines.NETWORK_MODE_CDMA_NO_EVDO: {
407            'rat_family_list': [tel_defines.RAT_FAMILY_CDMA2000,
408                                tel_defines.RAT_FAMILY_CDMA]
409        },
410        tel_defines.NETWORK_MODE_WCDMA_PREF: {
411            'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA,
412                                tel_defines.RAT_FAMILY_GSM]
413        },
414        tel_defines.NETWORK_MODE_WCDMA_ONLY: {
415            'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA]
416        },
417        tel_defines.NETWORK_MODE_EVDO_NO_CDMA: {
418            'rat_family_list': [tel_defines.RAT_FAMILY_CDMA2000]
419        },
420        tel_defines.NETWORK_MODE_GLOBAL: {
421            'rat_family_list':
422            [tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_TDSCDMA,
423             tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_GSM,
424             tel_defines.RAT_FAMILY_CDMA2000, tel_defines.RAT_FAMILY_CDMA]
425        },
426        tel_defines.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA: {
427            'rat_family_list':
428            [tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_WCDMA,
429             tel_defines.RAT_FAMILY_GSM, tel_defines.RAT_FAMILY_CDMA2000,
430             tel_defines.RAT_FAMILY_CDMA]
431        },
432        tel_defines.NETWORK_MODE_LTE_ONLY: {
433            'rat_family_list': [tel_defines.RAT_FAMILY_LTE]
434        },
435        tel_defines.NETWORK_MODE_LTE_WCDMA: {
436            'rat_family_list': [tel_defines.RAT_FAMILY_LTE,
437                                tel_defines.RAT_FAMILY_WCDMA]
438        },
439        tel_defines.NETWORK_MODE_TDSCDMA_ONLY: {
440            'rat_family_list': [tel_defines.RAT_FAMILY_TDSCDMA]
441        },
442        tel_defines.NETWORK_MODE_TDSCDMA_WCDMA: {
443            'rat_family_list': [tel_defines.RAT_FAMILY_TDSCDMA,
444                                tel_defines.RAT_FAMILY_WCDMA]
445        },
446        tel_defines.NETWORK_MODE_LTE_TDSCDMA: {
447            'rat_family_list': [tel_defines.RAT_FAMILY_LTE,
448                                tel_defines.RAT_FAMILY_TDSCDMA]
449        },
450        tel_defines.NETWORK_MODE_TDSCDMA_GSM: {
451            'rat_family_list': [tel_defines.RAT_FAMILY_TDSCDMA,
452                                tel_defines.RAT_FAMILY_GSM]
453        },
454        tel_defines.NETWORK_MODE_LTE_TDSCDMA_GSM: {
455            'rat_family_list': [tel_defines.RAT_FAMILY_LTE,
456                                tel_defines.RAT_FAMILY_TDSCDMA,
457                                tel_defines.RAT_FAMILY_GSM]
458        },
459        tel_defines.NETWORK_MODE_TDSCDMA_GSM_WCDMA: {
460            'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA,
461                                tel_defines.RAT_FAMILY_TDSCDMA,
462                                tel_defines.RAT_FAMILY_GSM]
463        },
464        tel_defines.NETWORK_MODE_LTE_TDSCDMA_WCDMA: {
465            'rat_family_list': [tel_defines.RAT_FAMILY_WCDMA,
466                                tel_defines.RAT_FAMILY_TDSCDMA,
467                                tel_defines.RAT_FAMILY_LTE]
468        },
469        tel_defines.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA: {
470            'rat_family_list':
471            [tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_TDSCDMA,
472             tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_GSM]
473        },
474        tel_defines.NETWORK_MODE_TDSCDMA_CDMA_EVDO_WCDMA: {
475            'rat_family_list':
476            [tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_TDSCDMA,
477             tel_defines.RAT_FAMILY_CDMA2000, tel_defines.RAT_FAMILY_CDMA]
478        },
479        tel_defines.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA: {
480            'rat_family_list':
481            [tel_defines.RAT_FAMILY_WCDMA, tel_defines.RAT_FAMILY_TDSCDMA,
482             tel_defines.RAT_FAMILY_LTE, tel_defines.RAT_FAMILY_GSM,
483             tel_defines.RAT_FAMILY_CDMA2000, tel_defines.RAT_FAMILY_CDMA]
484        }
485    }
486    default_umts_operator_network_tbl = {
487        tel_defines.GEN_4G: {
488            'rat_family': tel_defines.RAT_FAMILY_LTE,
489            'network_preference': tel_defines.NETWORK_MODE_LTE_GSM_WCDMA
490        },
491        tel_defines.GEN_3G: {
492            'rat_family': tel_defines.RAT_FAMILY_WCDMA,
493            'network_preference': tel_defines.NETWORK_MODE_GSM_UMTS
494        },
495        tel_defines.GEN_2G: {
496            'rat_family': tel_defines.RAT_FAMILY_GSM,
497            'network_preference': tel_defines.NETWORK_MODE_GSM_ONLY
498        }
499    }
500    default_cdma_operator_network_tbl = {
501        tel_defines.GEN_4G: {
502            'rat_family': tel_defines.RAT_FAMILY_LTE,
503            'network_preference': tel_defines.NETWORK_MODE_LTE_CDMA_EVDO
504        },
505        tel_defines.GEN_3G: {
506            'rat_family': tel_defines.RAT_FAMILY_CDMA2000,
507            'network_preference': tel_defines.NETWORK_MODE_CDMA
508        },
509        tel_defines.GEN_2G: {
510            'rat_family': tel_defines.RAT_FAMILY_CDMA2000,
511            'network_preference': tel_defines.NETWORK_MODE_CDMA_NO_EVDO
512        }
513    }
514    operator_network_tbl = {
515        tel_defines.CARRIER_TMO: default_umts_operator_network_tbl,
516        tel_defines.CARRIER_ATT: default_umts_operator_network_tbl,
517        tel_defines.CARRIER_VZW: default_cdma_operator_network_tbl,
518        tel_defines.CARRIER_SPT: default_cdma_operator_network_tbl,
519        tel_defines.CARRIER_EEUK: default_umts_operator_network_tbl,
520        tel_defines.CARRIER_VFUK: default_umts_operator_network_tbl
521    }
522
523    umts_allowable_network_preference_tbl = \
524        [tel_defines.NETWORK_MODE_LTE_GSM_WCDMA,
525         tel_defines.NETWORK_MODE_WCDMA_PREF,
526         tel_defines.NETWORK_MODE_GSM_ONLY]
527
528    cdma_allowable_network_preference_tbl = \
529        [tel_defines.NETWORK_MODE_LTE_CDMA_EVDO,
530         tel_defines.NETWORK_MODE_CDMA,
531         tel_defines.NETWORK_MODE_CDMA_NO_EVDO,
532         tel_defines.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA]
533
534    allowable_network_preference_tbl = {
535        tel_defines.CARRIER_TMO: umts_allowable_network_preference_tbl,
536        tel_defines.CARRIER_ATT: umts_allowable_network_preference_tbl,
537        tel_defines.CARRIER_VZW: cdma_allowable_network_preference_tbl,
538        tel_defines.CARRIER_SPT: cdma_allowable_network_preference_tbl,
539        tel_defines.CARRIER_EEUK: umts_allowable_network_preference_tbl,
540        tel_defines.CARRIER_VFUK: umts_allowable_network_preference_tbl
541    }
542
543    voice_mail_number_get_function_tbl = {
544        tel_defines.CARRIER_TMO: get_tmo_voice_mail_number,
545        tel_defines.CARRIER_ATT: get_att_voice_mail_number,
546        tel_defines.CARRIER_SPT: get_spt_voice_mail_number
547    }
548
549    voice_mail_count_check_function_tbl = {
550        tel_defines.CARRIER_TMO: check_tmo_voice_mail_count,
551        tel_defines.CARRIER_ATT: check_att_voice_mail_count,
552        tel_defines.CARRIER_SPT: check_spt_voice_mail_count
553    }
554
555
556device_capabilities = {
557    NexusModelNames.ONE:
558    [tel_defines.CAPABILITY_PHONE, tel_defines.CAPABILITY_MSIM],
559    NexusModelNames.N5: [tel_defines.CAPABILITY_PHONE],
560    NexusModelNames.N5v2:
561    [tel_defines.CAPABILITY_PHONE, tel_defines.CAPABILITY_OMADM,
562     tel_defines.CAPABILITY_VOLTE, tel_defines.CAPABILITY_WFC,
563     tel_defines.CAPABILITY_VT],
564    NexusModelNames.N6: [tel_defines.CAPABILITY_PHONE,
565                         tel_defines.CAPABILITY_OMADM,
566                         tel_defines.CAPABILITY_VOLTE,
567                         tel_defines.CAPABILITY_WFC,
568                         tel_defines.CAPABILITY_VT],
569    NexusModelNames.N6v2: [tel_defines.CAPABILITY_PHONE,
570                           tel_defines.CAPABILITY_OMADM,
571                           tel_defines.CAPABILITY_VOLTE,
572                           tel_defines.CAPABILITY_WFC,
573                           tel_defines.CAPABILITY_VT]
574}
575
576operator_capabilities = {
577    tel_defines.CARRIER_VZW: [tel_defines.CAPABILITY_PHONE,
578                              tel_defines.CAPABILITY_OMADM,
579                              tel_defines.CAPABILITY_VOLTE,
580                              tel_defines.CAPABILITY_VT],
581    tel_defines.CARRIER_ATT: [tel_defines.CAPABILITY_PHONE],
582    tel_defines.CARRIER_TMO: [tel_defines.CAPABILITY_PHONE,
583                              tel_defines.CAPABILITY_VOLTE,
584                              tel_defines.CAPABILITY_WFC],
585    tel_defines.CARRIER_SPT: [tel_defines.CAPABILITY_PHONE],
586    tel_defines.CARRIER_EEUK: [tel_defines.CAPABILITY_PHONE],
587    tel_defines.CARRIER_VFUK: [tel_defines.CAPABILITY_PHONE]
588}
589