• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3.4
2#
3#   Copyright 2022 - 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    Test Script for Telephony Pre Check In Sanity
18"""
19
20import time
21from acts import signals
22from acts.test_decorators import test_tracker_info
23from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
24from acts_contrib.test_utils.tel.tel_defines import CARRIER_VZW
25from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING
26from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_DISABLED
27from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
28from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
29from acts_contrib.test_utils.tel.tel_data_utils import get_mobile_data_usage
30from acts_contrib.test_utils.tel.tel_data_utils import remove_mobile_data_usage_limit
31from acts_contrib.test_utils.tel.tel_data_utils import set_mobile_data_usage_limit
32from acts_contrib.test_utils.tel.tel_message_utils import sms_in_collision_send_receive_verify
33from acts_contrib.test_utils.tel.tel_message_utils import sms_rx_power_off_multiple_send_receive_verify
34from acts_contrib.test_utils.tel.tel_message_utils import message_test
35from acts_contrib.test_utils.tel.tel_phone_setup_utils import ensure_phone_default_state
36from acts_contrib.test_utils.tel.tel_phone_setup_utils import ensure_phones_idle
37from acts_contrib.test_utils.tel.tel_subscription_utils import get_incoming_message_sub_id
38from acts_contrib.test_utils.tel.tel_subscription_utils import get_outgoing_message_sub_id
39from acts_contrib.test_utils.tel.tel_test_utils import get_operator_name
40from acts_contrib.test_utils.tel.tel_test_utils import install_message_apk
41from acts.utils import rand_ascii_str
42from acts.libs.utils.multithread import multithread_func
43
44class TelLiveSmsTest(TelephonyBaseTest):
45    def setup_class(self):
46        TelephonyBaseTest.setup_class(self)
47        self.message_lengths = (50, 160, 180)
48
49        self.message_util = self.user_params.get("message_apk", None)
50        if isinstance(self.message_util, list):
51            self.message_util = self.message_util[0]
52
53        if self.message_util:
54            ads = self.android_devices
55            for ad in ads:
56                install_message_apk(ad, self.message_util)
57
58    def teardown_test(self):
59        ensure_phones_idle(self.log, self.android_devices)
60
61    def _get_wfc_mode(self, ad, sub_id):
62        # Verizon doesn't supports wfc mode as WFC_MODE_WIFI_PREFERRED
63        carrier = ad.telephony["subscription"][sub_id]["operator"]
64        if carrier == CARRIER_VZW:
65            wfc = WFC_MODE_CELLULAR_PREFERRED
66        else:
67            wfc = WFC_MODE_WIFI_PREFERRED
68        return wfc
69
70    def check_band_support(self,ad):
71        carrier = ad.adb.getprop("gsm.sim.operator.alpha")
72
73        if int(ad.adb.getprop("ro.product.first_api_level")) > 30 and (
74                carrier == "Verizon"):
75            raise signals.TestSkip(
76                "Device Doesn't Support 2g/3G Band.")
77
78    def _sms_in_collision_test(self, ads):
79        for length in self.message_lengths:
80            message_array = [rand_ascii_str(length)]
81            message_array2 = [rand_ascii_str(length)]
82            if not sms_in_collision_send_receive_verify(
83                    self.log,
84                    ads[0],
85                    ads[0],
86                    ads[1],
87                    ads[2],
88                    message_array,
89                    message_array2):
90                ads[0].log.warning(
91                    "Test of SMS collision with length %s failed", length)
92                return False
93            else:
94                ads[0].log.info(
95                    "Test of SMS collision with length %s succeeded", length)
96        self.log.info(
97            "Test of SMS collision with lengths %s characters succeeded.",
98            self.message_lengths)
99        return True
100
101    def _sms_in_collision_when_power_off_test(self, ads):
102        for length in self.message_lengths:
103            if not sms_rx_power_off_multiple_send_receive_verify(
104                    self.log,
105                    ads[0],
106                    ads[1],
107                    ads[2],
108                    length,
109                    length,
110                    5,
111                    5):
112                ads[0].log.warning(
113                    "Test of SMS collision when power off with length %s failed",
114                    length)
115                return False
116            else:
117                ads[0].log.info(
118                    "Test of SMS collision when power off with length %s "
119                    "succeeded",
120                    length)
121        self.log.info(
122            "Test of SMS collision when power offwith lengths %s characters "
123            "succeeded.",
124            self.message_lengths)
125        return True
126
127    """ Tests Begin """
128
129    @test_tracker_info(uuid="480b6ba2-1e5f-4a58-9d88-9b75c8fab1b6")
130    @TelephonyBaseTest.tel_test_wrap
131    def test_sms_mo_general(self):
132        """Test SMS basic function between two phone. Phones in any network.
133
134        Airplane mode is off.
135        Send SMS from PhoneA to PhoneB.
136        Verify received message on PhoneB is correct.
137
138        Returns:
139            True if success.
140            False if failed.
141        """
142        return message_test(
143            self.log,
144            self.android_devices[0],
145            self.android_devices[1],
146            mo_rat='default',
147            mt_rat='default')
148
149    @test_tracker_info(uuid="aa87fe73-8236-44c7-865c-3fe3b733eeb4")
150    @TelephonyBaseTest.tel_test_wrap
151    def test_sms_mt_general(self):
152        """Test SMS basic function between two phone. Phones in any network.
153
154        Airplane mode is off.
155        Send SMS from PhoneB to PhoneA.
156        Verify received message on PhoneA is correct.
157
158        Returns:
159            True if success.
160            False if failed.
161        """
162        return message_test(
163            self.log,
164            self.android_devices[1],
165            self.android_devices[0],
166            mo_rat='default',
167            mt_rat='default')
168
169    @test_tracker_info(uuid="bb8e1a06-a4b5-4f9b-9ab2-408ace9a1deb")
170    @TelephonyBaseTest.tel_test_wrap
171    def test_mms_mo_general(self):
172        """Test MMS basic function between two phone. Phones in any network.
173
174        Airplane mode is off.
175        Send MMS from PhoneA to PhoneB.
176        Verify received message on PhoneB is correct.
177
178        Returns:
179            True if success.
180            False if failed.
181        """
182        return message_test(
183            self.log,
184            self.android_devices[0],
185            self.android_devices[1],
186            mo_rat='default',
187            mt_rat='default',
188            msg_type='mms')
189
190    @test_tracker_info(uuid="f2779e1e-7d09-43f0-8b5c-87eae5d146be")
191    @TelephonyBaseTest.tel_test_wrap
192    def test_mms_mt_general(self):
193        """Test MMS basic function between two phone. Phones in any network.
194
195        Airplane mode is off.
196        Send MMS from PhoneB to PhoneA.
197        Verify received message on PhoneA is correct.
198
199        Returns:
200            True if success.
201            False if failed.
202        """
203        return message_test(
204            self.log,
205            self.android_devices[1],
206            self.android_devices[0],
207            mo_rat='default',
208            mt_rat='default',
209            msg_type='mms')
210
211    @test_tracker_info(uuid="2c229a4b-c954-4ba3-94ba-178dc7784d03")
212    @TelephonyBaseTest.tel_test_wrap
213    def test_sms_mo_2g(self):
214        """Test SMS basic function between two phone. Phones in 3g network.
215
216        Airplane mode is off.
217        Send SMS from PhoneA to PhoneB.
218        Verify received message on PhoneB is correct.
219
220        Returns:
221            True if success.
222            False if failed.
223        """
224        self.check_band_support(self.android_devices[0])
225        return message_test(
226            self.log,
227            self.android_devices[0],
228            self.android_devices[1],
229            mo_rat='2g',
230            mt_rat='general')
231
232    @test_tracker_info(uuid="17fafc41-7e12-47ab-a4cc-fb9bd94e79b9")
233    @TelephonyBaseTest.tel_test_wrap
234    def test_sms_mt_2g(self):
235        """Test SMS basic function between two phone. Phones in 3g network.
236
237        Airplane mode is off.
238        Send SMS from PhoneB to PhoneA.
239        Verify received message on PhoneA is correct.
240
241        Returns:
242            True if success.
243            False if failed.
244        """
245        self.check_band_support(self.android_devices[0])
246        return message_test(
247            self.log,
248            self.android_devices[1],
249            self.android_devices[0],
250            mo_rat='general',
251            mt_rat='2g')
252
253    @test_tracker_info(uuid="b4919317-18b5-483c-82f4-ced37a04f28d")
254    @TelephonyBaseTest.tel_test_wrap
255    def test_mms_mo_2g(self):
256        """Test MMS basic function between two phone. Phones in 3g network.
257
258        Airplane mode is off.
259        Send MMS from PhoneA to PhoneB.
260        Verify received message on PhoneB is correct.
261
262        Returns:
263            True if success.
264            False if failed.
265        """
266        self.check_band_support(self.android_devices[0])
267        return message_test(
268            self.log,
269            self.android_devices[0],
270            self.android_devices[1],
271            mo_rat='2g',
272            mt_rat='general',
273            msg_type='mms')
274
275    @test_tracker_info(uuid="cd56bb8a-0794-404d-95bd-c5fd00f4b35a")
276    @TelephonyBaseTest.tel_test_wrap
277    def test_mms_mt_2g(self):
278        """Test MMS basic function between two phone. Phones in 3g network.
279
280        Airplane mode is off.
281        Send MMS from PhoneB to PhoneA.
282        Verify received message on PhoneA is correct.
283
284        Returns:
285            True if success.
286            False if failed.
287        """
288        self.check_band_support(self.android_devices[0])
289        return message_test(
290            self.log,
291            self.android_devices[1],
292            self.android_devices[0],
293            mo_rat='general',
294            mt_rat='2g',
295            msg_type='mms')
296
297    @test_tracker_info(uuid="b39fbc30-9cc2-4d86-a9f4-6f0c1dd0a905")
298    @TelephonyBaseTest.tel_test_wrap
299    def test_mms_mo_2g_wifi(self):
300        """Test MMS basic function between two phone. Phones in 3g network.
301
302        Airplane mode is off. Phone in 2G.
303        Connect to Wifi.
304        Send MMS from PhoneA to PhoneB.
305        Verify received message on PhoneB is correct.
306
307        Returns:
308            True if success.
309            False if failed.
310        """
311        self.check_band_support(self.android_devices[0])
312        return message_test(
313            self.log,
314            self.android_devices[0],
315            self.android_devices[1],
316            mo_rat='2g',
317            mt_rat='general',
318            msg_type='mms',
319            wifi_ssid=self.wifi_network_ssid,
320            wifi_pwd=self.wifi_network_pass)
321
322    @test_tracker_info(uuid="b158a0a7-9697-4b3b-8d5b-f9b6b6bc1c03")
323    @TelephonyBaseTest.tel_test_wrap
324    def test_mms_mt_2g_wifi(self):
325        """Test MMS basic function between two phone. Phones in 3g network.
326
327        Airplane mode is off. Phone in 2G.
328        Connect to Wifi.
329        Send MMS from PhoneB to PhoneA.
330        Verify received message on PhoneA is correct.
331
332        Returns:
333            True if success.
334            False if failed.
335        """
336        self.check_band_support(self.android_devices[0])
337        return message_test(
338            self.log,
339            self.android_devices[1],
340            self.android_devices[0],
341            mo_rat='general',
342            mt_rat='2g',
343            msg_type='mms',
344            wifi_ssid=self.wifi_network_ssid,
345            wifi_pwd=self.wifi_network_pass)
346
347    @test_tracker_info(uuid="f094e3da-2523-4f92-a1f3-7cf9edcff850")
348    @TelephonyBaseTest.tel_test_wrap
349    def test_sms_mo_3g(self):
350        """Test SMS basic function between two phone. Phones in 3g network.
351
352        Airplane mode is off.
353        Send SMS from PhoneA to PhoneB.
354        Verify received message on PhoneB is correct.
355
356        Returns:
357            True if success.
358            False if failed.
359        """
360        self.check_band_support(self.android_devices[0])
361        return message_test(
362            self.log,
363            self.android_devices[0],
364            self.android_devices[1],
365            mo_rat='3g',
366            mt_rat='general')
367
368    @test_tracker_info(uuid="2186e152-bf83-4d6e-93eb-b4bf9ae2d76e")
369    @TelephonyBaseTest.tel_test_wrap
370    def test_sms_mt_3g(self):
371        """Test SMS basic function between two phone. Phones in 3g network.
372
373        Airplane mode is off.
374        Send SMS from PhoneB to PhoneA.
375        Verify received message on PhoneA is correct.
376
377        Returns:
378            True if success.
379            False if failed.
380        """
381        self.check_band_support(self.android_devices[0])
382        return message_test(
383            self.log,
384            self.android_devices[1],
385            self.android_devices[0],
386            mo_rat='general',
387            mt_rat='3g')
388
389    @test_tracker_info(uuid="e716c678-eee9-4a0d-a9cd-ca9eae4fea51")
390    @TelephonyBaseTest.tel_test_wrap
391    def test_mms_mo_3g(self):
392        """Test MMS basic function between two phone. Phones in 3g network.
393
394        Airplane mode is off. Phone in 3G.
395        Send MMS from PhoneA to PhoneB.
396        Verify received message on PhoneB is correct.
397
398        Returns:
399            True if success.
400            False if failed.
401        """
402        self.check_band_support(self.android_devices[0])
403        return message_test(
404            self.log,
405            self.android_devices[0],
406            self.android_devices[1],
407            mo_rat='3g',
408            mt_rat='general',
409            msg_type='mms')
410
411    @test_tracker_info(uuid="e864a99e-d935-4bd9-95f6-8183cdd3d760")
412    @TelephonyBaseTest.tel_test_wrap
413    def test_mms_mt_3g(self):
414        """Test MMS basic function between two phone. Phones in 3g network.
415
416        Airplane mode is off. Phone in 3G.
417        Send MMS from PhoneB to PhoneA.
418        Verify received message on PhoneA is correct.
419
420        Returns:
421            True if success.
422            False if failed.
423        """
424        self.check_band_support(self.android_devices[0])
425        return message_test(
426            self.log,
427            self.android_devices[1],
428            self.android_devices[0],
429            mo_rat='general',
430            mt_rat='3g',
431            msg_type='mms')
432
433    @test_tracker_info(uuid="07cdfe26-9021-4af3-8bf6-1abd0cb9e932")
434    @TelephonyBaseTest.tel_test_wrap
435    def test_sms_long_message_mo_3g(self):
436        """Test SMS basic function between two phone. Phones in 3g network.
437
438        Airplane mode is off.
439        Send SMS from PhoneA to PhoneB.
440        Verify received message on PhoneB is correct.
441
442        Returns:
443            True if success.
444            False if failed.
445        """
446        self.check_band_support(self.android_devices[0])
447        return message_test(
448            self.log,
449            self.android_devices[0],
450            self.android_devices[1],
451            mo_rat='3g',
452            mt_rat='general',
453            long_msg=True)
454
455    @test_tracker_info(uuid="740efe0d-fef9-42bc-a732-fe79a3485426")
456    @TelephonyBaseTest.tel_test_wrap
457    def test_sms_long_message_mt_3g(self):
458        """Test SMS basic function between two phone. Phones in 3g network.
459
460        Airplane mode is off.
461        Send SMS from PhoneB to PhoneA.
462        Verify received message on PhoneA is correct.
463
464        Returns:
465            True if success.
466            False if failed.
467        """
468        self.check_band_support(self.android_devices[0])
469        return message_test(
470            self.log,
471            self.android_devices[1],
472            self.android_devices[0],
473            mo_rat='general',
474            mt_rat='3g',
475            long_msg=True)
476
477    @test_tracker_info(uuid="b0d27de3-1a98-48da-a9c9-c20c8587f256")
478    @TelephonyBaseTest.tel_test_wrap
479    def test_mms_long_message_mo_3g(self):
480        """Test MMS basic function between two phone. Phones in 3g network.
481
482        Airplane mode is off. Phone in 3G.
483        Send MMS from PhoneA to PhoneB.
484        Verify received message on PhoneB is correct.
485
486        Returns:
487            True if success.
488            False if failed.
489        """
490        self.check_band_support(self.android_devices[0])
491        return message_test(
492            self.log,
493            self.android_devices[0],
494            self.android_devices[1],
495            mo_rat='3g',
496            mt_rat='general',
497            msg_type='mms',
498            long_msg=True)
499
500    @test_tracker_info(uuid="fd5a1583-94d2-4b3a-b613-a0a9745daa25")
501    @TelephonyBaseTest.tel_test_wrap
502    def test_mms_long_message_mt_3g(self):
503        """Test MMS basic function between two phone. Phones in 3g network.
504
505        Airplane mode is off. Phone in 3G.
506        Send MMS from PhoneB to PhoneA.
507        Verify received message on PhoneA is correct.
508
509        Returns:
510            True if success.
511            False if failed.
512        """
513        self.check_band_support(self.android_devices[0])
514        return message_test(
515            self.log,
516            self.android_devices[1],
517            self.android_devices[0],
518            mo_rat='general',
519            mt_rat='3g',
520            msg_type='mms',
521            long_msg=True)
522
523    @test_tracker_info(uuid="c6cfba55-6cde-41cd-93bb-667c317a0127")
524    @TelephonyBaseTest.tel_test_wrap
525    def test_mms_mo_3g_wifi(self):
526        """Test MMS basic function between two phone. Phones in 3g network.
527
528        Airplane mode is off. Phone in 3G.
529        Connect to Wifi.
530        Send MMS from PhoneA to PhoneB.
531        Verify received message on PhoneB is correct.
532
533        Returns:
534            True if success.
535            False if failed.
536        """
537        self.check_band_support(self.android_devices[0])
538        return message_test(
539            self.log,
540            self.android_devices[0],
541            self.android_devices[1],
542            mo_rat='3g',
543            mt_rat='general',
544            msg_type='mms',
545            wifi_ssid=self.wifi_network_ssid,
546            wifi_pwd=self.wifi_network_pass)
547
548    @test_tracker_info(uuid="83c5dd99-f2fe-433d-9775-80a36d0d493b")
549    @TelephonyBaseTest.tel_test_wrap
550    def test_mms_mt_3g_wifi(self):
551        """Test MMS basic function between two phone. Phones in 3g network.
552
553        Airplane mode is off. Phone in 3G.
554        Connect to Wifi.
555        Send MMS from PhoneB to PhoneA.
556        Verify received message on PhoneA is correct.
557
558        Returns:
559            True if success.
560            False if failed.
561        """
562        self.check_band_support(self.android_devices[0])
563        return message_test(
564            self.log,
565            self.android_devices[1],
566            self.android_devices[0],
567            mo_rat='general',
568            mt_rat='3g',
569            msg_type='mms',
570            wifi_ssid=self.wifi_network_ssid,
571            wifi_pwd=self.wifi_network_pass)
572
573    @test_tracker_info(uuid="54a68d6a-dae7-4fe6-b2bb-7c73151a4a73")
574    @TelephonyBaseTest.tel_test_wrap
575    def test_sms_mo_4g_volte(self):
576        """Test SMS text function between two phone. Phones in LTE network.
577
578        Airplane mode is off. VoLTE is enabled on PhoneA.
579        Send MMS from PhoneA to PhoneB.
580        Verify received message on PhoneB is correct.
581
582        Returns:
583            True if success.
584            False if failed.
585        """
586        return message_test(
587            self.log,
588            self.android_devices[0],
589            self.android_devices[1],
590            mo_rat='volte',
591            mt_rat='general')
592
593    @test_tracker_info(uuid="d0adcd69-37fc-49d1-8dd3-c03dd163fb25")
594    @TelephonyBaseTest.tel_test_wrap
595    def test_sms_mt_4g_volte(self):
596        """Test SMS text function between two phone. Phones in LTE network.
597
598        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
599        Send MMS from PhoneB to PhoneA.
600        Verify received message on PhoneA is correct.
601
602        Returns:
603            True if success.
604            False if failed.
605        """
606        return message_test(
607            self.log,
608            self.android_devices[1],
609            self.android_devices[0],
610            mo_rat='general',
611            mt_rat='volte')
612
613    @test_tracker_info(uuid="8d454a25-a1e5-4872-8193-d435a84d54fa")
614    @TelephonyBaseTest.tel_test_wrap
615    def test_mms_mo_4g_volte(self):
616        """Test MMS text function between two phone. Phones in LTE network.
617
618        Airplane mode is off. VoLTE is enabled on PhoneA.
619        Send MMS from PhoneA to PhoneB.
620        Verify received message on PhoneB is correct.
621
622        Returns:
623            True if success.
624            False if failed.
625        """
626        return message_test(
627            self.log,
628            self.android_devices[0],
629            self.android_devices[1],
630            mo_rat='volte',
631            mt_rat='general',
632            msg_type='mms')
633
634    @test_tracker_info(uuid="79b8239e-9e6a-4781-942b-2df5b060718d")
635    @TelephonyBaseTest.tel_test_wrap
636    def test_mms_mt_4g_volte(self):
637        """Test MMS text function between two phone. Phones in LTE network.
638
639        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
640        Send MMS from PhoneB to PhoneA.
641        Verify received message on PhoneA is correct.
642
643        Returns:
644            True if success.
645            False if failed.
646        """
647        return message_test(
648            self.log,
649            self.android_devices[1],
650            self.android_devices[0],
651            mo_rat='general',
652            mt_rat='volte',
653            msg_type='mms')
654
655    @test_tracker_info(uuid="5b9e1195-1e42-4405-890f-631e8c58d0c2")
656    @TelephonyBaseTest.tel_test_wrap
657    def test_sms_long_message_mo_4g_volte(self):
658        """Test SMS text function between two phone. Phones in LTE network.
659
660        Airplane mode is off. VoLTE is enabled on PhoneA.
661        Send MMS from PhoneA to PhoneB.
662        Verify received message on PhoneB is correct.
663
664        Returns:
665            True if success.
666            False if failed.
667        """
668        return message_test(
669            self.log,
670            self.android_devices[0],
671            self.android_devices[1],
672            mo_rat='volte',
673            mt_rat='general',
674            long_msg=True)
675
676    @test_tracker_info(uuid="c328cbe7-1899-4ca8-af1c-5eb05683a322")
677    @TelephonyBaseTest.tel_test_wrap
678    def test_sms_long_message_mt_4g_volte(self):
679        """Test SMS text function between two phone. Phones in LTE network.
680
681        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
682        Send MMS from PhoneB to PhoneA.
683        Verify received message on PhoneA is correct.
684
685        Returns:
686            True if success.
687            False if failed.
688        """
689        return message_test(
690            self.log,
691            self.android_devices[1],
692            self.android_devices[0],
693            mo_rat='general',
694            mt_rat='volte',
695            long_msg=True)
696
697    @test_tracker_info(uuid="a843c2f7-e4de-4b99-b3a9-f05ecda5fe73")
698    @TelephonyBaseTest.tel_test_wrap
699    def test_mms_long_message_mo_4g_volte(self):
700        """Test MMS text function between two phone. Phones in LTE network.
701
702        Airplane mode is off. VoLTE is enabled on PhoneA.
703        Send MMS from PhoneA to PhoneB.
704        Verify received message on PhoneB is correct.
705
706        Returns:
707            True if success.
708            False if failed.
709        """
710        return message_test(
711            self.log,
712            self.android_devices[0],
713            self.android_devices[1],
714            mo_rat='volte',
715            mt_rat='general',
716            msg_type='mms',
717            long_msg=True)
718
719    @test_tracker_info(uuid="26dcba4d-7ddb-438d-84e7-0e754178b5ef")
720    @TelephonyBaseTest.tel_test_wrap
721    def test_mms_long_message_mt_4g_volte(self):
722        """Test MMS text function between two phone. Phones in LTE network.
723
724        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
725        Send MMS from PhoneB to PhoneA.
726        Verify received message on PhoneA is correct.
727
728        Returns:
729            True if success.
730            False if failed.
731        """
732        return message_test(
733            self.log,
734            self.android_devices[1],
735            self.android_devices[0],
736            mo_rat='general',
737            mt_rat='volte',
738            msg_type='mms',
739            long_msg=True)
740
741    @test_tracker_info(uuid="c97687e2-155a-4cf3-9f51-22543b89d53e")
742    @TelephonyBaseTest.tel_test_wrap
743    def test_sms_mo_4g(self):
744        """Test SMS basic function between two phone. Phones in LTE network.
745
746        Airplane mode is off.
747        Send SMS from PhoneA to PhoneB.
748        Verify received message on PhoneB is correct.
749
750        Returns:
751            True if success.
752            False if failed.
753        """
754        return message_test(
755            self.log,
756            self.android_devices[0],
757            self.android_devices[1],
758            mo_rat='csfb',
759            mt_rat='general')
760
761    @test_tracker_info(uuid="e2e01a47-2b51-4d00-a7b2-dbd3c8ffa6ae")
762    @TelephonyBaseTest.tel_test_wrap
763    def test_sms_mt_4g(self):
764        """Test SMS basic function between two phone. Phones in LTE network.
765
766        Airplane mode is off.
767        Send SMS from PhoneB to PhoneA.
768        Verify received message on PhoneA is correct.
769
770        Returns:
771            True if success.
772            False if failed.
773        """
774        return message_test(
775            self.log,
776            self.android_devices[1],
777            self.android_devices[0],
778            mo_rat='general',
779            mt_rat='csfb')
780
781    @test_tracker_info(uuid="90fc6775-de19-49d1-8b8e-e3bc9384c733")
782    @TelephonyBaseTest.tel_test_wrap
783    def test_mms_mo_4g(self):
784        """Test MMS text function between two phone. Phones in LTE network.
785
786        Airplane mode is off.
787        Send MMS from PhoneA to PhoneB.
788        Verify received message on PhoneB is correct.
789
790        Returns:
791            True if success.
792            False if failed.
793        """
794        return message_test(
795            self.log,
796            self.android_devices[0],
797            self.android_devices[1],
798            mo_rat='csfb',
799            mt_rat='general',
800            msg_type='mms')
801
802    @test_tracker_info(uuid="274572bb-ec9f-4c30-aab4-1f4c3f16b372")
803    @TelephonyBaseTest.tel_test_wrap
804    def test_mms_mt_4g(self):
805        """Test MMS text function between two phone. Phones in LTE network.
806
807        Airplane mode is off. Phone in 4G.
808        Send MMS from PhoneB to PhoneA.
809        Verify received message on PhoneA is correct.
810
811        Returns:
812            True if success.
813            False if failed.
814        """
815        return message_test(
816            self.log,
817            self.android_devices[1],
818            self.android_devices[0],
819            mo_rat='general',
820            mt_rat='csfb',
821            msg_type='mms')
822
823    @test_tracker_info(uuid="44392814-98dd-406a-ae82-5c39e2d082f3")
824    @TelephonyBaseTest.tel_test_wrap
825    def test_sms_long_message_mo_4g(self):
826        """Test SMS basic function between two phone. Phones in LTE network.
827
828        Airplane mode is off.
829        Send SMS from PhoneA to PhoneB.
830        Verify received message on PhoneB is correct.
831
832        Returns:
833            True if success.
834            False if failed.
835        """
836        return message_test(
837            self.log,
838            self.android_devices[0],
839            self.android_devices[1],
840            mo_rat='csfb',
841            mt_rat='general',
842            long_msg=True)
843
844    @test_tracker_info(uuid="0f8358a5-a7d5-4dfa-abe0-99fb8b10d48d")
845    @TelephonyBaseTest.tel_test_wrap
846    def test_sms_long_message_mt_4g(self):
847        """Test SMS basic function between two phone. Phones in LTE network.
848
849        Airplane mode is off.
850        Send SMS from PhoneB to PhoneA.
851        Verify received message on PhoneA is correct.
852
853        Returns:
854            True if success.
855            False if failed.
856        """
857        return message_test(
858            self.log,
859            self.android_devices[1],
860            self.android_devices[0],
861            mo_rat='general',
862            mt_rat='csfb',
863            long_msg=True)
864
865    @test_tracker_info(uuid="18edde2b-7db9-40f4-96c4-3286a56d090b")
866    @TelephonyBaseTest.tel_test_wrap
867    def test_mms_long_message_mo_4g(self):
868        """Test MMS text function between two phone. Phones in LTE network.
869
870        Airplane mode is off.
871        Send MMS from PhoneA to PhoneB.
872        Verify received message on PhoneB is correct.
873
874        Returns:
875            True if success.
876            False if failed.
877        """
878        return message_test(
879            self.log,
880            self.android_devices[0],
881            self.android_devices[1],
882            mo_rat='csfb',
883            mt_rat='general',
884            msg_type='mms',
885            long_msg=True)
886
887    @test_tracker_info(uuid="49805d08-6f1f-4c90-9bf4-e9acd6f63640")
888    @TelephonyBaseTest.tel_test_wrap
889    def test_mms_long_message_mt_4g(self):
890        """Test MMS text function between two phone. Phones in LTE network.
891
892        Airplane mode is off. Phone in 4G.
893        Send MMS from PhoneB to PhoneA.
894        Verify received message on PhoneA is correct.
895
896        Returns:
897            True if success.
898            False if failed.
899        """
900        return message_test(
901            self.log,
902            self.android_devices[1],
903            self.android_devices[0],
904            mo_rat='general',
905            mt_rat='csfb',
906            msg_type='mms',
907            long_msg=True)
908
909    @test_tracker_info(uuid="c7349fdf-a376-4846-b466-1f329bd1557f")
910    @TelephonyBaseTest.tel_test_wrap
911    def test_mms_mo_4g_wifi(self):
912        """Test MMS text function between two phone. Phones in LTE network.
913
914        Airplane mode is off. Phone in 4G.
915        Connect to Wifi.
916        Send MMS from PhoneA to PhoneB.
917        Verify received message on PhoneB is correct.
918
919        Returns:
920            True if success.
921            False if failed.
922        """
923        return message_test(
924            self.log,
925            self.android_devices[0],
926            self.android_devices[1],
927            mo_rat='csfb',
928            mt_rat='general',
929            msg_type='mms',
930            wifi_ssid=self.wifi_network_ssid,
931            wifi_pwd=self.wifi_network_pass)
932
933    @test_tracker_info(uuid="1affab34-e03c-49dd-9062-e9ed8eac406b")
934    @TelephonyBaseTest.tel_test_wrap
935    def test_mms_mt_4g_wifi(self):
936        """Test MMS text function between two phone. Phones in LTE network.
937
938        Airplane mode is off. Phone in 4G.
939        Connect to Wifi.
940        Send MMS from PhoneB to PhoneA.
941        Verify received message on PhoneA is correct.
942
943        Returns:
944            True if success.
945            False if failed.
946        """
947        return message_test(
948            self.log,
949            self.android_devices[1],
950            self.android_devices[0],
951            mo_rat='general',
952            mt_rat='csfb',
953            msg_type='mms',
954            wifi_ssid=self.wifi_network_ssid,
955            wifi_pwd=self.wifi_network_pass)
956
957    @test_tracker_info(uuid="7ee57edb-2962-4d20-b6eb-79cebce91fff")
958    @TelephonyBaseTest.tel_test_wrap
959    def test_sms_mo_in_call_volte(self):
960        """ Test MO SMS during a MO VoLTE call.
961
962        Make sure PhoneA is in LTE mode (with VoLTE).
963        Make sure PhoneB is able to make/receive call.
964        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
965
966        Returns:
967            True if pass; False if fail.
968        """
969        return message_test(
970            self.log,
971            self.android_devices[0],
972            self.android_devices[1],
973            mo_rat='volte',
974            mt_rat='general',
975            msg_in_call=True)
976
977    @test_tracker_info(uuid="5576276b-4ca1-41cc-bb74-31ccd71f9f96")
978    @TelephonyBaseTest.tel_test_wrap
979    def test_sms_mt_in_call_volte(self):
980        """ Test MT SMS during a MO VoLTE call.
981
982        Make sure PhoneA is in LTE mode (with VoLTE).
983        Make sure PhoneB is able to make/receive call.
984        Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA.
985
986        Returns:
987            True if pass; False if fail.
988        """
989        return message_test(
990            self.log,
991            self.android_devices[1],
992            self.android_devices[0],
993            mo_rat='general',
994            mt_rat='volte',
995            msg_in_call=True)
996
997    @test_tracker_info(uuid="3bf8ff74-baa6-4dc6-86eb-c13816fa9bc8")
998    @TelephonyBaseTest.tel_test_wrap
999    def test_mms_mo_in_call_volte(self):
1000        """ Test MO MMS during a MO VoLTE call.
1001
1002        Make sure PhoneA is in LTE mode (with VoLTE).
1003        Make sure PhoneB is able to make/receive call.
1004        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1005
1006        Returns:
1007            True if pass; False if fail.
1008        """
1009        return message_test(
1010            self.log,
1011            self.android_devices[0],
1012            self.android_devices[1],
1013            mo_rat='volte',
1014            mt_rat='general',
1015            msg_type='mms',
1016            msg_in_call=True)
1017
1018    @test_tracker_info(uuid="289e6516-5f66-403a-b292-50d067151730")
1019    @TelephonyBaseTest.tel_test_wrap
1020    def test_mms_mt_in_call_volte(self):
1021        """ Test MT MMS during a MO VoLTE call.
1022
1023        Make sure PhoneA is in LTE mode (with VoLTE).
1024        Make sure PhoneB is able to make/receive call.
1025        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1026
1027        Returns:
1028            True if pass; False if fail.
1029        """
1030        return message_test(
1031            self.log,
1032            self.android_devices[1],
1033            self.android_devices[0],
1034            mo_rat='general',
1035            mt_rat='volte',
1036            msg_type='mms',
1037            msg_in_call=True)
1038
1039    @test_tracker_info(uuid="5654d974-3c32-4cce-9d07-0c96213dacc5")
1040    @TelephonyBaseTest.tel_test_wrap
1041    def test_mms_mo_in_call_volte_wifi(self):
1042        """ Test MO MMS during a MO VoLTE call.
1043
1044        Make sure PhoneA is in LTE mode (with VoLTE).
1045        Make sure PhoneB is able to make/receive call.
1046        Connect PhoneA to Wifi.
1047        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1048
1049        Returns:
1050            True if pass; False if fail.
1051        """
1052        return message_test(
1053            self.log,
1054            self.android_devices[0],
1055            self.android_devices[1],
1056            mo_rat='volte',
1057            mt_rat='general',
1058            msg_type='mms',
1059            msg_in_call=True,
1060            wifi_ssid=self.wifi_network_ssid,
1061            wifi_pwd=self.wifi_network_pass)
1062
1063    @test_tracker_info(uuid="cbd5ab3d-d76a-4ece-ac09-62efeead7550")
1064    @TelephonyBaseTest.tel_test_wrap
1065    def test_mms_mt_in_call_volte_wifi(self):
1066        """ Test MT MMS during a MO VoLTE call.
1067
1068        Make sure PhoneA is in LTE mode (with VoLTE).
1069        Make sure PhoneB is able to make/receive call.
1070        Connect PhoneA to Wifi.
1071        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1072
1073        Returns:
1074            True if pass; False if fail.
1075        """
1076        return message_test(
1077            self.log,
1078            self.android_devices[1],
1079            self.android_devices[0],
1080            mo_rat='general',
1081            mt_rat='volte',
1082            msg_type='mms',
1083            msg_in_call=True,
1084            wifi_ssid=self.wifi_network_ssid,
1085            wifi_pwd=self.wifi_network_pass)
1086
1087    @test_tracker_info(uuid="b6e9ce80-8577-48e5-baa7-92780932f278")
1088    @TelephonyBaseTest.tel_test_wrap
1089    def test_sms_mo_in_call_csfb(self):
1090        """ Test MO SMS during a MO csfb call.
1091
1092        Make sure PhoneA is in LTE mode (no VoLTE).
1093        Make sure PhoneB is able to make/receive call.
1094        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
1095
1096        Returns:
1097            True if pass; False if fail.
1098        """
1099        return message_test(
1100            self.log,
1101            self.android_devices[0],
1102            self.android_devices[1],
1103            mo_rat='csfb',
1104            mt_rat='general',
1105            msg_in_call=True)
1106
1107    @test_tracker_info(uuid="93f0b58a-01e9-4bc9-944f-729d455597dd")
1108    @TelephonyBaseTest.tel_test_wrap
1109    def test_sms_mt_in_call_csfb(self):
1110        """ Test MT SMS during a MO csfb call.
1111
1112        Make sure PhoneA is in LTE mode (no VoLTE).
1113        Make sure PhoneB is able to make/receive call.
1114        Call from PhoneA to PhoneB, accept on PhoneB, receive receive on PhoneA.
1115
1116        Returns:
1117            True if pass; False if fail.
1118        """
1119        return message_test(
1120            self.log,
1121            self.android_devices[1],
1122            self.android_devices[0],
1123            mo_rat='general',
1124            mt_rat='csfb',
1125            msg_in_call=True)
1126
1127    @test_tracker_info(uuid="bd8e9e80-1955-429f-b122-96b127771bbb")
1128    @TelephonyBaseTest.tel_test_wrap
1129    def test_mms_mo_in_call_csfb(self):
1130        """ Test MO MMS during a MO csfb call.
1131
1132        Make sure PhoneA is in LTE mode (no VoLTE).
1133        Make sure PhoneB is able to make/receive call.
1134        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1135
1136        Returns:
1137            True if pass; False if fail.
1138        """
1139        return message_test(
1140            self.log,
1141            self.android_devices[0],
1142            self.android_devices[1],
1143            mo_rat='csfb',
1144            mt_rat='general',
1145            msg_type='mms',
1146            msg_in_call=True)
1147
1148    @test_tracker_info(uuid="89d65fd2-fc75-4fc5-a018-2d05a4364304")
1149    @TelephonyBaseTest.tel_test_wrap
1150    def test_mms_mt_in_call_csfb(self):
1151        """ Test MT MMS during a MO csfb call.
1152
1153        Make sure PhoneA is in LTE mode (no VoLTE).
1154        Make sure PhoneB is able to make/receive call.
1155        Call from PhoneA to PhoneB, accept on PhoneB, receive receive on PhoneA.
1156
1157        Returns:
1158            True if pass; False if fail.
1159        """
1160        return message_test(
1161            self.log,
1162            self.android_devices[1],
1163            self.android_devices[0],
1164            mo_rat='general',
1165            mt_rat='csfb',
1166            msg_type='mms',
1167            msg_in_call=True)
1168
1169    @test_tracker_info(uuid="9c542b5d-3b8f-4d4a-80de-fb804f066c3d")
1170    @TelephonyBaseTest.tel_test_wrap
1171    def test_mms_mo_in_call_csfb_wifi(self):
1172        """ Test MO MMS during a MO csfb call.
1173
1174        Make sure PhoneA is in LTE mode (no VoLTE).
1175        Make sure PhoneB is able to make/receive call.
1176        Connect PhoneA to Wifi.
1177        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1178
1179        Returns:
1180            True if pass; False if fail.
1181        """
1182        return message_test(
1183            self.log,
1184            self.android_devices[0],
1185            self.android_devices[1],
1186            mo_rat='csfb',
1187            mt_rat='general',
1188            msg_type='mms',
1189            msg_in_call=True,
1190            wifi_ssid=self.wifi_network_ssid,
1191            wifi_pwd=self.wifi_network_pass)
1192
1193    @test_tracker_info(uuid="c1bed6f5-f65c-4f4d-aa06-0e9f5c867819")
1194    @TelephonyBaseTest.tel_test_wrap
1195    def test_mms_mt_in_call_csfb_wifi(self):
1196        """ Test MT MMS during a MO csfb call.
1197
1198        Make sure PhoneA is in LTE mode (no VoLTE).
1199        Make sure PhoneB is able to make/receive call.
1200        Connect PhoneA to Wifi.
1201        Call from PhoneA to PhoneB, accept on PhoneB, receive receive on PhoneA.
1202
1203        Returns:
1204            True if pass; False if fail.
1205        """
1206        return message_test(
1207            self.log,
1208            self.android_devices[1],
1209            self.android_devices[0],
1210            mo_rat='general',
1211            mt_rat='csfb',
1212            msg_type='mms',
1213            msg_in_call=True,
1214            wifi_ssid=self.wifi_network_ssid,
1215            wifi_pwd=self.wifi_network_pass)
1216
1217    @test_tracker_info(uuid="60996028-b4b2-4a16-9e4b-eb6ef80179a7")
1218    @TelephonyBaseTest.tel_test_wrap
1219    def test_sms_mo_in_call_3g(self):
1220        """ Test MO SMS during a MO 3G call.
1221
1222        Make sure PhoneA is in 3g.
1223        Make sure PhoneB is able to make/receive call.
1224        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
1225
1226        Returns:
1227            True if pass; False if fail.
1228        """
1229        self.check_band_support(self.android_devices[0])
1230        return message_test(
1231            self.log,
1232            self.android_devices[0],
1233            self.android_devices[1],
1234            mo_rat='3g',
1235            mt_rat='general',
1236            msg_in_call=True)
1237
1238    @test_tracker_info(uuid="6b352aac-9b4e-4062-8980-3b1c0e61015b")
1239    @TelephonyBaseTest.tel_test_wrap
1240    def test_sms_mt_in_call_3g(self):
1241        """ Test MT SMS during a MO 3G call.
1242
1243        Make sure PhoneA is in 3g.
1244        Make sure PhoneB is able to make/receive call.
1245        Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA.
1246
1247        Returns:
1248            True if pass; False if fail.
1249        """
1250        self.check_band_support(self.android_devices[0])
1251        return message_test(
1252            self.log,
1253            self.android_devices[1],
1254            self.android_devices[0],
1255            mo_rat='general',
1256            mt_rat='3g',
1257            msg_in_call=True)
1258
1259    @test_tracker_info(uuid="cfae3613-c490-4ce0-b00b-c13286d85027")
1260    @TelephonyBaseTest.tel_test_wrap
1261    def test_mms_mo_in_call_3g(self):
1262        """ Test MO MMS during a MO 3G call.
1263
1264        Make sure PhoneA is in 3g.
1265        Make sure PhoneB is able to make/receive call.
1266        Call from PhoneA to PhoneB, accept on PhoneB.
1267        Send MMS on PhoneA during the call, MMS is send out after call is released.
1268
1269        Returns:
1270            True if pass; False if fail.
1271        """
1272        self.check_band_support(self.android_devices[0])
1273        return message_test(
1274            self.log,
1275            self.android_devices[0],
1276            self.android_devices[1],
1277            mo_rat='3g',
1278            mt_rat='general',
1279            msg_type='mms',
1280            msg_in_call=True)
1281
1282    @test_tracker_info(uuid="42fc8c16-4a30-4f63-9728-2639f2b79c4c")
1283    @TelephonyBaseTest.tel_test_wrap
1284    def test_mms_mt_in_call_3g(self):
1285        """ Test MT MMS during a MO 3G call.
1286
1287        Make sure PhoneA is in 3g.
1288        Make sure PhoneB is able to make/receive call.
1289        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1290
1291        Returns:
1292            True if pass; False if fail.
1293        """
1294        self.check_band_support(self.android_devices[0])
1295        return message_test(
1296            self.log,
1297            self.android_devices[1],
1298            self.android_devices[0],
1299            mo_rat='general',
1300            mt_rat='3g',
1301            msg_type='mms',
1302            msg_in_call=True)
1303
1304    @test_tracker_info(uuid="18093f87-aab5-4d86-b178-8085a1651828")
1305    @TelephonyBaseTest.tel_test_wrap
1306    def test_mms_mo_in_call_3g_wifi(self):
1307        """ Test MO MMS during a 3G call with Wifi on.
1308
1309        Make sure PhoneA is in 3g.
1310        Make sure PhoneB is able to make/receive call.
1311        Call from PhoneA to PhoneB, accept on PhoneB.
1312        Send MMS on PhoneA during the call, MMS is send out after call is released.
1313
1314        Returns:
1315            True if pass; False if fail.
1316        """
1317        self.check_band_support(self.android_devices[0])
1318        return message_test(
1319            self.log,
1320            self.android_devices[0],
1321            self.android_devices[1],
1322            mo_rat='3g',
1323            mt_rat='general',
1324            msg_type='mms',
1325            msg_in_call=True,
1326            wifi_ssid=self.wifi_network_ssid,
1327            wifi_pwd=self.wifi_network_pass)
1328
1329    @test_tracker_info(uuid="8fe3359a-0857-401f-a043-c47a2a2acb47")
1330    @TelephonyBaseTest.tel_test_wrap
1331    def test_mms_mt_in_call_3g_wifi(self):
1332        """ Test MT MMS during a 3G call with Wifi On.
1333
1334        Make sure PhoneA is in 3g.
1335        Make sure PhoneB is able to make/receive call.
1336        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1337
1338        Returns:
1339            True if pass; False if fail.
1340        """
1341        self.check_band_support(self.android_devices[0])
1342        return message_test(
1343            self.log,
1344            self.android_devices[1],
1345            self.android_devices[0],
1346            mo_rat='general',
1347            mt_rat='3g',
1348            msg_type='mms',
1349            msg_in_call=True,
1350            wifi_ssid=self.wifi_network_ssid,
1351            wifi_pwd=self.wifi_network_pass)
1352
1353    @test_tracker_info(uuid="ed720013-e366-448b-8901-bb09d26cea05")
1354    @TelephonyBaseTest.tel_test_wrap
1355    def test_sms_mo_iwlan(self):
1356        """ Test MO SMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1357
1358        Make sure PhoneA APM, WiFi connected, WFC cellular preferred mode.
1359        Make sure PhoneA report iwlan as data rat.
1360        Make sure PhoneB is able to make/receive call/sms.
1361        Send SMS on PhoneA.
1362
1363        Returns:
1364            True if pass; False if fail.
1365        """
1366        return message_test(
1367            self.log,
1368            self.android_devices[0],
1369            self.android_devices[1],
1370            mo_rat='wfc',
1371            mt_rat='general',
1372            is_airplane_mode=True,
1373            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1374            wifi_ssid=self.wifi_network_ssid,
1375            wifi_pwd=self.wifi_network_pass)
1376
1377    @test_tracker_info(uuid="4d4b0b7b-bf00-44f6-a0ed-23b438c30fc2")
1378    @TelephonyBaseTest.tel_test_wrap
1379    def test_sms_mt_iwlan(self):
1380        """ Test MT SMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1381
1382        Make sure PhoneA APM, WiFi connected, WFC cellular preferred mode.
1383        Make sure PhoneA report iwlan as data rat.
1384        Make sure PhoneB is able to make/receive call/sms.
1385        Receive SMS on PhoneA.
1386
1387        Returns:
1388            True if pass; False if fail.
1389        """
1390        return message_test(
1391            self.log,
1392            self.android_devices[1],
1393            self.android_devices[0],
1394            mo_rat='general',
1395            mt_rat='wfc',
1396            is_airplane_mode=True,
1397            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1398            wifi_ssid=self.wifi_network_ssid,
1399            wifi_pwd=self.wifi_network_pass)
1400
1401    @test_tracker_info(uuid="264e2557-e18c-41c0-8d99-49cee3fe6f07")
1402    @TelephonyBaseTest.tel_test_wrap
1403    def test_mms_mo_iwlan(self):
1404        """ Test MO MMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1405
1406        Make sure PhoneA APM, WiFi connected, WFC Cell preferred mode.
1407        Make sure PhoneA report iwlan as data rat.
1408        Make sure PhoneB is able to make/receive call/sms.
1409        Send MMS on PhoneA.
1410
1411        Returns:
1412            True if pass; False if fail.
1413        """
1414        return message_test(
1415            self.log,
1416            self.android_devices[0],
1417            self.android_devices[1],
1418            mo_rat='wfc',
1419            mt_rat='general',
1420            msg_type='mms',
1421            is_airplane_mode=True,
1422            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1423            wifi_ssid=self.wifi_network_ssid,
1424            wifi_pwd=self.wifi_network_pass)
1425
1426    @test_tracker_info(uuid="330db618-f074-4bfc-bf5e-78939fbee532")
1427    @TelephonyBaseTest.tel_test_wrap
1428    def test_mms_mt_iwlan(self):
1429        """ Test MT MMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1430
1431        Make sure PhoneA APM, WiFi connected, WFC Cell preferred mode.
1432        Make sure PhoneA report iwlan as data rat.
1433        Make sure PhoneB is able to make/receive call/sms.
1434        Receive MMS on PhoneA.
1435
1436        Returns:
1437            True if pass; False if fail.
1438        """
1439        return message_test(
1440            self.log,
1441            self.android_devices[1],
1442            self.android_devices[0],
1443            mo_rat='general',
1444            mt_rat='wfc',
1445            msg_type='mms',
1446            is_airplane_mode=True,
1447            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1448            wifi_ssid=self.wifi_network_ssid,
1449            wifi_pwd=self.wifi_network_pass)
1450
1451    @test_tracker_info(uuid="875ce520-7a09-4032-8e88-965ce143c1f5")
1452    @TelephonyBaseTest.tel_test_wrap
1453    def test_sms_long_message_mo_iwlan(self):
1454        """ Test MO SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1455
1456        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1457        Make sure PhoneA report iwlan as data rat.
1458        Make sure PhoneB is able to make/receive call/sms.
1459        Send SMS on PhoneA.
1460
1461        Returns:
1462            True if pass; False if fail.
1463        """
1464        _wfc_mode = self._get_wfc_mode(
1465            self.android_devices[0],
1466            get_outgoing_message_sub_id(self.android_devices[0]))
1467        return message_test(
1468            self.log,
1469            self.android_devices[0],
1470            self.android_devices[1],
1471            mo_rat='wfc',
1472            mt_rat='general',
1473            long_msg=True,
1474            is_airplane_mode=True,
1475            wfc_mode=_wfc_mode,
1476            wifi_ssid=self.wifi_network_ssid,
1477            wifi_pwd=self.wifi_network_pass)
1478
1479    @test_tracker_info(uuid="a317a1b3-16c8-4c2d-bbfd-aebcc0897499")
1480    @TelephonyBaseTest.tel_test_wrap
1481    def test_sms_long_message_mt_iwlan(self):
1482        """ Test MT SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1483
1484        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1485        Make sure PhoneA report iwlan as data rat.
1486        Make sure PhoneB is able to make/receive call/sms.
1487        Receive SMS on PhoneA.
1488
1489        Returns:
1490            True if pass; False if fail.
1491        """
1492        _wfc_mode = self._get_wfc_mode(
1493            self.android_devices[0],
1494            get_incoming_message_sub_id(self.android_devices[0]))
1495        return message_test(
1496            self.log,
1497            self.android_devices[1],
1498            self.android_devices[0],
1499            mo_rat='general',
1500            mt_rat='wfc',
1501            long_msg=True,
1502            is_airplane_mode=True,
1503            wfc_mode=_wfc_mode,
1504            wifi_ssid=self.wifi_network_ssid,
1505            wifi_pwd=self.wifi_network_pass)
1506
1507    @test_tracker_info(uuid="d692c439-6e96-45a6-be0f-1ff81226416c")
1508    @TelephonyBaseTest.tel_test_wrap
1509    def test_mms_long_message_mo_iwlan(self):
1510        """ Test MO MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1511
1512        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1513        Make sure PhoneA report iwlan as data rat.
1514        Make sure PhoneB is able to make/receive call/sms.
1515        Send MMS on PhoneA.
1516
1517        Returns:
1518            True if pass; False if fail.
1519        """
1520        _wfc_mode = self._get_wfc_mode(
1521            self.android_devices[0],
1522            get_outgoing_message_sub_id(self.android_devices[0]))
1523        return message_test(
1524            self.log,
1525            self.android_devices[0],
1526            self.android_devices[1],
1527            mo_rat='wfc',
1528            mt_rat='general',
1529            msg_type='mms',
1530            long_msg=True,
1531            is_airplane_mode=True,
1532            wfc_mode=_wfc_mode,
1533            wifi_ssid=self.wifi_network_ssid,
1534            wifi_pwd=self.wifi_network_pass)
1535
1536    @test_tracker_info(uuid="a0958a1b-23ea-4353-9af6-7bc5d6a0a3d2")
1537    @TelephonyBaseTest.tel_test_wrap
1538    def test_mms_long_message_mt_iwlan(self):
1539        """ Test MT MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1540
1541        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1542        Make sure PhoneA report iwlan as data rat.
1543        Make sure PhoneB is able to make/receive call/sms.
1544        Receive MMS on PhoneA.
1545
1546        Returns:
1547            True if pass; False if fail.
1548        """
1549        _wfc_mode = self._get_wfc_mode(
1550            self.android_devices[0],
1551            get_incoming_message_sub_id(self.android_devices[0]))
1552        return message_test(
1553            self.log,
1554            self.android_devices[1],
1555            self.android_devices[0],
1556            mo_rat='general',
1557            mt_rat='wfc',
1558            msg_type='mms',
1559            long_msg=True,
1560            is_airplane_mode=True,
1561            wfc_mode=_wfc_mode,
1562            wifi_ssid=self.wifi_network_ssid,
1563            wifi_pwd=self.wifi_network_pass)
1564
1565    @test_tracker_info(uuid="94bb8297-f646-4793-9d97-6f82a706127a")
1566    @TelephonyBaseTest.tel_test_wrap
1567    def test_sms_mo_iwlan_apm_off(self):
1568        """ Test MO SMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
1569
1570        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
1571        Make sure PhoneA report iwlan as data rat.
1572        Make sure PhoneB is able to make/receive call/sms.
1573        Send SMS on PhoneA.
1574
1575        Returns:
1576            True if pass; False if fail.
1577        """
1578        _wfc_mode = self._get_wfc_mode(
1579            self.android_devices[0],
1580            get_outgoing_message_sub_id(self.android_devices[0]))
1581        return message_test(
1582            self.log,
1583            self.android_devices[0],
1584            self.android_devices[1],
1585            mo_rat='wfc',
1586            mt_rat='general',
1587            wfc_mode=_wfc_mode,
1588            wifi_ssid=self.wifi_network_ssid,
1589            wifi_pwd=self.wifi_network_pass)
1590
1591    @test_tracker_info(uuid="e4acce6a-75ae-45c1-be85-d3a2eb2da7c2")
1592    @TelephonyBaseTest.tel_test_wrap
1593    def test_sms_mt_iwlan_apm_off(self):
1594        """ Test MT SMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
1595
1596        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
1597        Make sure PhoneA report iwlan as data rat.
1598        Make sure PhoneB is able to make/receive call/sms.
1599        Receive SMS on PhoneA.
1600
1601        Returns:
1602            True if pass; False if fail.
1603        """
1604        _wfc_mode = self._get_wfc_mode(
1605            self.android_devices[0],
1606            get_incoming_message_sub_id(self.android_devices[0]))
1607        return message_test(
1608            self.log,
1609            self.android_devices[1],
1610            self.android_devices[0],
1611            mo_rat='general',
1612            mt_rat='wfc',
1613            wfc_mode=_wfc_mode,
1614            wifi_ssid=self.wifi_network_ssid,
1615            wifi_pwd=self.wifi_network_pass)
1616
1617    @test_tracker_info(uuid="6c003c28-5712-4456-89cb-64d417ab2ce4")
1618    @TelephonyBaseTest.tel_test_wrap
1619    def test_mms_mo_iwlan_apm_off(self):
1620        """ Test MO MMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
1621
1622        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
1623        Make sure PhoneA report iwlan as data rat.
1624        Make sure PhoneB is able to make/receive call/sms.
1625        Send MMS on PhoneA.
1626
1627        Returns:
1628            True if pass; False if fail.
1629        """
1630        _wfc_mode = self._get_wfc_mode(
1631            self.android_devices[0],
1632            get_outgoing_message_sub_id(self.android_devices[0]))
1633        return message_test(
1634            self.log,
1635            self.android_devices[0],
1636            self.android_devices[1],
1637            mo_rat='wfc',
1638            mt_rat='general',
1639            msg_type='mms',
1640            wfc_mode=_wfc_mode,
1641            wifi_ssid=self.wifi_network_ssid,
1642            wifi_pwd=self.wifi_network_pass)
1643
1644    @test_tracker_info(uuid="0ac5c8ff-83e5-49f2-ba71-ebb283feed9e")
1645    @TelephonyBaseTest.tel_test_wrap
1646    def test_mms_mt_iwlan_apm_off(self):
1647        """ Test MT MMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
1648
1649        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
1650        Make sure PhoneA report iwlan as data rat.
1651        Make sure PhoneB is able to make/receive call/sms.
1652        Receive MMS on PhoneA.
1653
1654        Returns:
1655            True if pass; False if fail.
1656        """
1657        _wfc_mode = self._get_wfc_mode(
1658            self.android_devices[0],
1659            get_incoming_message_sub_id(self.android_devices[0]))
1660        return message_test(
1661            self.log,
1662            self.android_devices[1],
1663            self.android_devices[0],
1664            mo_rat='general',
1665            mt_rat='wfc',
1666            msg_type='mms',
1667            wfc_mode=_wfc_mode,
1668            wifi_ssid=self.wifi_network_ssid,
1669            wifi_pwd=self.wifi_network_pass)
1670
1671    @test_tracker_info(uuid="075933a2-df7f-4374-a405-92f96bcc7770")
1672    @TelephonyBaseTest.tel_test_wrap
1673    def test_sms_mo_apm_wifi_wfc_off(self):
1674        """ Test MO SMS, Phone in APM, WiFi connected, WFC off.
1675
1676        Make sure PhoneA APM, WiFi connected, WFC off.
1677        Make sure PhoneB is able to make/receive call/sms.
1678        Send SMS on PhoneA.
1679
1680        Returns:
1681            True if pass; False if fail.
1682        """
1683        return message_test(
1684            self.log,
1685            self.android_devices[0],
1686            self.android_devices[1],
1687            mo_rat='wfc',
1688            mt_rat='general',
1689            is_airplane_mode=True,
1690            wfc_mode=WFC_MODE_DISABLED,
1691            wifi_ssid=self.wifi_network_ssid,
1692            wifi_pwd=self.wifi_network_pass)
1693
1694    @test_tracker_info(uuid="637af228-29fc-4b74-a963-883f66ddf080")
1695    @TelephonyBaseTest.tel_test_wrap
1696    def test_sms_mt_apm_wifi_wfc_off(self):
1697        """ Test MT SMS, Phone in APM, WiFi connected, WFC off.
1698
1699        Make sure PhoneA APM, WiFi connected, WFC off.
1700        Make sure PhoneB is able to make/receive call/sms.
1701        Receive SMS on PhoneA.
1702
1703        Returns:
1704            True if pass; False if fail.
1705        """
1706        return message_test(
1707            self.log,
1708            self.android_devices[1],
1709            self.android_devices[0],
1710            mo_rat='general',
1711            mt_rat='wfc',
1712            is_airplane_mode=True,
1713            wfc_mode=WFC_MODE_DISABLED,
1714            wifi_ssid=self.wifi_network_ssid,
1715            wifi_pwd=self.wifi_network_pass)
1716
1717    @test_tracker_info(uuid="502aba0d-8895-4807-b394-50a44208ecf7")
1718    @TelephonyBaseTest.tel_test_wrap
1719    def test_mms_mo_apm_wifi_wfc_off(self):
1720        """ Test MO MMS, Phone in APM, WiFi connected, WFC off.
1721
1722        Make sure PhoneA APM, WiFi connected, WFC off.
1723        Make sure PhoneB is able to make/receive call/sms.
1724        Send MMS on PhoneA.
1725
1726        Returns:
1727            True if pass; False if fail.
1728        """
1729        return message_test(
1730            self.log,
1731            self.android_devices[0],
1732            self.android_devices[1],
1733            mo_rat='wfc',
1734            mt_rat='general',
1735            msg_type='mms',
1736            is_airplane_mode=True,
1737            wfc_mode=WFC_MODE_DISABLED,
1738            wifi_ssid=self.wifi_network_ssid,
1739            wifi_pwd=self.wifi_network_pass)
1740
1741    @test_tracker_info(uuid="235bfdbf-4275-4d89-99f5-41b5b7de8345")
1742    @TelephonyBaseTest.tel_test_wrap
1743    def test_mms_mt_apm_wifi_wfc_off(self):
1744        """ Test MT MMS, Phone in APM, WiFi connected, WFC off.
1745
1746        Make sure PhoneA APM, WiFi connected, WFC off.
1747        Make sure PhoneB is able to make/receive call/sms.
1748        Receive MMS on PhoneA.
1749
1750        Returns:
1751            True if pass; False if fail.
1752        """
1753        return message_test(
1754            self.log,
1755            self.android_devices[1],
1756            self.android_devices[0],
1757            mo_rat='general',
1758            mt_rat='wfc',
1759            msg_type='mms',
1760            is_airplane_mode=True,
1761            wfc_mode=WFC_MODE_DISABLED,
1762            wifi_ssid=self.wifi_network_ssid,
1763            wifi_pwd=self.wifi_network_pass)
1764
1765    @test_tracker_info(uuid="e5a31b94-1cb6-4770-a2bc-5a0ddba51502")
1766    @TelephonyBaseTest.tel_test_wrap
1767    def test_sms_mo_in_call_iwlan(self):
1768        """ Test MO SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1769
1770        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1771        Make sure PhoneA report iwlan as data rat.
1772        Make sure PhoneB is able to make/receive call/sms.
1773        Call from PhoneA to PhoneB, accept on PhoneB.
1774        Send SMS on PhoneA.
1775
1776        Returns:
1777            True if pass; False if fail.
1778        """
1779        _wfc_mode = self._get_wfc_mode(
1780            self.android_devices[0],
1781            get_outgoing_message_sub_id(self.android_devices[0]))
1782        return message_test(
1783            self.log,
1784            self.android_devices[0],
1785            self.android_devices[1],
1786            mo_rat='wfc',
1787            mt_rat='general',
1788            msg_in_call=True,
1789            is_airplane_mode=True,
1790            wfc_mode=_wfc_mode,
1791            wifi_ssid=self.wifi_network_ssid,
1792            wifi_pwd=self.wifi_network_pass)
1793
1794    @test_tracker_info(uuid="d6d30cc5-f75b-42df-b517-401456ee8466")
1795    @TelephonyBaseTest.tel_test_wrap
1796    def test_sms_mt_in_call_iwlan(self):
1797        """ Test MT SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1798
1799        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1800        Make sure PhoneA report iwlan as data rat.
1801        Make sure PhoneB is able to make/receive call/sms.
1802        Call from PhoneA to PhoneB, accept on PhoneB.
1803        Receive SMS on PhoneA.
1804
1805        Returns:
1806            True if pass; False if fail.
1807        """
1808        _wfc_mode = self._get_wfc_mode(
1809            self.android_devices[0],
1810            get_incoming_message_sub_id(self.android_devices[0]))
1811        return message_test(
1812            self.log,
1813            self.android_devices[1],
1814            self.android_devices[0],
1815            mo_rat='general',
1816            mt_rat='wfc',
1817            msg_in_call=True,
1818            is_airplane_mode=True,
1819            wfc_mode=_wfc_mode,
1820            wifi_ssid=self.wifi_network_ssid,
1821            wifi_pwd=self.wifi_network_pass)
1822
1823    @test_tracker_info(uuid="a98a5a97-3864-4ff8-9085-995212eada20")
1824    @TelephonyBaseTest.tel_test_wrap
1825    def test_mms_mo_in_call_iwlan(self):
1826        """ Test MO MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1827
1828        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1829        Make sure PhoneA report iwlan as data rat.
1830        Make sure PhoneB is able to make/receive call/sms.
1831        Call from PhoneA to PhoneB, accept on PhoneB.
1832        Send MMS on PhoneA.
1833
1834        Returns:
1835            True if pass; False if fail.
1836        """
1837        _wfc_mode = self._get_wfc_mode(
1838            self.android_devices[0],
1839            get_outgoing_message_sub_id(self.android_devices[0]))
1840        return message_test(
1841            self.log,
1842            self.android_devices[0],
1843            self.android_devices[1],
1844            mo_rat='wfc',
1845            mt_rat='general',
1846            msg_type='mms',
1847            msg_in_call=True,
1848            is_airplane_mode=True,
1849            wfc_mode=_wfc_mode,
1850            wifi_ssid=self.wifi_network_ssid,
1851            wifi_pwd=self.wifi_network_pass)
1852
1853    @test_tracker_info(uuid="0464a87b-d45b-4b03-9895-17ece360a796")
1854    @TelephonyBaseTest.tel_test_wrap
1855    def test_mms_mt_in_call_iwlan(self):
1856        """ Test MT MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
1857
1858        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1859        Make sure PhoneA report iwlan as data rat.
1860        Make sure PhoneB is able to make/receive call/sms.
1861        Call from PhoneA to PhoneB, accept on PhoneB.
1862        Receive MMS on PhoneA.
1863
1864        Returns:
1865            True if pass; False if fail.
1866        """
1867        _wfc_mode = self._get_wfc_mode(
1868            self.android_devices[0],
1869            get_incoming_message_sub_id(self.android_devices[0]))
1870        return message_test(
1871            self.log,
1872            self.android_devices[1],
1873            self.android_devices[0],
1874            mo_rat='general',
1875            mt_rat='wfc',
1876            msg_type='mms',
1877            msg_in_call=True,
1878            is_airplane_mode=True,
1879            wfc_mode=_wfc_mode,
1880            wifi_ssid=self.wifi_network_ssid,
1881            wifi_pwd=self.wifi_network_pass)
1882
1883    @test_tracker_info(uuid="029e05cd-df6b-4a82-8402-77fc6eadf66f")
1884    @TelephonyBaseTest.tel_test_wrap
1885    def test_sms_mo_in_call_iwlan_cellular(self):
1886        """ Test MO SMS, Phone in APM, WiFi connected, Cellular Preferred mode.
1887
1888        Make sure PhoneA APM, WiFi connected, Cellular preferred mode.
1889        Make sure PhoneA report iwlan as data rat.
1890        Make sure PhoneB is able to make/receive call/sms.
1891        Call from PhoneA to PhoneB, accept on PhoneB.
1892        Send SMS on PhoneA.
1893
1894        Returns:
1895            True if pass; False if fail.
1896        """
1897        return message_test(
1898            self.log,
1899            self.android_devices[0],
1900            self.android_devices[1],
1901            mo_rat='wfc',
1902            mt_rat='general',
1903            msg_in_call=True,
1904            is_airplane_mode=True,
1905            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1906            wifi_ssid=self.wifi_network_ssid,
1907            wifi_pwd=self.wifi_network_pass)
1908
1909    @test_tracker_info(uuid="c3c47a68-a839-4470-87f6-e85496cfab23")
1910    @TelephonyBaseTest.tel_test_wrap
1911    def test_sms_mt_in_call_iwlan_cellular(self):
1912        """ Test MT SMS, Phone in APM, WiFi connected, Cellular Preferred mode.
1913
1914        Make sure PhoneA APM, WiFi connected, Cellular Preferred mode.
1915        Make sure PhoneA report iwlan as data rat.
1916        Make sure PhoneB is able to make/receive call/sms.
1917        Call from PhoneA to PhoneB, accept on PhoneB.
1918        Receive SMS on PhoneA.
1919
1920        Returns:
1921            True if pass; False if fail.
1922        """
1923        return message_test(
1924            self.log,
1925            self.android_devices[1],
1926            self.android_devices[0],
1927            mo_rat='general',
1928            mt_rat='wfc',
1929            msg_in_call=True,
1930            is_airplane_mode=True,
1931            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1932            wifi_ssid=self.wifi_network_ssid,
1933            wifi_pwd=self.wifi_network_pass)
1934
1935    @test_tracker_info(uuid="4c6cd913-4aca-4f2b-b33b-1efe0a7dc11d")
1936    @TelephonyBaseTest.tel_test_wrap
1937    def test_mms_mo_in_call_iwlan_cellular(self):
1938        """ Test MO MMS, Phone in APM, WiFi connected, Cellular Preferred mode.
1939
1940        Make sure PhoneA APM, WiFi connected, Cellular mode.
1941        Make sure PhoneA report iwlan as data rat.
1942        Make sure PhoneB is able to make/receive call/sms.
1943        Call from PhoneA to PhoneB, accept on PhoneB.
1944        Send MMS on PhoneA.
1945
1946        Returns:
1947            True if pass; False if fail.
1948        """
1949        return message_test(
1950            self.log,
1951            self.android_devices[0],
1952            self.android_devices[1],
1953            mo_rat='wfc',
1954            mt_rat='general',
1955            msg_type='mms',
1956            msg_in_call=True,
1957            is_airplane_mode=True,
1958            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1959            wifi_ssid=self.wifi_network_ssid,
1960            wifi_pwd=self.wifi_network_pass)
1961
1962    @test_tracker_info(uuid="5b667ca1-cafd-47d4-86dc-8b87232ddcfa")
1963    @TelephonyBaseTest.tel_test_wrap
1964    def test_mms_mt_in_call_iwlan_cellular(self):
1965        """ Test MT MMS, Phone in APM, WiFi connected, Cellular Preferred mode.
1966
1967        Make sure PhoneA APM, WiFi connected, Cellular preferred mode.
1968        Make sure PhoneA report iwlan as data rat.
1969        Make sure PhoneB is able to make/receive call/sms.
1970        Call from PhoneA to PhoneB, accept on PhoneB.
1971        Receive MMS on PhoneA.
1972
1973        Returns:
1974            True if pass; False if fail.
1975        """
1976        return message_test(
1977            self.log,
1978            self.android_devices[1],
1979            self.android_devices[0],
1980            mo_rat='general',
1981            mt_rat='wfc',
1982            msg_type='mms',
1983            msg_in_call=True,
1984            is_airplane_mode=True,
1985            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
1986            wifi_ssid=self.wifi_network_ssid,
1987            wifi_pwd=self.wifi_network_pass)
1988
1989    @test_tracker_info(uuid="9f1933bb-c4cb-4655-8655-327c1f38e8ee")
1990    @TelephonyBaseTest.tel_test_wrap
1991    def test_sms_mo_in_call_vt(self):
1992        """ Test MO SMS, Phone in ongoing VT call.
1993
1994        Make sure PhoneA and PhoneB in LTE and can make VT call.
1995        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
1996        Send SMS on PhoneA.
1997
1998        Returns:
1999            True if pass; False if fail.
2000        """
2001        return message_test(
2002            self.log,
2003            self.android_devices[0],
2004            self.android_devices[1],
2005            mo_rat='volte',
2006            mt_rat='volte',
2007            msg_in_call=True,
2008            video_or_voice='video')
2009
2010    @test_tracker_info(uuid="0a07e737-4862-4492-9b48-8d94799eab91")
2011    @TelephonyBaseTest.tel_test_wrap
2012    def test_sms_mt_in_call_vt(self):
2013        """ Test MT SMS, Phone in ongoing VT call.
2014
2015        Make sure PhoneA and PhoneB in LTE and can make VT call.
2016        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2017        Receive SMS on PhoneA.
2018
2019        Returns:
2020            True if pass; False if fail.
2021        """
2022        return message_test(
2023            self.log,
2024            self.android_devices[1],
2025            self.android_devices[0],
2026            mo_rat='volte',
2027            mt_rat='volte',
2028            msg_in_call=True,
2029            video_or_voice='video')
2030
2031    @test_tracker_info(uuid="55d70548-6aee-40e9-b94d-d10de84fb50f")
2032    @TelephonyBaseTest.tel_test_wrap
2033    def test_mms_mo_in_call_vt(self):
2034        """ Test MO MMS, Phone in ongoing VT call.
2035
2036        Make sure PhoneA and PhoneB in LTE and can make VT call.
2037        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2038        Send MMS on PhoneA.
2039
2040        Returns:
2041            True if pass; False if fail.
2042        """
2043        return message_test(
2044            self.log,
2045            self.android_devices[0],
2046            self.android_devices[1],
2047            mo_rat='volte',
2048            mt_rat='volte',
2049            msg_type='mms',
2050            msg_in_call=True,
2051            video_or_voice='video')
2052
2053    @test_tracker_info(uuid="75f97c9a-4397-42f1-bb00-8fc6d04fdf6d")
2054    @TelephonyBaseTest.tel_test_wrap
2055    def test_mms_mt_in_call_vt(self):
2056        """ Test MT MMS, Phone in ongoing VT call.
2057
2058        Make sure PhoneA and PhoneB in LTE and can make VT call.
2059        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2060        Receive MMS on PhoneA.
2061
2062        Returns:
2063            True if pass; False if fail.
2064        """
2065        return message_test(
2066            self.log,
2067            self.android_devices[1],
2068            self.android_devices[0],
2069            mo_rat='volte',
2070            mt_rat='volte',
2071            msg_type='mms',
2072            msg_in_call=True,
2073            video_or_voice='video')
2074
2075    @test_tracker_info(uuid="2a72ecc6-702d-4add-a7a2-8c1001628bb6")
2076    @TelephonyBaseTest.tel_test_wrap
2077    def test_sms_mo_in_call_2g(self):
2078        """ Test MO SMS during a MO gsm call.
2079
2080        Make sure PhoneA is in gsm mode.
2081        Make sure PhoneB is able to make/receive call.
2082        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
2083
2084        Returns:
2085            True if pass; False if fail.
2086        """
2087        self.check_band_support(self.android_devices[0])
2088        return message_test(
2089            self.log,
2090            self.android_devices[0],
2091            self.android_devices[1],
2092            mo_rat='2g',
2093            mt_rat='general',
2094            msg_in_call=True)
2095
2096    @test_tracker_info(uuid="facd1814-8d69-42a2-9f80-b6a28cc0c9d2")
2097    @TelephonyBaseTest.tel_test_wrap
2098    def test_sms_mt_in_call_2g(self):
2099        """ Test MT SMS during a MO gsm call.
2100
2101        Make sure PhoneA is in gsm mode.
2102        Make sure PhoneB is able to make/receive call.
2103        Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA.
2104
2105        Returns:
2106            True if pass; False if fail.
2107        """
2108        self.check_band_support(self.android_devices[0])
2109        return message_test(
2110            self.log,
2111            self.android_devices[1],
2112            self.android_devices[0],
2113            mo_rat='general',
2114            mt_rat='2g',
2115            msg_in_call=True)
2116
2117    @test_tracker_info(uuid="2bd94d69-3621-4b94-abc7-bd24c4325485")
2118    @TelephonyBaseTest.tel_test_wrap
2119    def test_mms_mo_in_call_2g(self):
2120        """ Test MO MMS during a MO gsm call.
2121
2122        Make sure PhoneA is in gsm mode.
2123        Make sure PhoneB is able to make/receive call.
2124        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
2125
2126        Returns:
2127            True if pass; False if fail.
2128        """
2129        self.check_band_support(self.android_devices[0])
2130        return message_test(
2131            self.log,
2132            self.android_devices[0],
2133            self.android_devices[1],
2134            mo_rat='2g',
2135            mt_rat='general',
2136            msg_type='mms',
2137            msg_in_call=True)
2138
2139    @test_tracker_info(uuid="e20be70d-99d6-4344-a742-f69581b66d8f")
2140    @TelephonyBaseTest.tel_test_wrap
2141    def test_mms_mt_in_call_2g(self):
2142        """ Test MT MMS during a MO gsm call.
2143
2144        Make sure PhoneA is in gsm mode.
2145        Make sure PhoneB is able to make/receive call.
2146        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
2147
2148        Returns:
2149            True if pass; False if fail.
2150        """
2151        self.check_band_support(self.android_devices[0])
2152        return message_test(
2153            self.log,
2154            self.android_devices[1],
2155            self.android_devices[0],
2156            mo_rat='general',
2157            mt_rat='2g',
2158            msg_type='mms',
2159            msg_in_call=True)
2160
2161    @test_tracker_info(uuid="3510d368-4b16-4716-92a3-9dd01842ba79")
2162    @TelephonyBaseTest.tel_test_wrap
2163    def test_mms_mo_in_call_2g_wifi(self):
2164        """ Test MO MMS during a MO gsm call.
2165
2166        Make sure PhoneA is in gsm mode with Wifi connected.
2167        Make sure PhoneB is able to make/receive call.
2168        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
2169
2170        Returns:
2171            True if pass; False if fail.
2172        """
2173        self.check_band_support(self.android_devices[0])
2174        return message_test(
2175            self.log,
2176            self.android_devices[0],
2177            self.android_devices[1],
2178            mo_rat='2g',
2179            mt_rat='general',
2180            msg_type='mms',
2181            msg_in_call=True,
2182            wifi_ssid=self.wifi_network_ssid,
2183            wifi_pwd=self.wifi_network_pass)
2184
2185    @test_tracker_info(uuid="060def89-01bd-4b44-a49b-a4536fe39165")
2186    @TelephonyBaseTest.tel_test_wrap
2187    def test_mms_mt_in_call_2g_wifi(self):
2188        """ Test MT MMS during a MO gsm call.
2189
2190        Make sure PhoneA is in gsm mode with wifi connected.
2191        Make sure PhoneB is able to make/receive call.
2192        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
2193
2194        Returns:
2195            True if pass; False if fail.
2196        """
2197        self.check_band_support(self.android_devices[0])
2198        return message_test(
2199            self.log,
2200            self.android_devices[1],
2201            self.android_devices[0],
2202            mo_rat='general',
2203            mt_rat='2g',
2204            msg_type='mms',
2205            msg_in_call=True,
2206            wifi_ssid=self.wifi_network_ssid,
2207            wifi_pwd=self.wifi_network_pass)
2208
2209    @test_tracker_info(uuid="7de95a56-8055-4c0c-9438-f249403c6078")
2210    @TelephonyBaseTest.tel_test_wrap
2211    def test_sms_mo_general_after_mobile_data_usage_limit_reached(self):
2212        """Test SMS send after mobile data usage limit is reached.
2213
2214        Airplane mode is off.
2215        Set the data limit to the current usage
2216        Send SMS from PhoneA to PhoneB.
2217        Verify received message on PhoneB is correct.
2218
2219        Returns:
2220            True if success.
2221            False if failed.
2222        """
2223        ads = self.android_devices
2224        try:
2225            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2226            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2227            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2228
2229            return message_test(
2230                self.log,
2231                ads[0],
2232                ads[1])
2233        finally:
2234            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2235
2236    @test_tracker_info(uuid="df56687f-0932-4b13-952c-ae0ce30b1d7a")
2237    @TelephonyBaseTest.tel_test_wrap
2238    def test_sms_mt_general_after_mobile_data_usage_limit_reached(self):
2239        """Test SMS receive after mobile data usage limit is reached.
2240
2241        Airplane mode is off.
2242        Set the data limit to the current usage
2243        Send SMS from PhoneB to PhoneA.
2244        Verify received message on PhoneA is correct.
2245
2246        Returns:
2247            True if success.
2248            False if failed.
2249        """
2250        ads = self.android_devices
2251        try:
2252            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2253            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2254            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2255
2256            return message_test(
2257                self.log,
2258                ads[1],
2259                ads[0])
2260        finally:
2261            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2262
2263    @test_tracker_info(uuid="131f98c6-3b56-44df-b5e7-66f33e2cf117")
2264    @TelephonyBaseTest.tel_test_wrap
2265    def test_mms_mo_general_after_mobile_data_usage_limit_reached(self):
2266        """Test MMS send after mobile data usage limit is reached.
2267
2268        Airplane mode is off.
2269        Set the data limit to the current usage
2270        Send MMS from PhoneA to PhoneB.
2271        Verify MMS cannot be send. (Can be send/receive for Verizon)
2272
2273        Returns:
2274            True if success.
2275            False if failed.
2276        """
2277        ads = self.android_devices
2278        expected_result = False
2279        if get_operator_name(self.log, ads[0]) in ["vzw", "Verizon", "att", "AT&T"]:
2280            expected_result = True
2281        ads[0].log.info("Expected Result is %s", expected_result)
2282
2283        try:
2284            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2285            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2286            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2287            log_msg = "expecting successful mms receive" if (
2288                expected_result) else "expecting mms receive failure"
2289
2290            if not message_test(
2291                self.log,
2292                ads[0],
2293                ads[1],
2294                msg_type='mms',
2295                mms_expected_result=expected_result):
2296
2297                ads[0].log.error("Mms test failed, %s", log_msg)
2298                return False
2299            else:
2300                ads[0].log.info("Mms test succeeded, %s", log_msg)
2301                return True
2302        finally:
2303            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2304
2305    @test_tracker_info(uuid="051e259f-0cb9-417d-9a68-8e8a4266fca1")
2306    @TelephonyBaseTest.tel_test_wrap
2307    def test_mms_mt_general_after_mobile_data_usage_limit_reached(self):
2308        """Test MMS receive after mobile data usage limit is reached.
2309
2310        Airplane mode is off.
2311        Set the data limit to the current usage
2312        Send MMS from PhoneB to PhoneA.
2313        Verify MMS cannot be received. (Can be send/receive for Verizon)
2314
2315        Returns:
2316            True if success.
2317            False if failed.
2318        """
2319        ads = self.android_devices
2320        expected_result = False
2321        if get_operator_name(self.log, ads[0]) in ["vzw", "Verizon", "att", "AT&T"]:
2322            expected_result = True
2323        ads[0].log.info("Expected Result is %s", expected_result)
2324
2325        try:
2326            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2327            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2328            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2329            log_msg = "expecting successful mms receive" if (
2330                expected_result) else "expecting mms receive failure"
2331
2332            if not message_test(
2333                self.log,
2334                ads[1],
2335                ads[0],
2336                msg_type='mms',
2337                mms_expected_result=expected_result):
2338
2339                ads[0].log.error("Mms test failed, %s", log_msg)
2340                return False
2341            else:
2342                ads[0].log.info("Mms test succeeded, %s", log_msg)
2343                return True
2344        finally:
2345            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2346
2347    @test_tracker_info(uuid="65808f80-9859-44e9-888d-9e5ca8665667")
2348    @TelephonyBaseTest.tel_test_wrap
2349    def test_sms_mt_in_collision_general(self):
2350        """Test of reception of 2 simultaneous incoming MT SMS'.
2351        Test step:
2352            1. Send a SMS from both of the secondary and the third DUT to the
2353               primary DUT simultaneously.
2354            2. Wait for reception of both SMS' on the primary DUT and verify the
2355               content and sender of both SMS'.
2356
2357        Returns:
2358            True if success. Otherwise False.
2359        """
2360        ads = self.android_devices
2361
2362        tasks = [(ensure_phone_default_state, (self.log, ads[0])),
2363                 (ensure_phone_default_state, (self.log, ads[1]))]
2364        if not multithread_func(self.log, tasks):
2365            self.log.error("Phone Failed to Set Up Properly.")
2366            return False
2367        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2368
2369        return self._sms_in_collision_test(ads)
2370
2371    @test_tracker_info(uuid="2a78efcc-bec4-4e2d-8e8c-5e75be93a78e")
2372    @TelephonyBaseTest.tel_test_wrap
2373    def test_sms_mt_in_collision_when_power_off_general(self):
2374        """Test of reception of 2 simultaneous incoming MT SMS' sent as DUT was
2375           powered off.
2376        Test step:
2377            1. Toggle on airplane mode and reboot the primary DUT.
2378            2. During the reboot procedure send a SMS from both of the secondary
2379               and the third DUT to the primary DUT simultaneously.
2380            3. Wait for reboot complete on the primary DUT and then toggle off
2381               airplane mode.
2382            4. Wait for reception of both SMS' on the primary DUT and verify the
2383               content and sender of both SMS'.
2384
2385        Returns:
2386            True if success. Otherwise False.
2387        """
2388        ads = self.android_devices
2389
2390        tasks = [(ensure_phone_default_state, (self.log, ads[0])),
2391                 (ensure_phone_default_state, (self.log, ads[1]))]
2392        if not multithread_func(self.log, tasks):
2393            self.log.error("Phone Failed to Set Up Properly.")
2394            return False
2395        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2396
2397        return self._sms_in_collision_when_power_off_test(ads)
2398