• 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.
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.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
24from acts.test_utils.tel.tel_defines import GEN_3G
25from acts.test_utils.tel.tel_defines import GEN_4G
26from acts.test_utils.tel.tel_defines import PHONE_TYPE_GSM
27from acts.test_utils.tel.tel_defines import RAT_3G
28from acts.test_utils.tel.tel_defines import VT_STATE_BIDIRECTIONAL
29from acts.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING
30from acts.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
31from acts.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
32from acts.test_utils.tel.tel_test_utils import call_setup_teardown
33from acts.test_utils.tel.tel_test_utils import ensure_network_generation
34from acts.test_utils.tel.tel_test_utils import ensure_phone_default_state
35from acts.test_utils.tel.tel_test_utils import ensure_phones_idle
36from acts.test_utils.tel.tel_test_utils import ensure_wifi_connected
37from acts.test_utils.tel.tel_test_utils import get_mobile_data_usage
38from acts.test_utils.tel.tel_test_utils import get_operator_name
39from acts.test_utils.tel.tel_test_utils import remove_mobile_data_usage_limit
40from acts.test_utils.tel.tel_test_utils import mms_send_receive_verify
41from acts.test_utils.tel.tel_test_utils import mms_receive_verify_after_call_hangup
42from acts.test_utils.tel.tel_test_utils import multithread_func
43from acts.test_utils.tel.tel_test_utils import set_call_state_listen_level
44from acts.test_utils.tel.tel_test_utils import set_mobile_data_usage_limit
45from acts.test_utils.tel.tel_test_utils import setup_sim
46from acts.test_utils.tel.tel_test_utils import sms_send_receive_verify
47from acts.test_utils.tel.tel_video_utils import phone_setup_video
48from acts.test_utils.tel.tel_video_utils import is_phone_in_call_video_bidirectional
49from acts.test_utils.tel.tel_video_utils import video_call_setup_teardown
50from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_1x
51from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_2g
52from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_3g
53from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb
54from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_iwlan
55from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_volte
56from acts.test_utils.tel.tel_voice_utils import phone_setup_3g
57from acts.test_utils.tel.tel_voice_utils import phone_setup_csfb
58from acts.test_utils.tel.tel_voice_utils import phone_setup_data_general
59from acts.test_utils.tel.tel_voice_utils import phone_setup_iwlan
60from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_2g
61from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_3g
62from acts.test_utils.tel.tel_voice_utils import phone_setup_volte
63from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_general
64from acts.utils import rand_ascii_str
65
66SMS_OVER_WIFI_PROVIDERS = ("vzw", "tmo", "fi", "rogers", "rjio", "eeuk",
67                           "dtag")
68
69
70class TelLiveSmsTest(TelephonyBaseTest):
71    def __init__(self, controllers):
72        TelephonyBaseTest.__init__(self, controllers)
73
74        # Try to put SMS and call on different help device
75        # If it is a three phone test bed, use the first one as dut,
76        # use the second one as sms/mms help device, use the third one
77        # as the active call help device.
78        self.caller = self.android_devices[0]
79        self.callee = self.android_devices[1]
80        self.number_of_devices = 2
81        self.message_lengths = (50, 160, 180)
82        self.long_message_lengths = (800, 1600)
83
84    def setup_class(self):
85        TelephonyBaseTest.setup_class(self)
86        is_roaming = False
87        for ad in self.android_devices:
88            ad.sms_over_wifi = False
89            #verizon supports sms over wifi. will add more carriers later
90            for sub in ad.telephony["subscription"].values():
91                if sub["operator"] in SMS_OVER_WIFI_PROVIDERS:
92                    ad.sms_over_wifi = True
93            if getattr(ad, 'roaming', False):
94                is_roaming = True
95        if is_roaming:
96            # roaming device does not allow message of length 180
97            self.message_lengths = (50, 160)
98
99    def teardown_test(self):
100        ensure_phones_idle(self.log, self.android_devices)
101
102    def _sms_test(self, ads):
103        """Test SMS between two phones.
104
105        Returns:
106            True if success.
107            False if failed.
108        """
109        for length in self.message_lengths:
110            message_array = [rand_ascii_str(length)]
111            if not sms_send_receive_verify(self.log, ads[0], ads[1],
112                                           message_array):
113                ads[0].log.warning("SMS of length %s test failed", length)
114                return False
115            else:
116                ads[0].log.info("SMS of length %s test succeeded", length)
117        self.log.info("SMS test of length %s characters succeeded.",
118                      self.message_lengths)
119        return True
120
121    def _long_sms_test(self, ads):
122        """Test SMS between two phones.
123
124        Returns:
125            True if success.
126            False if failed.
127        """
128        for length in self.long_message_lengths:
129            message_array = [rand_ascii_str(length)]
130            if not sms_send_receive_verify(self.log, ads[0], ads[1],
131                                           message_array):
132                ads[0].log.warning("SMS of length %s test failed", length)
133                return False
134            else:
135                ads[0].log.info("SMS of length %s test succeeded", length)
136                time.sleep(30)
137        self.log.info("SMS test of length %s characters succeeded.",
138                      self.message_lengths)
139        return True
140
141    def _mms_test(self, ads, expected_result=True):
142        """Test MMS between two phones.
143
144        Returns:
145            True if success.
146            False if failed.
147        """
148        for length in self.message_lengths:
149            message_array = [("Test Message", rand_ascii_str(length), None)]
150            if not mms_send_receive_verify(
151                    self.log,
152                    ads[0],
153                    ads[1],
154                    message_array,
155                    expected_result=expected_result):
156                self.log.warning("MMS of body length %s test failed", length)
157                return False
158            else:
159                self.log.info("MMS of body length %s test succeeded", length)
160        self.log.info("MMS test of body lengths %s succeeded",
161                      self.message_lengths)
162        return True
163
164    def _long_mms_test(self, ads):
165        """Test MMS between two phones.
166
167        Returns:
168            True if success.
169            False if failed.
170        """
171        for length in self.long_message_lengths:
172            message_array = [("Test Message", rand_ascii_str(length), None)]
173            if not mms_send_receive_verify(self.log, ads[0], ads[1],
174                                           message_array):
175                self.log.warning("MMS of body length %s test failed", length)
176                return False
177            else:
178                self.log.info("MMS of body length %s test succeeded", length)
179                time.sleep(30)
180        self.log.info("MMS test of body lengths %s succeeded",
181                      self.message_lengths)
182        return True
183
184    def _mms_test_after_call_hangup(self, ads):
185        """Test MMS send out after call hang up.
186
187        Returns:
188            True if success.
189            False if failed.
190        """
191        args = [
192            self.log, ads[0], ads[1], [("Test Message", "Basic Message Body",
193                                        None)]
194        ]
195        if get_operator_name(self.log, ads[0]) in ["spt", "Sprint"]:
196            args.append(30)
197        if not mms_send_receive_verify(*args):
198            self.log.info("MMS send in call is suspended.")
199            if not mms_receive_verify_after_call_hangup(*args):
200                self.log.error(
201                    "MMS is not send and received after call release.")
202                return False
203            else:
204                self.log.info("MMS is send and received after call release.")
205                return True
206        else:
207            self.log.info("MMS is send and received successfully in call.")
208            return True
209
210    def _sms_test_mo(self, ads):
211        return self._sms_test([ads[0], ads[1]])
212
213    def _sms_test_mt(self, ads):
214        return self._sms_test([ads[1], ads[0]])
215
216    def _mms_test_mo(self, ads, expected_result=True):
217        return self._mms_test(
218            [ads[0], ads[1]], expected_result=expected_result)
219
220    def _mms_test_mt(self, ads, expected_result=True):
221        return self._mms_test(
222            [ads[1], ads[0]], expected_result=expected_result)
223
224    def _long_sms_test_mo(self, ads):
225        return self._long_sms_test([ads[0], ads[1]])
226
227    def _long_sms_test_mt(self, ads):
228        return self._long_sms_test([ads[1], ads[0]])
229
230    def _long_mms_test_mo(self, ads):
231        return self._long_mms_test([ads[0], ads[1]])
232
233    def _long_mms_test_mt(self, ads):
234        return self._long_mms_test([ads[1], ads[0]])
235
236    def _mms_test_mo_after_call_hangup(self, ads):
237        return self._mms_test_after_call_hangup([ads[0], ads[1]])
238
239    def _mms_test_mt_after_call_hangup(self, ads):
240        return self._mms_test_after_call_hangup([ads[1], ads[0]])
241
242    def _mo_sms_in_3g_call(self, ads):
243        self.log.info("Begin In Call SMS Test.")
244        if not call_setup_teardown(
245                self.log,
246                self.caller,
247                self.callee,
248                ad_hangup=None,
249                verify_caller_func=is_phone_in_call_3g,
250                verify_callee_func=None):
251            return False
252
253        if not self._sms_test_mo(ads):
254            self.log.error("SMS test fail.")
255            return False
256
257        return True
258
259    def _mt_sms_in_3g_call(self, ads):
260        self.log.info("Begin In Call SMS Test.")
261        if not call_setup_teardown(
262                self.log,
263                self.caller,
264                self.callee,
265                ad_hangup=None,
266                verify_caller_func=is_phone_in_call_3g,
267                verify_callee_func=None):
268            return False
269
270        if not self._sms_test_mt(ads):
271            self.log.error("SMS test fail.")
272            return False
273
274        return True
275
276    def _mo_mms_in_3g_call(self, ads, wifi=False):
277        self.log.info("Begin In Call MMS Test.")
278        if not call_setup_teardown(
279                self.log,
280                self.caller,
281                self.callee,
282                ad_hangup=None,
283                verify_caller_func=is_phone_in_call_3g,
284                verify_callee_func=None):
285            return False
286
287        if ads[0].sms_over_wifi and wifi:
288            return self._mms_test_mo(ads)
289        else:
290            return self._mms_test_mo_after_call_hangup(ads)
291
292    def _mt_mms_in_3g_call(self, ads, wifi=False):
293        self.log.info("Begin In Call MMS Test.")
294        if not call_setup_teardown(
295                self.log,
296                self.caller,
297                self.callee,
298                ad_hangup=None,
299                verify_caller_func=is_phone_in_call_3g,
300                verify_callee_func=None):
301            return False
302
303        if ads[0].sms_over_wifi and wifi:
304            return self._mms_test_mt(ads)
305        else:
306            return self._mms_test_mt_after_call_hangup(ads)
307
308    def _mo_sms_in_2g_call(self, ads):
309        self.log.info("Begin In Call SMS Test.")
310        if not call_setup_teardown(
311                self.log,
312                self.caller,
313                self.callee,
314                ad_hangup=None,
315                verify_caller_func=is_phone_in_call_2g,
316                verify_callee_func=None):
317            return False
318
319        if not self._sms_test_mo(ads):
320            self.log.error("SMS test fail.")
321            return False
322
323        return True
324
325    def _mt_sms_in_2g_call(self, ads):
326        self.log.info("Begin In Call SMS Test.")
327        if not call_setup_teardown(
328                self.log,
329                self.caller,
330                self.callee,
331                ad_hangup=None,
332                verify_caller_func=is_phone_in_call_2g,
333                verify_callee_func=None):
334            return False
335
336        if not self._sms_test_mt(ads):
337            self.log.error("SMS test fail.")
338            return False
339
340        return True
341
342    def _mo_mms_in_2g_call(self, ads, wifi=False):
343        self.log.info("Begin In Call MMS Test.")
344        if not call_setup_teardown(
345                self.log,
346                self.caller,
347                self.callee,
348                ad_hangup=None,
349                verify_caller_func=is_phone_in_call_2g,
350                verify_callee_func=None):
351            return False
352
353        if ads[0].sms_over_wifi and wifi:
354            return self._mms_test_mo(ads)
355        else:
356            return self._mms_test_mo_after_call_hangup(ads)
357
358    def _mt_mms_in_2g_call(self, ads, wifi=False):
359        self.log.info("Begin In Call MMS Test.")
360        if not call_setup_teardown(
361                self.log,
362                self.caller,
363                self.callee,
364                ad_hangup=None,
365                verify_caller_func=is_phone_in_call_2g,
366                verify_callee_func=None):
367            return False
368
369        if ads[0].sms_over_wifi and wifi:
370            return self._mms_test_mt(ads)
371        else:
372            return self._mms_test_mt_after_call_hangup(ads)
373
374    def _mo_sms_in_csfb_call(self, ads):
375        self.log.info("Begin In Call SMS Test.")
376        if not call_setup_teardown(
377                self.log,
378                self.caller,
379                self.callee,
380                ad_hangup=None,
381                verify_caller_func=is_phone_in_call_csfb,
382                verify_callee_func=None):
383            return False
384
385        if not self._sms_test_mo(ads):
386            self.log.error("SMS test fail.")
387            return False
388
389        return True
390
391    def _mt_sms_in_csfb_call(self, ads):
392        self.log.info("Begin In Call SMS Test.")
393        if not call_setup_teardown(
394                self.log,
395                self.caller,
396                self.callee,
397                ad_hangup=None,
398                verify_caller_func=is_phone_in_call_csfb,
399                verify_callee_func=None):
400            return False
401
402        if not self._sms_test_mt(ads):
403            self.log.error("SMS test fail.")
404            return False
405
406        return True
407
408    def _mo_mms_in_csfb_call(self, ads, wifi=False):
409        self.log.info("Begin In Call MMS Test.")
410        if not call_setup_teardown(
411                self.log,
412                self.caller,
413                self.callee,
414                ad_hangup=None,
415                verify_caller_func=is_phone_in_call_csfb,
416                verify_callee_func=None):
417            return False
418
419        if ads[0].sms_over_wifi and wifi:
420            return self._mms_test_mo(ads)
421        else:
422            return self._mms_test_mo_after_call_hangup(ads)
423
424    def _mt_mms_in_csfb_call(self, ads, wifi=False):
425        self.log.info("Begin In Call MMS Test.")
426        if not call_setup_teardown(
427                self.log,
428                self.caller,
429                self.callee,
430                ad_hangup=None,
431                verify_caller_func=is_phone_in_call_csfb,
432                verify_callee_func=None):
433            return False
434
435        if ads[0].sms_over_wifi and wifi:
436            return self._mms_test_mt(ads)
437        else:
438            return self._mms_test_mt_after_call_hangup(ads)
439
440    @test_tracker_info(uuid="480b6ba2-1e5f-4a58-9d88-9b75c8fab1b6")
441    @TelephonyBaseTest.tel_test_wrap
442    def test_sms_mo_general(self):
443        """Test SMS basic function between two phone. Phones in any network.
444
445        Airplane mode is off.
446        Send SMS from PhoneA to PhoneB.
447        Verify received message on PhoneB is correct.
448
449        Returns:
450            True if success.
451            False if failed.
452        """
453        ads = self.android_devices
454
455        tasks = [(ensure_phone_default_state, (self.log, ads[0])),
456                 (ensure_phone_default_state, (self.log, ads[1]))]
457        if not multithread_func(self.log, tasks):
458            self.log.error("Phone Failed to Set Up Properly.")
459            return False
460        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
461
462        return self._sms_test_mo(ads)
463
464    @test_tracker_info(uuid="aa87fe73-8236-44c7-865c-3fe3b733eeb4")
465    @TelephonyBaseTest.tel_test_wrap
466    def test_sms_mt_general(self):
467        """Test SMS basic function between two phone. Phones in any network.
468
469        Airplane mode is off.
470        Send SMS from PhoneB to PhoneA.
471        Verify received message on PhoneA is correct.
472
473        Returns:
474            True if success.
475            False if failed.
476        """
477        ads = self.android_devices
478
479        tasks = [(ensure_phone_default_state, (self.log, ads[0])),
480                 (ensure_phone_default_state, (self.log, ads[1]))]
481        if not multithread_func(self.log, tasks):
482            self.log.error("Phone Failed to Set Up Properly.")
483            return False
484        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
485        return self._sms_test_mt(ads)
486
487    @test_tracker_info(uuid="bb8e1a06-a4b5-4f9b-9ab2-408ace9a1deb")
488    @TelephonyBaseTest.tel_test_wrap
489    def test_mms_mo_general(self):
490        """Test MMS basic function between two phone. Phones in any network.
491
492        Airplane mode is off.
493        Send MMS from PhoneA to PhoneB.
494        Verify received message on PhoneB is correct.
495
496        Returns:
497            True if success.
498            False if failed.
499        """
500        ads = self.android_devices
501
502        tasks = [(ensure_phone_default_state, (self.log, ads[0])),
503                 (ensure_phone_default_state, (self.log, ads[1]))]
504        if not multithread_func(self.log, tasks):
505            self.log.error("Phone Failed to Set Up Properly.")
506            return False
507        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
508
509        return self._mms_test_mo(ads)
510
511    @test_tracker_info(uuid="f2779e1e-7d09-43f0-8b5c-87eae5d146be")
512    @TelephonyBaseTest.tel_test_wrap
513    def test_mms_mt_general(self):
514        """Test MMS basic function between two phone. Phones in any network.
515
516        Airplane mode is off.
517        Send MMS from PhoneB to PhoneA.
518        Verify received message on PhoneA is correct.
519
520        Returns:
521            True if success.
522            False if failed.
523        """
524        ads = self.android_devices
525
526        tasks = [(ensure_phone_default_state, (self.log, ads[0])),
527                 (ensure_phone_default_state, (self.log, ads[1]))]
528        if not multithread_func(self.log, tasks):
529            self.log.error("Phone Failed to Set Up Properly.")
530            return False
531        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
532        return self._mms_test_mt(ads)
533
534    @test_tracker_info(uuid="2c229a4b-c954-4ba3-94ba-178dc7784d03")
535    @TelephonyBaseTest.tel_test_wrap
536    def test_sms_mo_2g(self):
537        """Test SMS basic function between two phone. Phones in 3g network.
538
539        Airplane mode is off.
540        Send SMS from PhoneA to PhoneB.
541        Verify received message on PhoneB is correct.
542
543        Returns:
544            True if success.
545            False if failed.
546        """
547        ads = self.android_devices
548
549        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
550                 (phone_setup_voice_general, (self.log, ads[1]))]
551        if not multithread_func(self.log, tasks):
552            self.log.error("Phone Failed to Set Up Properly.")
553            return False
554        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
555
556        return self._sms_test_mo(ads)
557
558    @test_tracker_info(uuid="17fafc41-7e12-47ab-a4cc-fb9bd94e79b9")
559    @TelephonyBaseTest.tel_test_wrap
560    def test_sms_mt_2g(self):
561        """Test SMS basic function between two phone. Phones in 3g network.
562
563        Airplane mode is off.
564        Send SMS from PhoneB to PhoneA.
565        Verify received message on PhoneA is correct.
566
567        Returns:
568            True if success.
569            False if failed.
570        """
571        ads = self.android_devices
572
573        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
574                 (phone_setup_voice_general, (self.log, ads[1]))]
575        if not multithread_func(self.log, tasks):
576            self.log.error("Phone Failed to Set Up Properly.")
577            return False
578        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
579
580        return self._sms_test_mt(ads)
581
582    @test_tracker_info(uuid="b4919317-18b5-483c-82f4-ced37a04f28d")
583    @TelephonyBaseTest.tel_test_wrap
584    def test_mms_mo_2g(self):
585        """Test MMS basic function between two phone. Phones in 3g network.
586
587        Airplane mode is off.
588        Send MMS from PhoneA to PhoneB.
589        Verify received message on PhoneB is correct.
590
591        Returns:
592            True if success.
593            False if failed.
594        """
595        ads = self.android_devices
596
597        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
598                 (phone_setup_voice_general, (self.log, ads[1]))]
599        if not multithread_func(self.log, tasks):
600            self.log.error("Phone Failed to Set Up Properly.")
601            return False
602        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
603
604        return self._mms_test_mo(ads)
605
606    @test_tracker_info(uuid="cd56bb8a-0794-404d-95bd-c5fd00f4b35a")
607    @TelephonyBaseTest.tel_test_wrap
608    def test_mms_mt_2g(self):
609        """Test MMS basic function between two phone. Phones in 3g network.
610
611        Airplane mode is off.
612        Send MMS from PhoneB to PhoneA.
613        Verify received message on PhoneA is correct.
614
615        Returns:
616            True if success.
617            False if failed.
618        """
619        ads = self.android_devices
620
621        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
622                 (phone_setup_voice_general, (self.log, ads[1]))]
623        if not multithread_func(self.log, tasks):
624            self.log.error("Phone Failed to Set Up Properly.")
625            return False
626        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
627
628        return self._mms_test_mt(ads)
629
630    @test_tracker_info(uuid="b39fbc30-9cc2-4d86-a9f4-6f0c1dd0a905")
631    @TelephonyBaseTest.tel_test_wrap
632    def test_mms_mo_2g_wifi(self):
633        """Test MMS basic function between two phone. Phones in 3g network.
634
635        Airplane mode is off. Phone in 2G.
636        Connect to Wifi.
637        Send MMS from PhoneA to PhoneB.
638        Verify received message on PhoneB is correct.
639
640        Returns:
641            True if success.
642            False if failed.
643        """
644        ads = self.android_devices
645
646        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
647                 (phone_setup_voice_general, (self.log, ads[1]))]
648        if not multithread_func(self.log, tasks):
649            self.log.error("Phone failed to set up 2G.")
650            return False
651        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
652                              self.wifi_network_pass)
653        return self._mms_test_mo(ads)
654
655    @test_tracker_info(uuid="b158a0a7-9697-4b3b-8d5b-f9b6b6bc1c03")
656    @TelephonyBaseTest.tel_test_wrap
657    def test_mms_mt_2g_wifi(self):
658        """Test MMS basic function between two phone. Phones in 3g network.
659
660        Airplane mode is off. Phone in 2G.
661        Connect to Wifi.
662        Send MMS from PhoneB to PhoneA.
663        Verify received message on PhoneA is correct.
664
665        Returns:
666            True if success.
667            False if failed.
668        """
669        ads = self.android_devices
670
671        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
672                 (phone_setup_voice_general, (self.log, ads[1]))]
673        if not multithread_func(self.log, tasks):
674            self.log.error("Phone failed to set up 2G.")
675            return False
676        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
677                              self.wifi_network_pass)
678
679        return self._mms_test_mt(ads)
680
681    @test_tracker_info(uuid="f094e3da-2523-4f92-a1f3-7cf9edcff850")
682    @TelephonyBaseTest.tel_test_wrap
683    def test_sms_mo_3g(self):
684        """Test SMS basic function between two phone. Phones in 3g network.
685
686        Airplane mode is off.
687        Send SMS from PhoneA to PhoneB.
688        Verify received message on PhoneB is correct.
689
690        Returns:
691            True if success.
692            False if failed.
693        """
694
695        ads = self.android_devices
696
697        tasks = [(phone_setup_3g, (self.log, ads[0])),
698                 (phone_setup_voice_general, (self.log, ads[1]))]
699        if not multithread_func(self.log, tasks):
700            self.log.error("Phone Failed to Set Up Properly.")
701            return False
702        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
703        return self._sms_test_mo(ads)
704
705    @test_tracker_info(uuid="2186e152-bf83-4d6e-93eb-b4bf9ae2d76e")
706    @TelephonyBaseTest.tel_test_wrap
707    def test_sms_mt_3g(self):
708        """Test SMS basic function between two phone. Phones in 3g network.
709
710        Airplane mode is off.
711        Send SMS from PhoneB to PhoneA.
712        Verify received message on PhoneA is correct.
713
714        Returns:
715            True if success.
716            False if failed.
717        """
718
719        ads = self.android_devices
720
721        tasks = [(phone_setup_3g, (self.log, ads[0])),
722                 (phone_setup_voice_general, (self.log, ads[1]))]
723        if not multithread_func(self.log, tasks):
724            self.log.error("Phone Failed to Set Up Properly.")
725            return False
726        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
727
728        return self._sms_test_mt(ads)
729
730    @test_tracker_info(uuid="e716c678-eee9-4a0d-a9cd-ca9eae4fea51")
731    @TelephonyBaseTest.tel_test_wrap
732    def test_mms_mo_3g(self):
733        """Test MMS basic function between two phone. Phones in 3g network.
734
735        Airplane mode is off. Phone in 3G.
736        Send MMS from PhoneA to PhoneB.
737        Verify received message on PhoneB is correct.
738
739        Returns:
740            True if success.
741            False if failed.
742        """
743
744        ads = self.android_devices
745
746        tasks = [(phone_setup_3g, (self.log, ads[0])),
747                 (phone_setup_voice_general, (self.log, ads[1]))]
748        if not multithread_func(self.log, tasks):
749            self.log.error("Phone Failed to Set Up Properly.")
750            return False
751        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
752
753        return self._mms_test_mo(ads)
754
755    @test_tracker_info(uuid="e864a99e-d935-4bd9-95f6-8183cdd3d760")
756    @TelephonyBaseTest.tel_test_wrap
757    def test_mms_mt_3g(self):
758        """Test MMS basic function between two phone. Phones in 3g network.
759
760        Airplane mode is off. Phone in 3G.
761        Send MMS from PhoneB to PhoneA.
762        Verify received message on PhoneA is correct.
763
764        Returns:
765            True if success.
766            False if failed.
767        """
768
769        ads = self.android_devices
770
771        tasks = [(phone_setup_3g, (self.log, ads[0])),
772                 (phone_setup_voice_general, (self.log, ads[1]))]
773        if not multithread_func(self.log, tasks):
774            self.log.error("Phone Failed to Set Up Properly.")
775            return False
776        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
777
778        return self._mms_test_mt(ads)
779
780    @test_tracker_info(uuid="07cdfe26-9021-4af3-8bf6-1abd0cb9e932")
781    @TelephonyBaseTest.tel_test_wrap
782    def test_sms_long_message_mo_3g(self):
783        """Test SMS basic function between two phone. Phones in 3g network.
784
785        Airplane mode is off.
786        Send SMS from PhoneA to PhoneB.
787        Verify received message on PhoneB is correct.
788
789        Returns:
790            True if success.
791            False if failed.
792        """
793
794        ads = self.android_devices
795
796        tasks = [(phone_setup_3g, (self.log, ads[0])),
797                 (phone_setup_voice_general, (self.log, ads[1]))]
798        if not multithread_func(self.log, tasks):
799            self.log.error("Phone Failed to Set Up Properly.")
800            return False
801        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
802        return self._long_sms_test_mo(ads)
803
804    @test_tracker_info(uuid="740efe0d-fef9-42bc-a732-fe79a3485426")
805    @TelephonyBaseTest.tel_test_wrap
806    def test_sms_long_message_mt_3g(self):
807        """Test SMS basic function between two phone. Phones in 3g network.
808
809        Airplane mode is off.
810        Send SMS from PhoneB to PhoneA.
811        Verify received message on PhoneA is correct.
812
813        Returns:
814            True if success.
815            False if failed.
816        """
817
818        ads = self.android_devices
819
820        tasks = [(phone_setup_3g, (self.log, ads[0])),
821                 (phone_setup_voice_general, (self.log, ads[1]))]
822        if not multithread_func(self.log, tasks):
823            self.log.error("Phone Failed to Set Up Properly.")
824            return False
825        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
826
827        return self._long_sms_test_mt(ads)
828
829    @test_tracker_info(uuid="b0d27de3-1a98-48da-a9c9-c20c8587f256")
830    @TelephonyBaseTest.tel_test_wrap
831    def test_mms_long_message_mo_3g(self):
832        """Test MMS basic function between two phone. Phones in 3g network.
833
834        Airplane mode is off. Phone in 3G.
835        Send MMS from PhoneA to PhoneB.
836        Verify received message on PhoneB is correct.
837
838        Returns:
839            True if success.
840            False if failed.
841        """
842
843        ads = self.android_devices
844
845        tasks = [(phone_setup_3g, (self.log, ads[0])),
846                 (phone_setup_voice_general, (self.log, ads[1]))]
847        if not multithread_func(self.log, tasks):
848            self.log.error("Phone Failed to Set Up Properly.")
849            return False
850        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
851
852        return self._long_mms_test_mo(ads)
853
854    @test_tracker_info(uuid="fd5a1583-94d2-4b3a-b613-a0a9745daa25")
855    @TelephonyBaseTest.tel_test_wrap
856    def test_mms_long_message_mt_3g(self):
857        """Test MMS basic function between two phone. Phones in 3g network.
858
859        Airplane mode is off. Phone in 3G.
860        Send MMS from PhoneB to PhoneA.
861        Verify received message on PhoneA is correct.
862
863        Returns:
864            True if success.
865            False if failed.
866        """
867
868        ads = self.android_devices
869
870        tasks = [(phone_setup_3g, (self.log, ads[0])),
871                 (phone_setup_voice_general, (self.log, ads[1]))]
872        if not multithread_func(self.log, tasks):
873            self.log.error("Phone Failed to Set Up Properly.")
874            return False
875        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
876
877        return self._long_mms_test_mt(ads)
878
879    @test_tracker_info(uuid="c6cfba55-6cde-41cd-93bb-667c317a0127")
880    @TelephonyBaseTest.tel_test_wrap
881    def test_mms_mo_3g_wifi(self):
882        """Test MMS basic function between two phone. Phones in 3g network.
883
884        Airplane mode is off. Phone in 3G.
885        Connect to Wifi.
886        Send MMS from PhoneA to PhoneB.
887        Verify received message on PhoneB is correct.
888
889        Returns:
890            True if success.
891            False if failed.
892        """
893
894        ads = self.android_devices
895
896        tasks = [(phone_setup_3g, (self.log, ads[0])),
897                 (phone_setup_voice_general, (self.log, ads[1]))]
898        if not multithread_func(self.log, tasks):
899            self.log.error("Phone Failed to Set Up Properly.")
900            return False
901        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
902                              self.wifi_network_pass)
903
904        return self._mms_test_mo(ads)
905
906    @test_tracker_info(uuid="83c5dd99-f2fe-433d-9775-80a36d0d493b")
907    @TelephonyBaseTest.tel_test_wrap
908    def test_mms_mt_3g_wifi(self):
909        """Test MMS basic function between two phone. Phones in 3g network.
910
911        Airplane mode is off. Phone in 3G.
912        Connect to Wifi.
913        Send MMS from PhoneB to PhoneA.
914        Verify received message on PhoneA is correct.
915
916        Returns:
917            True if success.
918            False if failed.
919        """
920
921        ads = self.android_devices
922
923        tasks = [(phone_setup_3g, (self.log, ads[0])), (phone_setup_3g,
924                                                        (self.log, ads[1]))]
925        if not multithread_func(self.log, tasks):
926            self.log.error("Phone Failed to Set Up Properly.")
927            return False
928        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
929                              self.wifi_network_pass)
930
931        return self._mms_test_mt(ads)
932
933    @test_tracker_info(uuid="54a68d6a-dae7-4fe6-b2bb-7c73151a4a73")
934    @TelephonyBaseTest.tel_test_wrap
935    def test_sms_mo_4g_volte(self):
936        """Test SMS text function between two phone. Phones in LTE network.
937
938        Airplane mode is off. VoLTE is enabled on PhoneA.
939        Send MMS from PhoneA to PhoneB.
940        Verify received message on PhoneB is correct.
941
942        Returns:
943            True if success.
944            False if failed.
945        """
946
947        ads = self.android_devices
948
949        tasks = [(phone_setup_volte, (self.log, ads[0])),
950                 (phone_setup_voice_general, (self.log, ads[1]))]
951        if not multithread_func(self.log, tasks):
952            self.log.error("Phone Failed to Set Up Properly.")
953            return False
954        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
955
956        return self._sms_test_mo(ads)
957
958    @test_tracker_info(uuid="d0adcd69-37fc-49d1-8dd3-c03dd163fb25")
959    @TelephonyBaseTest.tel_test_wrap
960    def test_sms_mt_4g_volte(self):
961        """Test SMS text function between two phone. Phones in LTE network.
962
963        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
964        Send MMS from PhoneB to PhoneA.
965        Verify received message on PhoneA is correct.
966
967        Returns:
968            True if success.
969            False if failed.
970        """
971
972        ads = self.android_devices
973
974        tasks = [(phone_setup_volte, (self.log, ads[0])),
975                 (phone_setup_voice_general, (self.log, ads[1]))]
976        if not multithread_func(self.log, tasks):
977            self.log.error("Phone Failed to Set Up Properly.")
978            return False
979        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
980
981        return self._sms_test_mt(ads)
982
983    @test_tracker_info(uuid="8d454a25-a1e5-4872-8193-d435a84d54fa")
984    @TelephonyBaseTest.tel_test_wrap
985    def test_mms_mo_4g_volte(self):
986        """Test MMS text function between two phone. Phones in LTE network.
987
988        Airplane mode is off. VoLTE is enabled on PhoneA.
989        Send MMS from PhoneA to PhoneB.
990        Verify received message on PhoneB is correct.
991
992        Returns:
993            True if success.
994            False if failed.
995        """
996
997        ads = self.android_devices
998
999        tasks = [(phone_setup_volte, (self.log, ads[0])),
1000                 (phone_setup_voice_general, (self.log, ads[1]))]
1001        if not multithread_func(self.log, tasks):
1002            self.log.error("Phone Failed to Set Up Properly.")
1003            return False
1004        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1005
1006        return self._mms_test_mo(ads)
1007
1008    @test_tracker_info(uuid="79b8239e-9e6a-4781-942b-2df5b060718d")
1009    @TelephonyBaseTest.tel_test_wrap
1010    def test_mms_mt_4g_volte(self):
1011        """Test MMS text function between two phone. Phones in LTE network.
1012
1013        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
1014        Send MMS from PhoneB to PhoneA.
1015        Verify received message on PhoneA is correct.
1016
1017        Returns:
1018            True if success.
1019            False if failed.
1020        """
1021
1022        ads = self.android_devices
1023
1024        tasks = [(phone_setup_volte, (self.log, ads[0])),
1025                 (phone_setup_voice_general, (self.log, ads[1]))]
1026        if not multithread_func(self.log, tasks):
1027            self.log.error("Phone Failed to Set Up Properly.")
1028            return False
1029        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1030
1031        return self._mms_test_mt(ads)
1032
1033    @test_tracker_info(uuid="5b9e1195-1e42-4405-890f-631e8c58d0c2")
1034    @TelephonyBaseTest.tel_test_wrap
1035    def test_sms_long_message_mo_4g_volte(self):
1036        """Test SMS text function between two phone. Phones in LTE network.
1037
1038        Airplane mode is off. VoLTE is enabled on PhoneA.
1039        Send MMS from PhoneA to PhoneB.
1040        Verify received message on PhoneB is correct.
1041
1042        Returns:
1043            True if success.
1044            False if failed.
1045        """
1046
1047        ads = self.android_devices
1048
1049        tasks = [(phone_setup_volte, (self.log, ads[0])),
1050                 (phone_setup_voice_general, (self.log, ads[1]))]
1051        if not multithread_func(self.log, tasks):
1052            self.log.error("Phone Failed to Set Up Properly.")
1053            return False
1054        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1055
1056        return self._long_sms_test_mo(ads)
1057
1058    @test_tracker_info(uuid="c328cbe7-1899-4ca8-af1c-5eb05683a322")
1059    @TelephonyBaseTest.tel_test_wrap
1060    def test_sms_long_message_mt_4g_volte(self):
1061        """Test SMS text function between two phone. Phones in LTE network.
1062
1063        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
1064        Send MMS from PhoneB to PhoneA.
1065        Verify received message on PhoneA is correct.
1066
1067        Returns:
1068            True if success.
1069            False if failed.
1070        """
1071
1072        ads = self.android_devices
1073
1074        tasks = [(phone_setup_volte, (self.log, ads[0])),
1075                 (phone_setup_voice_general, (self.log, ads[1]))]
1076        if not multithread_func(self.log, tasks):
1077            self.log.error("Phone Failed to Set Up Properly.")
1078            return False
1079        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1080
1081        return self._long_sms_test_mt(ads)
1082
1083    @test_tracker_info(uuid="a843c2f7-e4de-4b99-b3a9-f05ecda5fe73")
1084    @TelephonyBaseTest.tel_test_wrap
1085    def test_mms_long_message_mo_4g_volte(self):
1086        """Test MMS text function between two phone. Phones in LTE network.
1087
1088        Airplane mode is off. VoLTE is enabled on PhoneA.
1089        Send MMS from PhoneA to PhoneB.
1090        Verify received message on PhoneB is correct.
1091
1092        Returns:
1093            True if success.
1094            False if failed.
1095        """
1096
1097        ads = self.android_devices
1098
1099        tasks = [(phone_setup_volte, (self.log, ads[0])),
1100                 (phone_setup_voice_general, (self.log, ads[1]))]
1101        if not multithread_func(self.log, tasks):
1102            self.log.error("Phone Failed to Set Up Properly.")
1103            return False
1104        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1105
1106        return self._long_mms_test_mo(ads)
1107
1108    @test_tracker_info(uuid="26dcba4d-7ddb-438d-84e7-0e754178b5ef")
1109    @TelephonyBaseTest.tel_test_wrap
1110    def test_mms_long_message_mt_4g_volte(self):
1111        """Test MMS text function between two phone. Phones in LTE network.
1112
1113        Airplane mode is off. Phone in 4G. VoLTE is enabled on PhoneA.
1114        Send MMS from PhoneB to PhoneA.
1115        Verify received message on PhoneA is correct.
1116
1117        Returns:
1118            True if success.
1119            False if failed.
1120        """
1121
1122        ads = self.android_devices
1123
1124        tasks = [(phone_setup_volte, (self.log, ads[0])),
1125                 (phone_setup_voice_general, (self.log, ads[1]))]
1126        if not multithread_func(self.log, tasks):
1127            self.log.error("Phone Failed to Set Up Properly.")
1128            return False
1129        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1130
1131        return self._long_mms_test_mt(ads)
1132
1133    @test_tracker_info(uuid="c97687e2-155a-4cf3-9f51-22543b89d53e")
1134    @TelephonyBaseTest.tel_test_wrap
1135    def test_sms_mo_4g(self):
1136        """Test SMS basic function between two phone. Phones in LTE network.
1137
1138        Airplane mode is off.
1139        Send SMS from PhoneA to PhoneB.
1140        Verify received message on PhoneB is correct.
1141
1142        Returns:
1143            True if success.
1144            False if failed.
1145        """
1146
1147        ads = self.android_devices
1148        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1149                 (phone_setup_voice_general, (self.log, ads[1]))]
1150        if not multithread_func(self.log, tasks):
1151            self.log.error("Phone Failed to Set Up Properly.")
1152            return False
1153        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1154
1155        return self._sms_test_mo(ads)
1156
1157    @test_tracker_info(uuid="e2e01a47-2b51-4d00-a7b2-dbd3c8ffa6ae")
1158    @TelephonyBaseTest.tel_test_wrap
1159    def test_sms_mt_4g(self):
1160        """Test SMS basic function between two phone. Phones in LTE network.
1161
1162        Airplane mode is off.
1163        Send SMS from PhoneB to PhoneA.
1164        Verify received message on PhoneA is correct.
1165
1166        Returns:
1167            True if success.
1168            False if failed.
1169        """
1170
1171        ads = self.android_devices
1172        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1173                 (phone_setup_voice_general, (self.log, ads[1]))]
1174        if not multithread_func(self.log, tasks):
1175            self.log.error("Phone Failed to Set Up Properly.")
1176            return False
1177
1178        return self._sms_test_mt(ads)
1179
1180    @test_tracker_info(uuid="90fc6775-de19-49d1-8b8e-e3bc9384c733")
1181    @TelephonyBaseTest.tel_test_wrap
1182    def test_mms_mo_4g(self):
1183        """Test MMS text function between two phone. Phones in LTE network.
1184
1185        Airplane mode is off.
1186        Send MMS from PhoneA to PhoneB.
1187        Verify received message on PhoneB is correct.
1188
1189        Returns:
1190            True if success.
1191            False if failed.
1192        """
1193
1194        ads = self.android_devices
1195
1196        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1197                 (phone_setup_voice_general, (self.log, ads[1]))]
1198        if not multithread_func(self.log, tasks):
1199            self.log.error("Phone Failed to Set Up Properly.")
1200            return False
1201        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1202
1203        return self._mms_test_mo(ads)
1204
1205    @test_tracker_info(uuid="274572bb-ec9f-4c30-aab4-1f4c3f16b372")
1206    @TelephonyBaseTest.tel_test_wrap
1207    def test_mms_mt_4g(self):
1208        """Test MMS text function between two phone. Phones in LTE network.
1209
1210        Airplane mode is off. Phone in 4G.
1211        Send MMS from PhoneB to PhoneA.
1212        Verify received message on PhoneA is correct.
1213
1214        Returns:
1215            True if success.
1216            False if failed.
1217        """
1218
1219        ads = self.android_devices
1220
1221        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1222                 (phone_setup_voice_general, (self.log, ads[1]))]
1223        if not multithread_func(self.log, tasks):
1224            self.log.error("Phone Failed to Set Up Properly.")
1225            return False
1226        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1227
1228        return self._mms_test_mt(ads)
1229
1230    @test_tracker_info(uuid="44392814-98dd-406a-ae82-5c39e2d082f3")
1231    @TelephonyBaseTest.tel_test_wrap
1232    def test_sms_long_message_mo_4g(self):
1233        """Test SMS basic function between two phone. Phones in LTE network.
1234
1235        Airplane mode is off.
1236        Send SMS from PhoneA to PhoneB.
1237        Verify received message on PhoneB is correct.
1238
1239        Returns:
1240            True if success.
1241            False if failed.
1242        """
1243
1244        ads = self.android_devices
1245        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1246                 (phone_setup_voice_general, (self.log, ads[1]))]
1247        if not multithread_func(self.log, tasks):
1248            self.log.error("Phone Failed to Set Up Properly.")
1249            return False
1250        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1251
1252        return self._long_sms_test_mo(ads)
1253
1254    @test_tracker_info(uuid="0f8358a5-a7d5-4dfa-abe0-99fb8b10d48d")
1255    @TelephonyBaseTest.tel_test_wrap
1256    def test_sms_long_message_mt_4g(self):
1257        """Test SMS basic function between two phone. Phones in LTE network.
1258
1259        Airplane mode is off.
1260        Send SMS from PhoneB to PhoneA.
1261        Verify received message on PhoneA is correct.
1262
1263        Returns:
1264            True if success.
1265            False if failed.
1266        """
1267
1268        ads = self.android_devices
1269        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1270                 (phone_setup_voice_general, (self.log, ads[1]))]
1271        if not multithread_func(self.log, tasks):
1272            self.log.error("Phone Failed to Set Up Properly.")
1273            return False
1274
1275        return self._long_sms_test_mt(ads)
1276
1277    @test_tracker_info(uuid="18edde2b-7db9-40f4-96c4-3286a56d090b")
1278    @TelephonyBaseTest.tel_test_wrap
1279    def test_mms_long_message_mo_4g(self):
1280        """Test MMS text function between two phone. Phones in LTE network.
1281
1282        Airplane mode is off.
1283        Send MMS from PhoneA to PhoneB.
1284        Verify received message on PhoneB is correct.
1285
1286        Returns:
1287            True if success.
1288            False if failed.
1289        """
1290
1291        ads = self.android_devices
1292
1293        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1294                 (phone_setup_voice_general, (self.log, ads[1]))]
1295        if not multithread_func(self.log, tasks):
1296            self.log.error("Phone Failed to Set Up Properly.")
1297            return False
1298        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1299
1300        return self._long_mms_test_mo(ads)
1301
1302    @test_tracker_info(uuid="49805d08-6f1f-4c90-9bf4-e9acd6f63640")
1303    @TelephonyBaseTest.tel_test_wrap
1304    def test_mms_long_message_mt_4g(self):
1305        """Test MMS text function between two phone. Phones in LTE network.
1306
1307        Airplane mode is off. Phone in 4G.
1308        Send MMS from PhoneB to PhoneA.
1309        Verify received message on PhoneA is correct.
1310
1311        Returns:
1312            True if success.
1313            False if failed.
1314        """
1315
1316        ads = self.android_devices
1317
1318        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1319                 (phone_setup_voice_general, (self.log, ads[1]))]
1320        if not multithread_func(self.log, tasks):
1321            self.log.error("Phone Failed to Set Up Properly.")
1322            return False
1323        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1324
1325        return self._long_mms_test_mt(ads)
1326
1327    @test_tracker_info(uuid="c7349fdf-a376-4846-b466-1f329bd1557f")
1328    @TelephonyBaseTest.tel_test_wrap
1329    def test_mms_mo_4g_wifi(self):
1330        """Test MMS text function between two phone. Phones in LTE network.
1331
1332        Airplane mode is off. Phone in 4G.
1333        Connect to Wifi.
1334        Send MMS from PhoneA to PhoneB.
1335        Verify received message on PhoneB is correct.
1336
1337        Returns:
1338            True if success.
1339            False if failed.
1340        """
1341
1342        ads = self.android_devices
1343
1344        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1345                 (phone_setup_voice_general, (self.log, ads[1]))]
1346        if not multithread_func(self.log, tasks):
1347            self.log.error("Phone Failed to Set Up Properly.")
1348            return False
1349        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1350        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1351                              self.wifi_network_pass)
1352        return self._mms_test_mo(ads)
1353
1354    @test_tracker_info(uuid="1affab34-e03c-49dd-9062-e9ed8eac406b")
1355    @TelephonyBaseTest.tel_test_wrap
1356    def test_mms_mt_4g_wifi(self):
1357        """Test MMS text function between two phone. Phones in LTE network.
1358
1359        Airplane mode is off. Phone in 4G.
1360        Connect to Wifi.
1361        Send MMS from PhoneB to PhoneA.
1362        Verify received message on PhoneA is correct.
1363
1364        Returns:
1365            True if success.
1366            False if failed.
1367        """
1368
1369        ads = self.android_devices
1370
1371        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1372                 (phone_setup_voice_general, (self.log, ads[1]))]
1373        if not multithread_func(self.log, tasks):
1374            self.log.error("Phone Failed to Set Up Properly.")
1375            return False
1376        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1377        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1378                              self.wifi_network_pass)
1379
1380        return self._mms_test_mt(ads)
1381
1382    @test_tracker_info(uuid="7ee57edb-2962-4d20-b6eb-79cebce91fff")
1383    @TelephonyBaseTest.tel_test_wrap
1384    def test_sms_mo_in_call_volte(self):
1385        """ Test MO SMS during a MO VoLTE call.
1386
1387        Make sure PhoneA is in LTE mode (with VoLTE).
1388        Make sure PhoneB is able to make/receive call.
1389        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
1390
1391        Returns:
1392            True if pass; False if fail.
1393        """
1394        ads = self.android_devices
1395
1396        tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
1397                                                           (self.log, ads[1]))]
1398        if not multithread_func(self.log, tasks):
1399            self.log.error("Phone Failed to Set Up Properly.")
1400            return False
1401        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1402        self.log.info("Begin In Call SMS Test.")
1403        if not call_setup_teardown(
1404                self.log,
1405                ads[0],
1406                ads[1],
1407                ad_hangup=None,
1408                verify_caller_func=is_phone_in_call_volte,
1409                verify_callee_func=None):
1410            return False
1411
1412        if not self._sms_test_mo(ads):
1413            self.log.error("SMS test fail.")
1414            return False
1415
1416        return True
1417
1418    @test_tracker_info(uuid="5576276b-4ca1-41cc-bb74-31ccd71f9f96")
1419    @TelephonyBaseTest.tel_test_wrap
1420    def test_sms_mt_in_call_volte(self):
1421        """ Test MT SMS during a MO VoLTE call.
1422
1423        Make sure PhoneA is in LTE mode (with VoLTE).
1424        Make sure PhoneB is able to make/receive call.
1425        Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA.
1426
1427        Returns:
1428            True if pass; False if fail.
1429        """
1430        ads = self.android_devices
1431
1432        tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
1433                                                           (self.log, ads[1]))]
1434        if not multithread_func(self.log, tasks):
1435            self.log.error("Phone Failed to Set Up Properly.")
1436            return False
1437        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1438        self.log.info("Begin In Call SMS Test.")
1439        if not call_setup_teardown(
1440                self.log,
1441                ads[0],
1442                ads[1],
1443                ad_hangup=None,
1444                verify_caller_func=is_phone_in_call_volte,
1445                verify_callee_func=None):
1446            return False
1447
1448        if not self._sms_test_mt(ads):
1449            self.log.error("SMS test fail.")
1450            return False
1451
1452        return True
1453
1454    @test_tracker_info(uuid="3bf8ff74-baa6-4dc6-86eb-c13816fa9bc8")
1455    @TelephonyBaseTest.tel_test_wrap
1456    def test_mms_mo_in_call_volte(self):
1457        """ Test MO MMS during a MO VoLTE call.
1458
1459        Make sure PhoneA is in LTE mode (with VoLTE).
1460        Make sure PhoneB is able to make/receive call.
1461        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1462
1463        Returns:
1464            True if pass; False if fail.
1465        """
1466        ads = self.android_devices
1467
1468        tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
1469                                                           (self.log, ads[1]))]
1470        if not multithread_func(self.log, tasks):
1471            self.log.error("Phone Failed to Set Up Properly.")
1472            return False
1473        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1474        self.log.info("Begin In Call SMS Test.")
1475        if not call_setup_teardown(
1476                self.log,
1477                ads[0],
1478                ads[1],
1479                ad_hangup=None,
1480                verify_caller_func=is_phone_in_call_volte,
1481                verify_callee_func=None):
1482            return False
1483
1484        if not self._mms_test_mo(ads):
1485            self.log.error("MMS test fail.")
1486            return False
1487
1488        return True
1489
1490    @test_tracker_info(uuid="289e6516-5f66-403a-b292-50d067151730")
1491    @TelephonyBaseTest.tel_test_wrap
1492    def test_mms_mt_in_call_volte(self):
1493        """ Test MT MMS during a MO VoLTE call.
1494
1495        Make sure PhoneA is in LTE mode (with VoLTE).
1496        Make sure PhoneB is able to make/receive call.
1497        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1498
1499        Returns:
1500            True if pass; False if fail.
1501        """
1502        ads = self.android_devices
1503
1504        tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
1505                                                           (self.log, ads[1]))]
1506        if not multithread_func(self.log, tasks):
1507            self.log.error("Phone Failed to Set Up Properly.")
1508            return False
1509        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1510        self.log.info("Begin In Call MMS Test.")
1511        if not call_setup_teardown(
1512                self.log,
1513                ads[0],
1514                ads[1],
1515                ad_hangup=None,
1516                verify_caller_func=is_phone_in_call_volte,
1517                verify_callee_func=None):
1518            return False
1519
1520        if not self._mms_test_mt(ads):
1521            self.log.error("MMS test fail.")
1522            return False
1523
1524        return True
1525
1526    @test_tracker_info(uuid="5654d974-3c32-4cce-9d07-0c96213dacc5")
1527    @TelephonyBaseTest.tel_test_wrap
1528    def test_mms_mo_in_call_volte_wifi(self):
1529        """ Test MO MMS during a MO VoLTE call.
1530
1531        Make sure PhoneA is in LTE mode (with VoLTE).
1532        Make sure PhoneB is able to make/receive call.
1533        Connect PhoneA to Wifi.
1534        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1535
1536        Returns:
1537            True if pass; False if fail.
1538        """
1539        ads = self.android_devices
1540
1541        tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
1542                                                           (self.log, ads[1]))]
1543        if not multithread_func(self.log, tasks):
1544            self.log.error("Phone Failed to Set Up Properly.")
1545            return False
1546        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1547        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1548                              self.wifi_network_pass)
1549        self.log.info("Begin In Call SMS Test.")
1550        if not call_setup_teardown(
1551                self.log,
1552                ads[0],
1553                ads[1],
1554                ad_hangup=None,
1555                verify_caller_func=is_phone_in_call_volte,
1556                verify_callee_func=None):
1557            return False
1558
1559        if not self._mms_test_mo(ads):
1560            self.log.error("MMS test fail.")
1561            return False
1562
1563        return True
1564
1565    @test_tracker_info(uuid="cbd5ab3d-d76a-4ece-ac09-62efeead7550")
1566    @TelephonyBaseTest.tel_test_wrap
1567    def test_mms_mt_in_call_volte_wifi(self):
1568        """ Test MT MMS during a MO VoLTE call.
1569
1570        Make sure PhoneA is in LTE mode (with VoLTE).
1571        Make sure PhoneB is able to make/receive call.
1572        Connect PhoneA to Wifi.
1573        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1574
1575        Returns:
1576            True if pass; False if fail.
1577        """
1578        ads = self.android_devices
1579
1580        tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
1581                                                           (self.log, ads[1]))]
1582        if not multithread_func(self.log, tasks):
1583            self.log.error("Phone Failed to Set Up Properly.")
1584            return False
1585        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1586        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1587                              self.wifi_network_pass)
1588        self.log.info("Begin In Call MMS Test.")
1589        if not call_setup_teardown(
1590                self.log,
1591                ads[0],
1592                ads[1],
1593                ad_hangup=None,
1594                verify_caller_func=is_phone_in_call_volte,
1595                verify_callee_func=None):
1596            return False
1597
1598        if not self._mms_test_mt(ads):
1599            self.log.error("MMS test fail.")
1600            return False
1601
1602        return True
1603
1604    @test_tracker_info(uuid="b6e9ce80-8577-48e5-baa7-92780932f278")
1605    @TelephonyBaseTest.tel_test_wrap
1606    def test_sms_mo_in_call_csfb(self):
1607        """ Test MO SMS during a MO csfb call.
1608
1609        Make sure PhoneA is in LTE mode (no VoLTE).
1610        Make sure PhoneB is able to make/receive call.
1611        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
1612
1613        Returns:
1614            True if pass; False if fail.
1615        """
1616        ads = self.android_devices
1617
1618        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1619                 (phone_setup_voice_general, (self.log, ads[1]))]
1620        if not multithread_func(self.log, tasks):
1621            self.log.error("Phone Failed to Set Up Properly.")
1622            return False
1623        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1624
1625        return self._mo_sms_in_csfb_call(ads)
1626
1627    @test_tracker_info(uuid="93f0b58a-01e9-4bc9-944f-729d455597dd")
1628    @TelephonyBaseTest.tel_test_wrap
1629    def test_sms_mt_in_call_csfb(self):
1630        """ Test MT SMS during a MO csfb call.
1631
1632        Make sure PhoneA is in LTE mode (no VoLTE).
1633        Make sure PhoneB is able to make/receive call.
1634        Call from PhoneA to PhoneB, accept on PhoneB, receive receive on PhoneA.
1635
1636        Returns:
1637            True if pass; False if fail.
1638        """
1639        ads = self.android_devices
1640
1641        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1642                 (phone_setup_voice_general, (self.log, ads[1]))]
1643        if not multithread_func(self.log, tasks):
1644            self.log.error("Phone Failed to Set Up Properly.")
1645            return False
1646        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1647
1648        return self._mt_sms_in_csfb_call(ads)
1649
1650    @test_tracker_info(uuid="bd8e9e80-1955-429f-b122-96b127771bbb")
1651    @TelephonyBaseTest.tel_test_wrap
1652    def test_mms_mo_in_call_csfb(self):
1653        """ Test MO MMS during a MO csfb call.
1654
1655        Make sure PhoneA is in LTE mode (no VoLTE).
1656        Make sure PhoneB is able to make/receive call.
1657        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1658
1659        Returns:
1660            True if pass; False if fail.
1661        """
1662        ads = self.android_devices
1663
1664        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1665                 (phone_setup_voice_general, (self.log, ads[1]))]
1666        if not multithread_func(self.log, tasks):
1667            self.log.error("Phone Failed to Set Up Properly.")
1668            return False
1669        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1670
1671        return self._mo_mms_in_csfb_call(ads)
1672
1673    @test_tracker_info(uuid="89d65fd2-fc75-4fc5-a018-2d05a4364304")
1674    @TelephonyBaseTest.tel_test_wrap
1675    def test_mms_mt_in_call_csfb(self):
1676        """ Test MT MMS during a MO csfb call.
1677
1678        Make sure PhoneA is in LTE mode (no VoLTE).
1679        Make sure PhoneB is able to make/receive call.
1680        Call from PhoneA to PhoneB, accept on PhoneB, receive receive on PhoneA.
1681
1682        Returns:
1683            True if pass; False if fail.
1684        """
1685        ads = self.android_devices
1686
1687        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1688                 (phone_setup_voice_general, (self.log, ads[1]))]
1689        if not multithread_func(self.log, tasks):
1690            self.log.error("Phone Failed to Set Up Properly.")
1691            return False
1692        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1693
1694        return self._mt_mms_in_csfb_call(ads)
1695
1696    @test_tracker_info(uuid="9c542b5d-3b8f-4d4a-80de-fb804f066c3d")
1697    @TelephonyBaseTest.tel_test_wrap
1698    def test_mms_mo_in_call_csfb_wifi(self):
1699        """ Test MO MMS during a MO csfb call.
1700
1701        Make sure PhoneA is in LTE mode (no VoLTE).
1702        Make sure PhoneB is able to make/receive call.
1703        Connect PhoneA to Wifi.
1704        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
1705
1706        Returns:
1707            True if pass; False if fail.
1708        """
1709        ads = self.android_devices
1710
1711        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1712                 (phone_setup_voice_general, (self.log, ads[1]))]
1713        if not multithread_func(self.log, tasks):
1714            self.log.error("Phone Failed to Set Up Properly.")
1715            return False
1716        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1717        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1718                              self.wifi_network_pass)
1719
1720        return self._mo_mms_in_csfb_call(ads, wifi=True)
1721
1722    @test_tracker_info(uuid="c1bed6f5-f65c-4f4d-aa06-0e9f5c867819")
1723    @TelephonyBaseTest.tel_test_wrap
1724    def test_mms_mt_in_call_csfb_wifi(self):
1725        """ Test MT MMS during a MO csfb call.
1726
1727        Make sure PhoneA is in LTE mode (no VoLTE).
1728        Make sure PhoneB is able to make/receive call.
1729        Connect PhoneA to Wifi.
1730        Call from PhoneA to PhoneB, accept on PhoneB, receive receive on PhoneA.
1731
1732        Returns:
1733            True if pass; False if fail.
1734        """
1735        ads = self.android_devices
1736
1737        tasks = [(phone_setup_csfb, (self.log, ads[0])),
1738                 (phone_setup_voice_general, (self.log, ads[1]))]
1739        if not multithread_func(self.log, tasks):
1740            self.log.error("Phone Failed to Set Up Properly.")
1741            return False
1742        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1743        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1744                              self.wifi_network_pass)
1745
1746        return self._mt_mms_in_csfb_call(ads, wifi=True)
1747
1748    @test_tracker_info(uuid="60996028-b4b2-4a16-9e4b-eb6ef80179a7")
1749    @TelephonyBaseTest.tel_test_wrap
1750    def test_sms_mo_in_call_3g(self):
1751        """ Test MO SMS during a MO 3G call.
1752
1753        Make sure PhoneA is in 3g.
1754        Make sure PhoneB is able to make/receive call.
1755        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
1756
1757        Returns:
1758            True if pass; False if fail.
1759        """
1760        ads = self.android_devices
1761
1762        tasks = [(phone_setup_3g, (self.log, ads[0])),
1763                 (phone_setup_voice_general, (self.log, ads[1]))]
1764        if not multithread_func(self.log, tasks):
1765            self.log.error("Phone Failed to Set Up Properly.")
1766            return False
1767        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1768
1769        return self._mo_sms_in_3g_call(ads)
1770
1771    @test_tracker_info(uuid="6b352aac-9b4e-4062-8980-3b1c0e61015b")
1772    @TelephonyBaseTest.tel_test_wrap
1773    def test_sms_mt_in_call_3g(self):
1774        """ Test MT SMS during a MO 3G call.
1775
1776        Make sure PhoneA is in 3g.
1777        Make sure PhoneB is able to make/receive call.
1778        Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA.
1779
1780        Returns:
1781            True if pass; False if fail.
1782        """
1783        ads = self.android_devices
1784
1785        tasks = [(phone_setup_3g, (self.log, ads[0])),
1786                 (phone_setup_voice_general, (self.log, ads[1]))]
1787        if not multithread_func(self.log, tasks):
1788            self.log.error("Phone Failed to Set Up Properly.")
1789            return False
1790        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1791
1792        return self._mt_sms_in_3g_call(ads)
1793
1794    @test_tracker_info(uuid="cfae3613-c490-4ce0-b00b-c13286d85027")
1795    @TelephonyBaseTest.tel_test_wrap
1796    def test_mms_mo_in_call_3g(self):
1797        """ Test MO MMS during a MO 3G call.
1798
1799        Make sure PhoneA is in 3g.
1800        Make sure PhoneB is able to make/receive call.
1801        Call from PhoneA to PhoneB, accept on PhoneB.
1802        Send MMS on PhoneA during the call, MMS is send out after call is released.
1803
1804        Returns:
1805            True if pass; False if fail.
1806        """
1807        ads = self.android_devices
1808
1809        tasks = [(phone_setup_3g, (self.log, ads[0])),
1810                 (phone_setup_voice_general, (self.log, ads[1]))]
1811        if not multithread_func(self.log, tasks):
1812            self.log.error("Phone Failed to Set Up Properly.")
1813            return False
1814        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1815
1816        return self._mo_mms_in_3g_call(ads)
1817
1818    @test_tracker_info(uuid="42fc8c16-4a30-4f63-9728-2639f2b79c4c")
1819    @TelephonyBaseTest.tel_test_wrap
1820    def test_mms_mt_in_call_3g(self):
1821        """ Test MT MMS during a MO 3G call.
1822
1823        Make sure PhoneA is in 3g.
1824        Make sure PhoneB is able to make/receive call.
1825        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1826
1827        Returns:
1828            True if pass; False if fail.
1829        """
1830        ads = self.android_devices
1831
1832        tasks = [(phone_setup_3g, (self.log, ads[0])),
1833                 (phone_setup_voice_general, (self.log, ads[1]))]
1834        if not multithread_func(self.log, tasks):
1835            self.log.error("Phone Failed to Set Up Properly.")
1836            return False
1837        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1838
1839        return self._mt_mms_in_3g_call(ads)
1840
1841    @test_tracker_info(uuid="18093f87-aab5-4d86-b178-8085a1651828")
1842    @TelephonyBaseTest.tel_test_wrap
1843    def test_mms_mo_in_call_3g_wifi(self):
1844        """ Test MO MMS during a 3G call with Wifi on.
1845
1846        Make sure PhoneA is in 3g.
1847        Make sure PhoneB is able to make/receive call.
1848        Call from PhoneA to PhoneB, accept on PhoneB.
1849        Send MMS on PhoneA during the call, MMS is send out after call is released.
1850
1851        Returns:
1852            True if pass; False if fail.
1853        """
1854        ads = self.android_devices
1855
1856        tasks = [(phone_setup_3g, (self.log, ads[0])),
1857                 (phone_setup_voice_general, (self.log, ads[1]))]
1858        if not multithread_func(self.log, tasks):
1859            self.log.error("Phone Failed to Set Up Properly.")
1860            return False
1861        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1862        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1863                              self.wifi_network_pass)
1864
1865        return self._mo_mms_in_3g_call(ads, wifi=True)
1866
1867    @test_tracker_info(uuid="8fe3359a-0857-401f-a043-c47a2a2acb47")
1868    @TelephonyBaseTest.tel_test_wrap
1869    def test_mms_mt_in_call_3g_wifi(self):
1870        """ Test MT MMS during a 3G call with Wifi On.
1871
1872        Make sure PhoneA is in 3g.
1873        Make sure PhoneB is able to make/receive call.
1874        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
1875
1876        Returns:
1877            True if pass; False if fail.
1878        """
1879        ads = self.android_devices
1880
1881        tasks = [(phone_setup_3g, (self.log, ads[0])),
1882                 (phone_setup_voice_general, (self.log, ads[1]))]
1883        if not multithread_func(self.log, tasks):
1884            self.log.error("Phone Failed to Set Up Properly.")
1885            return False
1886        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1887        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
1888                              self.wifi_network_pass)
1889
1890        return self._mt_mms_in_3g_call(ads, wifi=True)
1891
1892    @test_tracker_info(uuid="ed720013-e366-448b-8901-bb09d26cea05")
1893    @TelephonyBaseTest.tel_test_wrap
1894    def test_sms_mo_iwlan(self):
1895        """ Test MO SMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1896
1897        Make sure PhoneA APM, WiFi connected, WFC Cell preferred mode.
1898        Make sure PhoneA report iwlan as data rat.
1899        Make sure PhoneB is able to make/receive call/sms.
1900        Send SMS on PhoneA.
1901
1902        Returns:
1903            True if pass; False if fail.
1904        """
1905
1906        ads = self.android_devices
1907
1908        tasks = [(phone_setup_iwlan,
1909                  (self.log, ads[0], True, WFC_MODE_CELLULAR_PREFERRED,
1910                   self.wifi_network_ssid, self.wifi_network_pass)),
1911                 (phone_setup_voice_general, (self.log, ads[1]))]
1912        if not multithread_func(self.log, tasks):
1913            self.log.error("Phone Failed to Set Up Properly.")
1914            return False
1915        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1916
1917        return self._sms_test_mo(ads)
1918
1919    @test_tracker_info(uuid="4d4b0b7b-bf00-44f6-a0ed-23b438c30fc2")
1920    @TelephonyBaseTest.tel_test_wrap
1921    def test_sms_mt_iwlan(self):
1922        """ Test MT SMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1923
1924        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
1925        Make sure PhoneA report iwlan as data rat.
1926        Make sure PhoneB is able to make/receive call/sms.
1927        Receive SMS on PhoneA.
1928
1929        Returns:
1930            True if pass; False if fail.
1931        """
1932
1933        ads = self.android_devices
1934
1935        tasks = [(phone_setup_iwlan,
1936                  (self.log, ads[0], True, WFC_MODE_CELLULAR_PREFERRED,
1937                   self.wifi_network_ssid, self.wifi_network_pass)),
1938                 (phone_setup_voice_general, (self.log, ads[1]))]
1939        if not multithread_func(self.log, tasks):
1940            self.log.error("Phone Failed to Set Up Properly.")
1941            return False
1942        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1943
1944        return self._sms_test_mt(ads)
1945
1946    @test_tracker_info(uuid="264e2557-e18c-41c0-8d99-49cee3fe6f07")
1947    @TelephonyBaseTest.tel_test_wrap
1948    def test_mms_mo_iwlan(self):
1949        """ Test MO MMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1950
1951        Make sure PhoneA APM, WiFi connected, WFC Cell preferred mode.
1952        Make sure PhoneA report iwlan as data rat.
1953        Make sure PhoneB is able to make/receive call/sms.
1954        Send MMS on PhoneA.
1955
1956        Returns:
1957            True if pass; False if fail.
1958        """
1959
1960        ads = self.android_devices
1961
1962        tasks = [(phone_setup_iwlan,
1963                  (self.log, ads[0], True, WFC_MODE_CELLULAR_PREFERRED,
1964                   self.wifi_network_ssid, self.wifi_network_pass)),
1965                 (phone_setup_voice_general, (self.log, ads[1]))]
1966        if not multithread_func(self.log, tasks):
1967            self.log.error("Phone Failed to Set Up Properly.")
1968            return False
1969        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1970
1971        return self._mms_test_mo(ads)
1972
1973    @test_tracker_info(uuid="330db618-f074-4bfc-bf5e-78939fbee532")
1974    @TelephonyBaseTest.tel_test_wrap
1975    def test_mms_mt_iwlan(self):
1976        """ Test MT MMS, Phone in APM, WiFi connected, WFC Cell Preferred mode.
1977
1978        Make sure PhoneA APM, WiFi connected, WFC Cell preferred mode.
1979        Make sure PhoneA report iwlan as data rat.
1980        Make sure PhoneB is able to make/receive call/sms.
1981        Receive MMS on PhoneA.
1982
1983        Returns:
1984            True if pass; False if fail.
1985        """
1986
1987        ads = self.android_devices
1988
1989        tasks = [(phone_setup_iwlan,
1990                  (self.log, ads[0], True, WFC_MODE_CELLULAR_PREFERRED,
1991                   self.wifi_network_ssid, self.wifi_network_pass)),
1992                 (phone_setup_voice_general, (self.log, ads[1]))]
1993        if not multithread_func(self.log, tasks):
1994            self.log.error("Phone Failed to Set Up Properly.")
1995            return False
1996        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
1997
1998        return self._mms_test_mt(ads)
1999
2000    @test_tracker_info(uuid="875ce520-7a09-4032-8e88-965ce143c1f5")
2001    @TelephonyBaseTest.tel_test_wrap
2002    def test_sms_long_message_mo_iwlan(self):
2003        """ Test MO SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2004
2005        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2006        Make sure PhoneA report iwlan as data rat.
2007        Make sure PhoneB is able to make/receive call/sms.
2008        Send SMS on PhoneA.
2009
2010        Returns:
2011            True if pass; False if fail.
2012        """
2013
2014        ads = self.android_devices
2015
2016        tasks = [(phone_setup_iwlan,
2017                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2018                   self.wifi_network_ssid, self.wifi_network_pass)),
2019                 (phone_setup_voice_general, (self.log, ads[1]))]
2020        if not multithread_func(self.log, tasks):
2021            self.log.error("Phone Failed to Set Up Properly.")
2022            return False
2023        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2024
2025        return self._long_sms_test_mo(ads)
2026
2027    @test_tracker_info(uuid="a317a1b3-16c8-4c2d-bbfd-aebcc0897499")
2028    @TelephonyBaseTest.tel_test_wrap
2029    def test_sms_long_message_mt_iwlan(self):
2030        """ Test MT SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2031
2032        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2033        Make sure PhoneA report iwlan as data rat.
2034        Make sure PhoneB is able to make/receive call/sms.
2035        Receive SMS on PhoneA.
2036
2037        Returns:
2038            True if pass; False if fail.
2039        """
2040
2041        ads = self.android_devices
2042
2043        tasks = [(phone_setup_iwlan,
2044                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2045                   self.wifi_network_ssid, self.wifi_network_pass)),
2046                 (phone_setup_voice_general, (self.log, ads[1]))]
2047        if not multithread_func(self.log, tasks):
2048            self.log.error("Phone Failed to Set Up Properly.")
2049            return False
2050        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2051
2052        return self._long_sms_test_mt(ads)
2053
2054    @test_tracker_info(uuid="d692c439-6e96-45a6-be0f-1ff81226416c")
2055    @TelephonyBaseTest.tel_test_wrap
2056    def test_mms_long_message_mo_iwlan(self):
2057        """ Test MO MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2058
2059        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2060        Make sure PhoneA report iwlan as data rat.
2061        Make sure PhoneB is able to make/receive call/sms.
2062        Send MMS on PhoneA.
2063
2064        Returns:
2065            True if pass; False if fail.
2066        """
2067
2068        ads = self.android_devices
2069
2070        tasks = [(phone_setup_iwlan,
2071                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2072                   self.wifi_network_ssid, self.wifi_network_pass)),
2073                 (phone_setup_voice_general, (self.log, ads[1]))]
2074        if not multithread_func(self.log, tasks):
2075            self.log.error("Phone Failed to Set Up Properly.")
2076            return False
2077        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2078
2079        return self._long_mms_test_mo(ads)
2080
2081    @test_tracker_info(uuid="a0958a1b-23ea-4353-9af6-7bc5d6a0a3d2")
2082    @TelephonyBaseTest.tel_test_wrap
2083    def test_mms_long_message_mt_iwlan(self):
2084        """ Test MT MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2085
2086        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2087        Make sure PhoneA report iwlan as data rat.
2088        Make sure PhoneB is able to make/receive call/sms.
2089        Receive MMS on PhoneA.
2090
2091        Returns:
2092            True if pass; False if fail.
2093        """
2094
2095        ads = self.android_devices
2096
2097        tasks = [(phone_setup_iwlan,
2098                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2099                   self.wifi_network_ssid, self.wifi_network_pass)),
2100                 (phone_setup_voice_general, (self.log, ads[1]))]
2101        if not multithread_func(self.log, tasks):
2102            self.log.error("Phone Failed to Set Up Properly.")
2103            return False
2104        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2105
2106        return self._long_mms_test_mt(ads)
2107
2108    @test_tracker_info(uuid="94bb8297-f646-4793-9d97-6f82a706127a")
2109    @TelephonyBaseTest.tel_test_wrap
2110    def test_sms_mo_iwlan_apm_off(self):
2111        """ Test MO SMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
2112
2113        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
2114        Make sure PhoneA report iwlan as data rat.
2115        Make sure PhoneB is able to make/receive call/sms.
2116        Send SMS on PhoneA.
2117
2118        Returns:
2119            True if pass; False if fail.
2120        """
2121
2122        ads = self.android_devices
2123
2124        tasks = [(phone_setup_iwlan,
2125                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
2126                   self.wifi_network_ssid, self.wifi_network_pass)),
2127                 (phone_setup_voice_general, (self.log, ads[1]))]
2128        if not multithread_func(self.log, tasks):
2129            self.log.error("Phone Failed to Set Up Properly.")
2130            return False
2131        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2132
2133        return self._sms_test_mo(ads)
2134
2135    @test_tracker_info(uuid="e4acce6a-75ae-45c1-be85-d3a2eb2da7c2")
2136    @TelephonyBaseTest.tel_test_wrap
2137    def test_sms_mt_iwlan_apm_off(self):
2138        """ Test MT SMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
2139
2140        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
2141        Make sure PhoneA report iwlan as data rat.
2142        Make sure PhoneB is able to make/receive call/sms.
2143        Receive SMS on PhoneA.
2144
2145        Returns:
2146            True if pass; False if fail.
2147        """
2148
2149        ads = self.android_devices
2150
2151        tasks = [(phone_setup_iwlan,
2152                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
2153                   self.wifi_network_ssid, self.wifi_network_pass)),
2154                 (phone_setup_voice_general, (self.log, ads[1]))]
2155        if not multithread_func(self.log, tasks):
2156            self.log.error("Phone Failed to Set Up Properly.")
2157            return False
2158        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2159
2160        return self._sms_test_mt(ads)
2161
2162    @test_tracker_info(uuid="6c003c28-5712-4456-89cb-64d417ab2ce4")
2163    @TelephonyBaseTest.tel_test_wrap
2164    def test_mms_mo_iwlan_apm_off(self):
2165        """ Test MO MMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
2166
2167        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
2168        Make sure PhoneA report iwlan as data rat.
2169        Make sure PhoneB is able to make/receive call/sms.
2170        Send MMS on PhoneA.
2171
2172        Returns:
2173            True if pass; False if fail.
2174        """
2175
2176        ads = self.android_devices
2177
2178        tasks = [(phone_setup_iwlan,
2179                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
2180                   self.wifi_network_ssid, self.wifi_network_pass)),
2181                 (phone_setup_voice_general, (self.log, ads[1]))]
2182        if not multithread_func(self.log, tasks):
2183            self.log.error("Phone Failed to Set Up Properly.")
2184            return False
2185        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2186
2187        return self._mms_test_mo(ads)
2188
2189    @test_tracker_info(uuid="0ac5c8ff-83e5-49f2-ba71-ebb283feed9e")
2190    @TelephonyBaseTest.tel_test_wrap
2191    def test_mms_mt_iwlan_apm_off(self):
2192        """ Test MT MMS, Phone in APM off, WiFi connected, WFC WiFi Preferred mode.
2193
2194        Make sure PhoneA APM off, WiFi connected, WFC WiFi preferred mode.
2195        Make sure PhoneA report iwlan as data rat.
2196        Make sure PhoneB is able to make/receive call/sms.
2197        Receive MMS on PhoneA.
2198
2199        Returns:
2200            True if pass; False if fail.
2201        """
2202
2203        ads = self.android_devices
2204
2205        tasks = [(phone_setup_iwlan,
2206                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
2207                   self.wifi_network_ssid, self.wifi_network_pass)),
2208                 (phone_setup_voice_general, (self.log, ads[1]))]
2209        if not multithread_func(self.log, tasks):
2210            self.log.error("Phone Failed to Set Up Properly.")
2211            return False
2212        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2213
2214        return self._mms_test_mt(ads)
2215
2216    @test_tracker_info(uuid="075933a2-df7f-4374-a405-92f96bcc7770")
2217    @TelephonyBaseTest.tel_test_wrap
2218    def test_sms_mo_apm_wifi_wfc_off(self):
2219        """ Test MO SMS, Phone in APM, WiFi connected, WFC off.
2220
2221        Make sure PhoneA APM, WiFi connected, WFC off.
2222        Make sure PhoneB is able to make/receive call/sms.
2223        Send SMS on PhoneA.
2224
2225        Returns:
2226            True if pass; False if fail.
2227        """
2228
2229        ads = self.android_devices
2230        phone_setup_voice_general(self.log, ads[0])
2231        tasks = [(ensure_wifi_connected,
2232                  (self.log, ads[0], self.wifi_network_ssid,
2233                   self.wifi_network_pass)), (phone_setup_voice_general,
2234                                              (self.log, ads[1]))]
2235        if not multithread_func(self.log, tasks):
2236            self.log.error("Phone Failed to Set Up Properly.")
2237            return False
2238        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2239
2240        return self._sms_test_mo(ads)
2241
2242    @test_tracker_info(uuid="637af228-29fc-4b74-a963-883f66ddf080")
2243    @TelephonyBaseTest.tel_test_wrap
2244    def test_sms_mt_apm_wifi_wfc_off(self):
2245        """ Test MT SMS, Phone in APM, WiFi connected, WFC off.
2246
2247        Make sure PhoneA APM, WiFi connected, WFC off.
2248        Make sure PhoneB is able to make/receive call/sms.
2249        Receive SMS on PhoneA.
2250
2251        Returns:
2252            True if pass; False if fail.
2253        """
2254
2255        ads = self.android_devices
2256        phone_setup_voice_general(self.log, ads[0])
2257        tasks = [(ensure_wifi_connected,
2258                  (self.log, ads[0], self.wifi_network_ssid,
2259                   self.wifi_network_pass)), (phone_setup_voice_general,
2260                                              (self.log, ads[1]))]
2261        if not multithread_func(self.log, tasks):
2262            self.log.error("Phone Failed to Set Up Properly.")
2263            return False
2264        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2265
2266        return self._sms_test_mt(ads)
2267
2268    @test_tracker_info(uuid="502aba0d-8895-4807-b394-50a44208ecf7")
2269    @TelephonyBaseTest.tel_test_wrap
2270    def test_mms_mo_apm_wifi_wfc_off(self):
2271        """ Test MO MMS, Phone in APM, WiFi connected, WFC off.
2272
2273        Make sure PhoneA APM, WiFi connected, WFC off.
2274        Make sure PhoneB is able to make/receive call/sms.
2275        Send MMS on PhoneA.
2276
2277        Returns:
2278            True if pass; False if fail.
2279        """
2280
2281        ads = self.android_devices
2282        phone_setup_voice_general(self.log, ads[0])
2283        tasks = [(ensure_wifi_connected,
2284                  (self.log, ads[0], self.wifi_network_ssid,
2285                   self.wifi_network_pass)), (phone_setup_voice_general,
2286                                              (self.log, ads[1]))]
2287        if not multithread_func(self.log, tasks):
2288            self.log.error("Phone Failed to Set Up Properly.")
2289            return False
2290        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2291
2292        return self._mms_test_mo(ads)
2293
2294    @test_tracker_info(uuid="235bfdbf-4275-4d89-99f5-41b5b7de8345")
2295    @TelephonyBaseTest.tel_test_wrap
2296    def test_mms_mt_apm_wifi_wfc_off(self):
2297        """ Test MT MMS, Phone in APM, WiFi connected, WFC off.
2298
2299        Make sure PhoneA APM, WiFi connected, WFC off.
2300        Make sure PhoneB is able to make/receive call/sms.
2301        Receive MMS on PhoneA.
2302
2303        Returns:
2304            True if pass; False if fail.
2305        """
2306
2307        ads = self.android_devices
2308        phone_setup_voice_general(self.log, ads[0])
2309        tasks = [(ensure_wifi_connected,
2310                  (self.log, ads[0], self.wifi_network_ssid,
2311                   self.wifi_network_pass)), (phone_setup_voice_general,
2312                                              (self.log, ads[1]))]
2313        if not multithread_func(self.log, tasks):
2314            self.log.error("Phone Failed to Set Up Properly.")
2315            return False
2316        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2317
2318        return self._mms_test_mt(ads)
2319
2320    @test_tracker_info(uuid="e5a31b94-1cb6-4770-a2bc-5a0ddba51502")
2321    @TelephonyBaseTest.tel_test_wrap
2322    def test_sms_mo_in_call_iwlan(self):
2323        """ Test MO SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2324
2325        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2326        Make sure PhoneA report iwlan as data rat.
2327        Make sure PhoneB is able to make/receive call/sms.
2328        Call from PhoneA to PhoneB, accept on PhoneB.
2329        Send SMS on PhoneA.
2330
2331        Returns:
2332            True if pass; False if fail.
2333        """
2334
2335        ads = self.android_devices
2336
2337        tasks = [(phone_setup_iwlan,
2338                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2339                   self.wifi_network_ssid, self.wifi_network_pass)),
2340                 (phone_setup_voice_general, (self.log, ads[1]))]
2341        if not multithread_func(self.log, tasks):
2342            self.log.error("Phone Failed to Set Up Properly.")
2343            return False
2344        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2345
2346        self.log.info("Begin In Call SMS Test.")
2347        if not call_setup_teardown(
2348                self.log,
2349                ads[0],
2350                ads[1],
2351                ad_hangup=None,
2352                verify_caller_func=is_phone_in_call_iwlan,
2353                verify_callee_func=None):
2354            return False
2355
2356        return self._sms_test_mo(ads)
2357
2358    @test_tracker_info(uuid="d6d30cc5-f75b-42df-b517-401456ee8466")
2359    @TelephonyBaseTest.tel_test_wrap
2360    def test_sms_mt_in_call_iwlan(self):
2361        """ Test MT SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2362
2363        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2364        Make sure PhoneA report iwlan as data rat.
2365        Make sure PhoneB is able to make/receive call/sms.
2366        Call from PhoneA to PhoneB, accept on PhoneB.
2367        Receive SMS on PhoneA.
2368
2369        Returns:
2370            True if pass; False if fail.
2371        """
2372
2373        ads = self.android_devices
2374
2375        tasks = [(phone_setup_iwlan,
2376                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2377                   self.wifi_network_ssid, self.wifi_network_pass)),
2378                 (phone_setup_voice_general, (self.log, ads[1]))]
2379        if not multithread_func(self.log, tasks):
2380            self.log.error("Phone Failed to Set Up Properly.")
2381            return False
2382        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2383
2384        self.log.info("Begin In Call SMS Test.")
2385        if not call_setup_teardown(
2386                self.log,
2387                ads[0],
2388                ads[1],
2389                ad_hangup=None,
2390                verify_caller_func=is_phone_in_call_iwlan,
2391                verify_callee_func=None):
2392            return False
2393
2394        return self._sms_test_mt(ads)
2395
2396    @test_tracker_info(uuid="a98a5a97-3864-4ff8-9085-995212eada20")
2397    @TelephonyBaseTest.tel_test_wrap
2398    def test_mms_mo_in_call_iwlan(self):
2399        """ Test MO MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2400
2401        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2402        Make sure PhoneA report iwlan as data rat.
2403        Make sure PhoneB is able to make/receive call/sms.
2404        Call from PhoneA to PhoneB, accept on PhoneB.
2405        Send MMS on PhoneA.
2406
2407        Returns:
2408            True if pass; False if fail.
2409        """
2410
2411        ads = self.android_devices
2412
2413        tasks = [(phone_setup_iwlan,
2414                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2415                   self.wifi_network_ssid, self.wifi_network_pass)),
2416                 (phone_setup_voice_general, (self.log, ads[1]))]
2417        if not multithread_func(self.log, tasks):
2418            self.log.error("Phone Failed to Set Up Properly.")
2419            return False
2420        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2421
2422        self.log.info("Begin In Call MMS Test.")
2423        if not call_setup_teardown(
2424                self.log,
2425                ads[0],
2426                ads[1],
2427                ad_hangup=None,
2428                verify_caller_func=is_phone_in_call_iwlan,
2429                verify_callee_func=None):
2430            return False
2431
2432        return self._mms_test_mo(ads)
2433
2434    @test_tracker_info(uuid="0464a87b-d45b-4b03-9895-17ece360a796")
2435    @TelephonyBaseTest.tel_test_wrap
2436    def test_mms_mt_in_call_iwlan(self):
2437        """ Test MT MMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode.
2438
2439        Make sure PhoneA APM, WiFi connected, WFC WiFi preferred mode.
2440        Make sure PhoneA report iwlan as data rat.
2441        Make sure PhoneB is able to make/receive call/sms.
2442        Call from PhoneA to PhoneB, accept on PhoneB.
2443        Receive MMS on PhoneA.
2444
2445        Returns:
2446            True if pass; False if fail.
2447        """
2448
2449        ads = self.android_devices
2450
2451        tasks = [(phone_setup_iwlan,
2452                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
2453                   self.wifi_network_ssid, self.wifi_network_pass)),
2454                 (phone_setup_voice_general, (self.log, ads[1]))]
2455        if not multithread_func(self.log, tasks):
2456            self.log.error("Phone Failed to Set Up Properly.")
2457            return False
2458        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2459
2460        self.log.info("Begin In Call MMS Test.")
2461        if not call_setup_teardown(
2462                self.log,
2463                ads[0],
2464                ads[1],
2465                ad_hangup=None,
2466                verify_caller_func=is_phone_in_call_iwlan,
2467                verify_callee_func=None):
2468            return False
2469
2470        return self._mms_test_mt(ads)
2471
2472    @test_tracker_info(uuid="9f1933bb-c4cb-4655-8655-327c1f38e8ee")
2473    @TelephonyBaseTest.tel_test_wrap
2474    def test_sms_mo_in_call_vt(self):
2475        """ Test MO SMS, Phone in ongoing VT call.
2476
2477        Make sure PhoneA and PhoneB in LTE and can make VT call.
2478        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2479        Send SMS on PhoneA.
2480
2481        Returns:
2482            True if pass; False if fail.
2483        """
2484        ads = self.android_devices
2485
2486        tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
2487                                                           (self.log, ads[1]))]
2488        if not multithread_func(self.log, tasks):
2489            self.log.error("Phone Failed to Set Up Properly.")
2490            return False
2491        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2492
2493        if not video_call_setup_teardown(
2494                self.log,
2495                ads[0],
2496                ads[1],
2497                None,
2498                video_state=VT_STATE_BIDIRECTIONAL,
2499                verify_caller_func=is_phone_in_call_video_bidirectional,
2500                verify_callee_func=is_phone_in_call_video_bidirectional):
2501            self.log.error("Failed to setup a call")
2502            return False
2503
2504        return self._sms_test_mo(ads)
2505
2506    @test_tracker_info(uuid="0a07e737-4862-4492-9b48-8d94799eab91")
2507    @TelephonyBaseTest.tel_test_wrap
2508    def test_sms_mt_in_call_vt(self):
2509        """ Test MT SMS, Phone in ongoing VT call.
2510
2511        Make sure PhoneA and PhoneB in LTE and can make VT call.
2512        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2513        Receive SMS on PhoneA.
2514
2515        Returns:
2516            True if pass; False if fail.
2517        """
2518        ads = self.android_devices
2519
2520        tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
2521                                                           (self.log, ads[1]))]
2522        if not multithread_func(self.log, tasks):
2523            self.log.error("Phone Failed to Set Up Properly.")
2524            return False
2525        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2526
2527        if not video_call_setup_teardown(
2528                self.log,
2529                ads[0],
2530                ads[1],
2531                None,
2532                video_state=VT_STATE_BIDIRECTIONAL,
2533                verify_caller_func=is_phone_in_call_video_bidirectional,
2534                verify_callee_func=is_phone_in_call_video_bidirectional):
2535            self.log.error("Failed to setup a call")
2536            return False
2537
2538        return self._sms_test_mt(ads)
2539
2540    @test_tracker_info(uuid="55d70548-6aee-40e9-b94d-d10de84fb50f")
2541    @TelephonyBaseTest.tel_test_wrap
2542    def test_mms_mo_in_call_vt(self):
2543        """ Test MO MMS, Phone in ongoing VT call.
2544
2545        Make sure PhoneA and PhoneB in LTE and can make VT call.
2546        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2547        Send MMS on PhoneA.
2548
2549        Returns:
2550            True if pass; False if fail.
2551        """
2552        ads = self.android_devices
2553
2554        tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
2555                                                           (self.log, ads[1]))]
2556        if not multithread_func(self.log, tasks):
2557            self.log.error("Phone Failed to Set Up Properly.")
2558            return False
2559        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2560
2561        if not video_call_setup_teardown(
2562                self.log,
2563                ads[0],
2564                ads[1],
2565                None,
2566                video_state=VT_STATE_BIDIRECTIONAL,
2567                verify_caller_func=is_phone_in_call_video_bidirectional,
2568                verify_callee_func=is_phone_in_call_video_bidirectional):
2569            self.log.error("Failed to setup a call")
2570            return False
2571
2572        return self._mms_test_mo(ads)
2573
2574    @test_tracker_info(uuid="75f97c9a-4397-42f1-bb00-8fc6d04fdf6d")
2575    @TelephonyBaseTest.tel_test_wrap
2576    def test_mms_mt_in_call_vt(self):
2577        """ Test MT MMS, Phone in ongoing VT call.
2578
2579        Make sure PhoneA and PhoneB in LTE and can make VT call.
2580        Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call.
2581        Receive MMS on PhoneA.
2582
2583        Returns:
2584            True if pass; False if fail.
2585        """
2586        ads = self.android_devices
2587
2588        tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
2589                                                           (self.log, ads[1]))]
2590        if not multithread_func(self.log, tasks):
2591            self.log.error("Phone Failed to Set Up Properly.")
2592            return False
2593        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2594
2595        if not video_call_setup_teardown(
2596                self.log,
2597                ads[0],
2598                ads[1],
2599                None,
2600                video_state=VT_STATE_BIDIRECTIONAL,
2601                verify_caller_func=is_phone_in_call_video_bidirectional,
2602                verify_callee_func=is_phone_in_call_video_bidirectional):
2603            self.log.error("Failed to setup a call")
2604            return False
2605
2606        return self._mms_test_mt(ads)
2607
2608    @test_tracker_info(uuid="2a72ecc6-702d-4add-a7a2-8c1001628bb6")
2609    @TelephonyBaseTest.tel_test_wrap
2610    def test_sms_mo_in_call_2g(self):
2611        """ Test MO SMS during a MO gsm call.
2612
2613        Make sure PhoneA is in gsm mode.
2614        Make sure PhoneB is able to make/receive call.
2615        Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA.
2616
2617        Returns:
2618            True if pass; False if fail.
2619        """
2620        ads = self.android_devices
2621        # Make sure PhoneA is GSM phone before proceed.
2622        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2623            raise signals.TestSkip("Not GSM phone, abort this GSM SMS test.")
2624
2625        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
2626                 (phone_setup_voice_general, (self.log, ads[1]))]
2627        if not multithread_func(self.log, tasks):
2628            self.log.error("Phone Failed to Set Up Properly.")
2629            return False
2630        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2631
2632        self.log.info("Begin In Call SMS Test.")
2633        if not call_setup_teardown(
2634                self.log,
2635                ads[0],
2636                ads[1],
2637                ad_hangup=None,
2638                verify_caller_func=is_phone_in_call_2g,
2639                verify_callee_func=None):
2640            return False
2641
2642        if not self._sms_test_mo(ads):
2643            self.log.error("SMS test fail.")
2644            return False
2645
2646        return True
2647
2648    @test_tracker_info(uuid="facd1814-8d69-42a2-9f80-b6a28cc0c9d2")
2649    @TelephonyBaseTest.tel_test_wrap
2650    def test_sms_mt_in_call_2g(self):
2651        """ Test MT SMS during a MO gsm call.
2652
2653        Make sure PhoneA is in gsm mode.
2654        Make sure PhoneB is able to make/receive call.
2655        Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA.
2656
2657        Returns:
2658            True if pass; False if fail.
2659        """
2660        ads = self.android_devices
2661        # Make sure PhoneA is GSM phone before proceed.
2662        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2663            raise signals.TestSkip("Not GSM phone, abort this GSM SMS test.")
2664
2665        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
2666                 (phone_setup_voice_general, (self.log, ads[1]))]
2667        if not multithread_func(self.log, tasks):
2668            self.log.error("Phone Failed to Set Up Properly.")
2669            return False
2670        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2671
2672        self.log.info("Begin In Call SMS Test.")
2673        if not call_setup_teardown(
2674                self.log,
2675                ads[0],
2676                ads[1],
2677                ad_hangup=None,
2678                verify_caller_func=is_phone_in_call_2g,
2679                verify_callee_func=None):
2680            return False
2681
2682        if not self._sms_test_mt(ads):
2683            self.log.error("SMS test fail.")
2684            return False
2685
2686        return True
2687
2688    @test_tracker_info(uuid="2bd94d69-3621-4b94-abc7-bd24c4325485")
2689    @TelephonyBaseTest.tel_test_wrap
2690    def test_mms_mo_in_call_2g(self):
2691        """ Test MO MMS during a MO gsm call.
2692
2693        Make sure PhoneA is in gsm mode.
2694        Make sure PhoneB is able to make/receive call.
2695        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
2696
2697        Returns:
2698            True if pass; False if fail.
2699        """
2700        ads = self.android_devices
2701        # Make sure PhoneA is GSM phone before proceed.
2702        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2703            raise signals.TestSkip("Not GSM phone, abort this GSM SMS test.")
2704
2705        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
2706                 (phone_setup_voice_general, (self.log, ads[1]))]
2707        if not multithread_func(self.log, tasks):
2708            self.log.error("Phone Failed to Set Up Properly.")
2709            return False
2710        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2711
2712        return self._mo_mms_in_2g_call(ads)
2713
2714    @test_tracker_info(uuid="e20be70d-99d6-4344-a742-f69581b66d8f")
2715    @TelephonyBaseTest.tel_test_wrap
2716    def test_mms_mt_in_call_2g(self):
2717        """ Test MT MMS during a MO gsm call.
2718
2719        Make sure PhoneA is in gsm mode.
2720        Make sure PhoneB is able to make/receive call.
2721        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
2722
2723        Returns:
2724            True if pass; False if fail.
2725        """
2726        ads = self.android_devices
2727        # Make sure PhoneA is GSM phone before proceed.
2728        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2729            raise signals.TestSkip("Not GSM phone, abort this GSM MMS test.")
2730
2731        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
2732                 (phone_setup_voice_general, (self.log, ads[1]))]
2733        if not multithread_func(self.log, tasks):
2734            self.log.error("Phone Failed to Set Up Properly.")
2735            return False
2736        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2737
2738        return self._mt_mms_in_2g_call(ads)
2739
2740    @test_tracker_info(uuid="3510d368-4b16-4716-92a3-9dd01842ba79")
2741    @TelephonyBaseTest.tel_test_wrap
2742    def test_mms_mo_in_call_2g_wifi(self):
2743        """ Test MO MMS during a MO gsm call.
2744
2745        Make sure PhoneA is in gsm mode with Wifi connected.
2746        Make sure PhoneB is able to make/receive call.
2747        Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA.
2748
2749        Returns:
2750            True if pass; False if fail.
2751        """
2752        ads = self.android_devices
2753        # Make sure PhoneA is GSM phone before proceed.
2754        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2755            raise signals.TestSkip("Not GSM phone, abort this GSM MMS test.")
2756
2757        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
2758                 (phone_setup_voice_general, (self.log, ads[1]))]
2759        if not multithread_func(self.log, tasks):
2760            self.log.error("Phone Failed to Set Up Properly.")
2761            return False
2762        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2763        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
2764                              self.wifi_network_pass)
2765
2766        return self._mo_mms_in_2g_call(ads)
2767
2768    @test_tracker_info(uuid="060def89-01bd-4b44-a49b-a4536fe39165")
2769    @TelephonyBaseTest.tel_test_wrap
2770    def test_mms_mt_in_call_2g_wifi(self):
2771        """ Test MT MMS during a MO gsm call.
2772
2773        Make sure PhoneA is in gsm mode with wifi connected.
2774        Make sure PhoneB is able to make/receive call.
2775        Call from PhoneA to PhoneB, accept on PhoneB, receive MMS on PhoneA.
2776
2777        Returns:
2778            True if pass; False if fail.
2779        """
2780        ads = self.android_devices
2781        # Make sure PhoneA is GSM phone before proceed.
2782        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2783            raise signals.TestSkip("Not GSM phone, abort this GSM MMS test.")
2784
2785        tasks = [(phone_setup_voice_2g, (self.log, ads[0])),
2786                 (phone_setup_voice_general, (self.log, ads[1]))]
2787        if not multithread_func(self.log, tasks):
2788            self.log.error("Phone Failed to Set Up Properly.")
2789            return False
2790        time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2791        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
2792                              self.wifi_network_pass)
2793
2794        return self._mt_mms_in_2g_call(ads)
2795
2796    @test_tracker_info(uuid="7de95a56-8055-4c0c-9438-f249403c6078")
2797    @TelephonyBaseTest.tel_test_wrap
2798    def test_sms_mo_general_after_mobile_data_usage_limit_reached(self):
2799        """Test SMS send after mobile data usage limit is reached.
2800
2801        Airplane mode is off.
2802        Set the data limit to the current usage
2803        Send SMS from PhoneA to PhoneB.
2804        Verify received message on PhoneB is correct.
2805
2806        Returns:
2807            True if success.
2808            False if failed.
2809        """
2810        ads = self.android_devices
2811        try:
2812            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2813            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2814            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2815
2816            tasks = [(phone_setup_voice_general, (self.log, ads[0])),
2817                     (phone_setup_voice_general, (self.log, ads[1]))]
2818            if not multithread_func(self.log, tasks):
2819                self.log.error("Phone Failed to Set Up Properly.")
2820                return False
2821            time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2822            return self._sms_test_mo(ads)
2823        finally:
2824            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2825
2826    @test_tracker_info(uuid="df56687f-0932-4b13-952c-ae0ce30b1d7a")
2827    @TelephonyBaseTest.tel_test_wrap
2828    def test_sms_mt_general_after_mobile_data_usage_limit_reached(self):
2829        """Test SMS receive after mobile data usage limit is reached.
2830
2831        Airplane mode is off.
2832        Set the data limit to the current usage
2833        Send SMS from PhoneB to PhoneA.
2834        Verify received message on PhoneA is correct.
2835
2836        Returns:
2837            True if success.
2838            False if failed.
2839        """
2840        ads = self.android_devices
2841        try:
2842            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2843            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2844            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2845
2846            tasks = [(phone_setup_voice_general, (self.log, ads[0])),
2847                     (phone_setup_voice_general, (self.log, ads[1]))]
2848            if not multithread_func(self.log, tasks):
2849                self.log.error("Phone Failed to Set Up Properly.")
2850                return False
2851            time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
2852            return self._sms_test_mt(ads)
2853        finally:
2854            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2855
2856    @test_tracker_info(uuid="131f98c6-3b56-44df-b5e7-66f33e2cf117")
2857    @TelephonyBaseTest.tel_test_wrap
2858    def test_mms_mo_general_after_mobile_data_usage_limit_reached(self):
2859        """Test MMS send after mobile data usage limit is reached.
2860
2861        Airplane mode is off.
2862        Set the data limit to the current usage
2863        Send MMS from PhoneA to PhoneB.
2864        Verify MMS cannot be send. (Can be send/receive for Verizon)
2865
2866        Returns:
2867            True if success.
2868            False if failed.
2869        """
2870        ads = self.android_devices
2871        expected_result = False
2872        if get_operator_name(self.log, ads[0]) in ["vzw", "Verizon"]:
2873            expected_result = True
2874        ads[0].log.info("Expected Result is %s", expected_result)
2875
2876        try:
2877            tasks = [(phone_setup_voice_general, (self.log, ads[0])),
2878                     (phone_setup_voice_general, (self.log, ads[1]))]
2879            if not multithread_func(self.log, tasks):
2880                self.log.error("Phone Failed to Set Up Properly.")
2881                return False
2882            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2883            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2884            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2885            log_msg = "expecting successful mms receive" if (
2886                expected_result) else "expecting mms receive failure"
2887            if not self._mms_test_mo(ads, expected_result=expected_result):
2888                ads[0].log.error("Mms test failed, %s", log_msg)
2889                return False
2890            else:
2891                ads[0].log.info("Mms test succeeded, %s", log_msg)
2892                return True
2893        finally:
2894            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2895
2896    @test_tracker_info(uuid="051e259f-0cb9-417d-9a68-8e8a4266fca1")
2897    @TelephonyBaseTest.tel_test_wrap
2898    def test_mms_mt_general_after_mobile_data_usage_limit_reached(self):
2899        """Test MMS receive after mobile data usage limit is reached.
2900
2901        Airplane mode is off.
2902        Set the data limit to the current usage
2903        Send MMS from PhoneB to PhoneA.
2904        Verify MMS cannot be received. (Can be send/receive for Verizon)
2905
2906        Returns:
2907            True if success.
2908            False if failed.
2909        """
2910        ads = self.android_devices
2911        expected_result = False
2912        if get_operator_name(self.log, ads[0]) in ["vzw", "Verizon"]:
2913            expected_result = True
2914        try:
2915            tasks = [(phone_setup_voice_general, (self.log, ads[0])),
2916                     (phone_setup_voice_general, (self.log, ads[1]))]
2917            if not multithread_func(self.log, tasks):
2918                self.log.error("Phone Failed to Set Up Properly.")
2919                return False
2920            subscriber_id = ads[0].droid.telephonyGetSubscriberId()
2921            data_usage = get_mobile_data_usage(ads[0], subscriber_id)
2922            set_mobile_data_usage_limit(ads[0], data_usage, subscriber_id)
2923            log_msg = "expecting successful mms receive" if (
2924                expected_result) else "expecting mms receive failure"
2925            if not self._mms_test_mt(ads, expected_result=expected_result):
2926                ads[0].log.error("Mms test failed, %s", log_msg)
2927                return False
2928            else:
2929                ads[0].log.info("Mms test succeeded, %s", log_msg)
2930                return True
2931        finally:
2932            remove_mobile_data_usage_limit(ads[0], subscriber_id)
2933