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 Live Network Telephony Conference Call
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 CALL_CAPABILITY_MANAGE_CONFERENCE
25from acts.test_utils.tel.tel_defines import CALL_CAPABILITY_MERGE_CONFERENCE
26from acts.test_utils.tel.tel_defines import CALL_CAPABILITY_SWAP_CONFERENCE
27from acts.test_utils.tel.tel_defines import CALL_PROPERTY_CONFERENCE
28from acts.test_utils.tel.tel_defines import CALL_STATE_ACTIVE
29from acts.test_utils.tel.tel_defines import CALL_STATE_HOLDING
30from acts.test_utils.tel.tel_defines import CAPABILITY_CONFERENCE
31from acts.test_utils.tel.tel_defines import PHONE_TYPE_CDMA
32from acts.test_utils.tel.tel_defines import PHONE_TYPE_GSM
33from acts.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL
34from acts.test_utils.tel.tel_defines import WFC_MODE_WIFI_ONLY
35from acts.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
36from acts.test_utils.tel.tel_subscription_utils import get_outgoing_voice_sub_id
37from acts.test_utils.tel.tel_test_utils import call_reject
38from acts.test_utils.tel.tel_test_utils import call_setup_teardown
39from acts.test_utils.tel.tel_test_utils import get_call_uri
40from acts.test_utils.tel.tel_test_utils import get_phone_number
41from acts.test_utils.tel.tel_test_utils import hangup_call
42from acts.test_utils.tel.tel_test_utils import is_uri_equivalent
43from acts.test_utils.tel.tel_test_utils import multithread_func
44from acts.test_utils.tel.tel_test_utils import num_active_calls
45from acts.test_utils.tel.tel_test_utils import verify_incall_state
46from acts.test_utils.tel.tel_test_utils import wait_and_answer_call
47from acts.test_utils.tel.tel_test_utils import get_capability_for_subscription
48from acts.test_utils.tel.tel_test_utils import ensure_phones_idle
49from acts.test_utils.tel.tel_voice_utils import get_cep_conference_call_id
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 is_phone_in_call_wcdma
57from acts.test_utils.tel.tel_voice_utils import phone_setup_3g
58from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_2g
59from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_3g
60from acts.test_utils.tel.tel_voice_utils import phone_setup_csfb
61from acts.test_utils.tel.tel_voice_utils import phone_setup_iwlan
62from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_general
63from acts.test_utils.tel.tel_voice_utils import phone_setup_volte
64from acts.test_utils.tel.tel_voice_utils import swap_calls
65from acts.test_utils.tel.tel_voice_utils import three_phone_call_forwarding_short_seq
66from acts.test_utils.tel.tel_voice_utils import three_phone_call_waiting_short_seq
67
68
69class TelLiveVoiceConfTest(TelephonyBaseTest):
70    def setup_class(self):
71        TelephonyBaseTest.setup_class(self)
72        if not get_capability_for_subscription(
73            self.android_devices[0],
74            CAPABILITY_CONFERENCE,
75            get_outgoing_voice_sub_id(self.android_devices[0])):
76            self.android_devices[0].log.error(
77                "Conference call is not supported, abort test.")
78            raise signals.TestAbortClass(
79                "Conference call is not supported, abort test.")
80
81    def teardown_test(self):
82        ensure_phones_idle(self.log, self.android_devices)
83
84    # Note: Currently Conference Call do not verify voice.
85    # So even if test cases passed, does not necessarily means
86    # conference call functionality is working.
87    # Need to add code to check for voice.
88    """ Private Test Utils """
89
90    def _get_expected_call_state(self, ad):
91        if "vzw" in [
92                sub["operator"]
93                for sub in ad.telephony["subscription"].values()
94        ]:
95            return CALL_STATE_ACTIVE
96        return CALL_STATE_HOLDING
97
98    def _hangup_call(self, ad, device_description='Device'):
99        if not hangup_call(self.log, ad):
100            ad.log.error("Failed to hang up on %s", device_description)
101            return False
102        return True
103
104    def _three_phone_call_mo_add_mo(self, ads, phone_setups, verify_funcs):
105        """Use 3 phones to make MO calls.
106
107        Call from PhoneA to PhoneB, accept on PhoneB.
108        Call from PhoneA to PhoneC, accept on PhoneC.
109
110        Args:
111            ads: list of ad object.
112                The list should have three objects.
113            phone_setups: list of phone setup functions.
114                The list should have three objects.
115            verify_funcs: list of phone call verify functions.
116                The list should have three objects.
117
118        Returns:
119            If success, return 'call_AB' id in PhoneA.
120            if fail, return None.
121        """
122
123        class _CallException(Exception):
124            pass
125
126        try:
127            verify_func_a, verify_func_b, verify_func_c = verify_funcs
128            tasks = []
129            for ad, setup_func in zip(ads, phone_setups):
130                if setup_func is not None:
131                    tasks.append((setup_func, (self.log, ad)))
132            if tasks != [] and not multithread_func(self.log, tasks):
133                self.log.error("Phone Failed to Set Up Properly.")
134                raise _CallException("Setup failed.")
135            for ad in ads:
136                ad.droid.telecomCallClearCallList()
137                if num_active_calls(self.log, ad) != 0:
138                    ad.log.error("Phone Call List is not empty.")
139                    raise _CallException("Clear call list failed.")
140
141            self.log.info("Step1: Call From PhoneA to PhoneB.")
142            if not call_setup_teardown(
143                    self.log,
144                    ads[0],
145                    ads[1],
146                    ad_hangup=None,
147                    verify_caller_func=verify_func_a,
148                    verify_callee_func=verify_func_b):
149                raise _CallException("PhoneA call PhoneB failed.")
150
151            calls = ads[0].droid.telecomCallGetCallIds()
152            ads[0].log.info("Calls in PhoneA %s", calls)
153            if num_active_calls(self.log, ads[0]) != 1:
154                raise _CallException("Call list verify failed.")
155            call_ab_id = calls[0]
156
157            self.log.info("Step2: Call From PhoneA to PhoneC.")
158            if not call_setup_teardown(
159                    self.log,
160                    ads[0],
161                    ads[2],
162                    ad_hangup=None,
163                    verify_caller_func=verify_func_a,
164                    verify_callee_func=verify_func_c):
165                raise _CallException("PhoneA call PhoneC failed.")
166            if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]],
167                                       True):
168                raise _CallException("Not All phones are in-call.")
169
170        except _CallException:
171            return None
172
173        return call_ab_id
174
175    def _three_phone_call_mo_add_mt(self, ads, phone_setups, verify_funcs):
176        """Use 3 phones to make MO call and MT call.
177
178        Call from PhoneA to PhoneB, accept on PhoneB.
179        Call from PhoneC to PhoneA, accept on PhoneA.
180
181        Args:
182            ads: list of ad object.
183                The list should have three objects.
184            phone_setups: list of phone setup functions.
185                The list should have three objects.
186            verify_funcs: list of phone call verify functions.
187                The list should have three objects.
188
189        Returns:
190            If success, return 'call_AB' id in PhoneA.
191            if fail, return None.
192        """
193
194        class _CallException(Exception):
195            pass
196
197        try:
198            verify_func_a, verify_func_b, verify_func_c = verify_funcs
199            tasks = []
200            for ad, setup_func in zip(ads, phone_setups):
201                if setup_func is not None:
202                    tasks.append((setup_func, (self.log, ad)))
203            if tasks != [] and not multithread_func(self.log, tasks):
204                self.log.error("Phone Failed to Set Up Properly.")
205                raise _CallException("Setup failed.")
206            for ad in ads:
207                ad.droid.telecomCallClearCallList()
208                if num_active_calls(self.log, ad) != 0:
209                    ad.log.error("Phone Call List is not empty.")
210                    raise _CallException("Clear call list failed.")
211
212            self.log.info("Step1: Call From PhoneA to PhoneB.")
213            if not call_setup_teardown(
214                    self.log,
215                    ads[0],
216                    ads[1],
217                    ad_hangup=None,
218                    verify_caller_func=verify_func_a,
219                    verify_callee_func=verify_func_b):
220                raise _CallException("PhoneA call PhoneB failed.")
221
222            calls = ads[0].droid.telecomCallGetCallIds()
223            ads[0].log.info("Calls in PhoneA %s", calls)
224            if num_active_calls(self.log, ads[0]) != 1:
225                raise _CallException("Call list verify failed.")
226            call_ab_id = calls[0]
227
228            self.log.info("Step2: Call From PhoneC to PhoneA.")
229            if not call_setup_teardown(
230                    self.log,
231                    ads[2],
232                    ads[0],
233                    ad_hangup=None,
234                    verify_caller_func=verify_func_c,
235                    verify_callee_func=verify_func_a):
236                raise _CallException("PhoneA call PhoneC failed.")
237            if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]],
238                                       True):
239                raise _CallException("Not All phones are in-call.")
240
241        except _CallException:
242            return None
243
244        return call_ab_id
245
246    def _three_phone_call_mo_add_mt_reject(self, ads, verify_funcs, reject):
247        """Use 3 phones to make MO call and MT call.
248
249        Call from PhoneA to PhoneB, accept on PhoneB.
250        Call from PhoneC to PhoneA. PhoneA receive incoming call.
251            if reject is True, then reject the call on PhoneA.
252            if reject if False, then just ignore the incoming call on PhoneA.
253
254        Args:
255            ads: list of ad object.
256                The list should have three objects.
257            verify_funcs: list of phone call verify functions for
258                PhoneA and PhoneB. The list should have two objects.
259
260        Returns:
261            True if no error happened.
262        """
263
264        class _CallException(Exception):
265            pass
266
267        try:
268            verify_func_a, verify_func_b = verify_funcs
269            self.log.info("Step1: Call From PhoneA to PhoneB.")
270            if not call_setup_teardown(
271                    self.log,
272                    ads[0],
273                    ads[1],
274                    ad_hangup=None,
275                    verify_caller_func=verify_func_a,
276                    verify_callee_func=verify_func_b):
277                raise _CallException("PhoneA call PhoneB failed.")
278
279            self.log.info("Step2: Call From PhoneC to PhoneA then decline.")
280            if not call_reject(self.log, ads[2], ads[0], reject):
281                raise _CallException("PhoneC call PhoneA then decline failed.")
282            time.sleep(WAIT_TIME_IN_CALL)
283            if not verify_incall_state(self.log, [ads[0], ads[1]], True):
284                raise _CallException("PhoneA and PhoneB are not in call.")
285
286        except _CallException:
287            return False
288
289        return True
290
291    def _three_phone_call_mt_add_mt(self, ads, phone_setups, verify_funcs):
292        """Use 3 phones to make MT call and MT call.
293
294        Call from PhoneB to PhoneA, accept on PhoneA.
295        Call from PhoneC to PhoneA, accept on PhoneA.
296
297        Args:
298            ads: list of ad object.
299                The list should have three objects.
300            phone_setups: list of phone setup functions.
301                The list should have three objects.
302            verify_funcs: list of phone call verify functions.
303                The list should have three objects.
304
305        Returns:
306            If success, return 'call_AB' id in PhoneA.
307            if fail, return None.
308        """
309
310        class _CallException(Exception):
311            pass
312
313        try:
314            verify_func_a, verify_func_b, verify_func_c = verify_funcs
315            tasks = []
316            for ad, setup_func in zip(ads, phone_setups):
317                if setup_func is not None:
318                    tasks.append((setup_func, (self.log, ad)))
319            if tasks != [] and not multithread_func(self.log, tasks):
320                self.log.error("Phone Failed to Set Up Properly.")
321                raise _CallException("Setup failed.")
322            for ad in ads:
323                ad.droid.telecomCallClearCallList()
324                if num_active_calls(self.log, ad) != 0:
325                    ad.log.error("Phone Call List is not empty.")
326                    raise _CallException("Clear call list failed.")
327
328            self.log.info("Step1: Call From PhoneB to PhoneA.")
329            if not call_setup_teardown(
330                    self.log,
331                    ads[1],
332                    ads[0],
333                    ad_hangup=None,
334                    verify_caller_func=verify_func_b,
335                    verify_callee_func=verify_func_a):
336                raise _CallException("PhoneB call PhoneA failed.")
337
338            calls = ads[0].droid.telecomCallGetCallIds()
339            ads[0].log.info("Calls in PhoneA %s", calls)
340            if num_active_calls(self.log, ads[0]) != 1:
341                raise _CallException("Call list verify failed.")
342            call_ab_id = calls[0]
343
344            self.log.info("Step2: Call From PhoneC to PhoneA.")
345            if not call_setup_teardown(
346                    self.log,
347                    ads[2],
348                    ads[0],
349                    ad_hangup=None,
350                    verify_caller_func=verify_func_c,
351                    verify_callee_func=verify_func_a):
352                raise _CallException("PhoneA call PhoneC failed.")
353            if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]],
354                                       True):
355                raise _CallException("Not All phones are in-call.")
356
357        except _CallException:
358            return None
359
360        return call_ab_id
361
362    def _test_1x_mo_mo_add(self):
363        """Test multi call feature in 1x call.
364
365        PhoneA (1x) call PhoneB, accept on PhoneB.
366        PhoneA (1x) call PhoneC, accept on PhoneC.
367
368        Returns:
369            call_ab_id, call_ac_id, call_conf_id if succeed;
370            None, None, None if failed.
371
372        """
373        ads = self.android_devices
374
375        # make sure PhoneA is CDMA phone before proceed.
376        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
377            ads[0].log.error("not CDMA phone, abort this 1x test.")
378            return None, None, None
379
380        call_ab_id = self._three_phone_call_mo_add_mo(
381            [ads[0], ads[1], ads[2]], [
382                phone_setup_voice_3g, phone_setup_voice_general,
383                phone_setup_voice_general
384            ], [is_phone_in_call_1x, None, None])
385        if call_ab_id is None:
386            self.log.error("Failed to get call_ab_id")
387            return None, None, None
388
389        calls = ads[0].droid.telecomCallGetCallIds()
390        ads[0].log.info("Calls in PhoneA %s", calls)
391        if num_active_calls(self.log, ads[0]) != 3:
392            return None, None, None
393        for call_id in calls:
394            if (CALL_CAPABILITY_MERGE_CONFERENCE in ads[0]
395                    .droid.telecomCallGetCapabilities(call_id)):
396                call_conf_id = call_id
397            elif call_id != call_ab_id:
398                call_ac_id = call_id
399
400        return call_ab_id, call_ac_id, call_conf_id
401
402    def _test_1x_mo_mt_add_swap_x(self, num_swaps):
403        """Test multi call feature in 1x call.
404
405        PhoneA (1x) call PhoneB, accept on PhoneB.
406        PhoneC call PhoneA (1x), accept on PhoneA.
407        Swap active call on PhoneA.(N times)
408
409        Returns:
410            call_ab_id, call_ac_id, call_conf_id if succeed;
411            None, None, None if failed.
412
413        """
414        ads = self.android_devices
415
416        # make sure PhoneA is CDMA phone before proceed.
417        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
418            ads[0].log.error("not CDMA phone, abort this 1x test.")
419            return None, None, None
420
421        call_ab_id = self._three_phone_call_mo_add_mt(
422            [ads[0], ads[1], ads[2]], [
423                phone_setup_voice_3g, phone_setup_voice_general,
424                phone_setup_voice_general
425            ], [is_phone_in_call_1x, None, None])
426        if call_ab_id is None:
427            self.log.error("Failed to get call_ab_id")
428            return None, None, None
429
430        call_conf_id = None
431        calls = ads[0].droid.telecomCallGetCallIds()
432        ads[0].log.info("Calls in PhoneA %s", calls)
433        if num_active_calls(self.log, ads[0]) != 3:
434            return None, None, None
435        for call_id in calls:
436            if (CALL_CAPABILITY_SWAP_CONFERENCE in ads[0]
437                    .droid.telecomCallGetCapabilities(call_id)):
438                call_conf_id = call_id
439            elif call_id != call_ab_id:
440                call_ac_id = call_id
441
442        if num_swaps > 0:
443            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
444            if not swap_calls(
445                    self.log,
446                    ads,
447                    call_ab_id,
448                    call_ac_id,
449                    num_swaps,
450                    check_call_status=False):
451                self.log.error("Swap test failed.")
452                return None, None, None
453
454        return call_ab_id, call_ac_id, call_conf_id
455
456    def _test_1x_mt_mt_add_swap_x(self, num_swaps):
457        """Test multi call feature in 1x call.
458
459        PhoneB call PhoneA (1x), accept on PhoneA.
460        PhoneC call PhoneA (1x), accept on PhoneA.
461        Swap active call on PhoneA.(N times)
462
463        Returns:
464            call_ab_id, call_ac_id, call_conf_id if succeed;
465            None, None, None if failed.
466
467        """
468        ads = self.android_devices
469
470        # make sure PhoneA is CDMA phone before proceed.
471        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
472            ads[0].log.error("not CDMA phone, abort this 1x test.")
473            return None, None, None
474
475        call_ab_id = self._three_phone_call_mt_add_mt(
476            [ads[0], ads[1], ads[2]], [
477                phone_setup_voice_3g, phone_setup_voice_general,
478                phone_setup_voice_general
479            ], [is_phone_in_call_1x, None, None])
480        if call_ab_id is None:
481            self.log.error("Failed to get call_ab_id")
482            return None, None, None
483
484        call_conf_id = None
485        calls = ads[0].droid.telecomCallGetCallIds()
486        ads[0].log.info("Calls in PhoneA %s", calls)
487        if num_active_calls(self.log, ads[0]) != 3:
488            return None, None, None
489        for call_id in calls:
490            if (CALL_CAPABILITY_SWAP_CONFERENCE in ads[0]
491                    .droid.telecomCallGetCapabilities(call_id)):
492                call_conf_id = call_id
493            elif call_id != call_ab_id:
494                call_ac_id = call_id
495
496        if num_swaps > 0:
497            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
498            if not swap_calls(
499                    self.log,
500                    ads,
501                    call_ab_id,
502                    call_ac_id,
503                    num_swaps,
504                    check_call_status=False):
505                self.log.error("Swap test failed.")
506                return None, None, None
507
508        return call_ab_id, call_ac_id, call_conf_id
509
510    def _test_1x_multi_call_drop_from_participant(self, host, first_drop_ad,
511                                                  second_drop_ad):
512        """Test private function to drop call from participant in 1x multi call.
513
514        Host(1x) is in multi call scenario with first_drop_ad and second_drop_ad.
515        Drop call on first_drop_ad.
516        Verify call continues between host and second_drop_ad.
517        Drop call on second_drop_ad and verify host also ends.
518
519        Args:
520            host: android device object for multi-call/conference-call host.
521            first_drop_ad: android device object for call participant, end call
522                on this participant first.
523            second_drop_ad: android device object for call participant, end call
524                on this participant second.
525
526        Returns:
527            True if no error happened. Otherwise False.
528        """
529        self.log.info("Drop 1st call.")
530        if not self._hangup_call(first_drop_ad):
531            return False
532        time.sleep(WAIT_TIME_IN_CALL)
533        calls = host.droid.telecomCallGetCallIds()
534        host.log.info("Calls list: %s", calls)
535        if num_active_calls(self.log, host) != 3:
536            return False
537        if not verify_incall_state(self.log, [host, second_drop_ad], True):
538            return False
539        if not verify_incall_state(self.log, [first_drop_ad], False):
540            return False
541
542        self.log.info("Drop 2nd call.")
543        if not self._hangup_call(second_drop_ad):
544            return False
545        time.sleep(WAIT_TIME_IN_CALL)
546        if not verify_incall_state(
547                self.log, [host, second_drop_ad, first_drop_ad], False):
548            return False
549        return True
550
551    def _test_1x_multi_call_drop_from_host(self, host, active_participant_ad,
552                                           held_participant_ad):
553        """Test private function to drop call from host in 1x multi call.
554
555        Host(1x) is in multi call scenario with first_drop_ad and second_drop_ad.
556        Drop call on host. Then active_participant_ad should ends as well.
557        Host should receive a call back from held_participant_ad. Answer on host.
558        Drop call on host. Then verify held_participant_ad ends as well.
559
560        Args:
561            host: android device object for multi-call/conference-call host.
562            active_participant_ad: android device object for the current active
563                call participant.
564            held_participant_ad: android device object for the current held
565                call participant.
566
567        Returns:
568            True if no error happened. Otherwise False.
569        """
570        self.log.info("Drop current call on Host.")
571        if not self._hangup_call(host, "Host"):
572            return False
573        if not wait_and_answer_call(self.log, host,
574                                    get_phone_number(self.log,
575                                                     held_participant_ad)):
576            self.log.error("Did not receive call back.")
577            return False
578        time.sleep(WAIT_TIME_IN_CALL)
579        if not verify_incall_state(self.log, [host, held_participant_ad],
580                                   True):
581            return False
582        if not verify_incall_state(self.log, [active_participant_ad], False):
583            return False
584
585        self.log.info("Drop current call on Host.")
586        if not self._hangup_call(host, "Host"):
587            return False
588        time.sleep(WAIT_TIME_IN_CALL)
589        if not verify_incall_state(
590                self.log, [host, held_participant_ad, active_participant_ad],
591                False):
592            return False
593        return True
594
595    def _test_1x_conf_call_drop_from_host(self, host, participant_list):
596        """Test private function to drop call from host in 1x conference call.
597
598        Host(1x) is in conference call scenario with phones in participant_list.
599        End call on host. Then all phones in participant_list should end call.
600
601        Args:
602            host: android device object for multi-call/conference-call host.
603            participant_list: android device objects list for all other
604                participants in multi-call/conference-call.
605
606        Returns:
607            True if no error happened. Otherwise False.
608        """
609        self.log.info("Drop conference call on Host.")
610        if not self._hangup_call(host, "Host"):
611            return False
612        time.sleep(WAIT_TIME_IN_CALL)
613        if not verify_incall_state(self.log, [host], False):
614            return False
615        if not verify_incall_state(self.log, participant_list, False):
616            return False
617        return True
618
619    def _test_1x_merge_conference(self, host, participant_list, call_conf_id):
620        """Test private function to merge to conference in 1x multi call scenario.
621
622        Host(1x) is in multi call scenario with phones in participant_list.
623        Merge to conference on host.
624        Verify merge succeed.
625
626        Args:
627            host: android device object for multi-call/conference-call host.
628            participant_list: android device objects list for all other
629                participants in multi-call/conference-call.
630            call_conf_id: conference call id in host android device object.
631
632        Returns:
633            True if no error happened. Otherwise False.
634        """
635        host.droid.telecomCallMergeToConf(call_conf_id)
636        time.sleep(WAIT_TIME_IN_CALL)
637        calls = host.droid.telecomCallGetCallIds()
638        host.log.info("Calls in Phone %s", calls)
639        if num_active_calls(self.log, host) != 3:
640            return False
641        if not verify_incall_state(self.log, [host], True):
642            return False
643        if not verify_incall_state(self.log, participant_list, True):
644            return False
645        if (CALL_CAPABILITY_MERGE_CONFERENCE in
646                host.droid.telecomCallGetCapabilities(call_conf_id)):
647            self.log.error("Merge conference failed.")
648            return False
649        return True
650
651    def _test_volte_mo_mo_add_volte_swap_x(self, num_swaps):
652        """Test swap feature in VoLTE call.
653
654        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
655        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
656        Swap active call on PhoneA.(N times)
657
658        Args:
659            num_swaps: do swap for 'num_swaps' times.
660                This value can be 0 (no swap operation).
661
662        Returns:
663            call_ab_id, call_ac_id if succeed;
664            None, None if failed.
665
666        """
667        ads = self.android_devices
668
669        call_ab_id = self._three_phone_call_mo_add_mo(
670            [ads[0], ads[1], ads[2]],
671            [phone_setup_volte, phone_setup_volte, phone_setup_volte], [
672                is_phone_in_call_volte, is_phone_in_call_volte,
673                is_phone_in_call_volte
674            ])
675        if call_ab_id is None:
676            self.log.error("Failed to get call_ab_id")
677            return None, None
678
679        calls = ads[0].droid.telecomCallGetCallIds()
680        ads[0].log.info("Calls in PhoneA %s", calls)
681        if num_active_calls(self.log, ads[0]) != 2:
682            return None, None
683        if calls[0] == call_ab_id:
684            call_ac_id = calls[1]
685        else:
686            call_ac_id = calls[0]
687
688        if num_swaps > 0:
689            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
690            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
691                              num_swaps):
692                self.log.error("Swap test failed.")
693                return None, None
694
695        return call_ab_id, call_ac_id
696
697    def _test_volte_mo_mt_add_volte_swap_x(self, num_swaps):
698        """Test swap feature in VoLTE call.
699
700        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
701        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
702        Swap active call on PhoneA. (N times)
703
704        Args:
705            num_swaps: do swap for 'num_swaps' times.
706                This value can be 0 (no swap operation).
707
708        Returns:
709            call_ab_id, call_ac_id if succeed;
710            None, None if failed.
711
712        """
713        ads = self.android_devices
714
715        call_ab_id = self._three_phone_call_mo_add_mt(
716            [ads[0], ads[1], ads[2]],
717            [phone_setup_volte, phone_setup_volte, phone_setup_volte], [
718                is_phone_in_call_volte, is_phone_in_call_volte,
719                is_phone_in_call_volte
720            ])
721        if call_ab_id is None:
722            self.log.error("Failed to get call_ab_id")
723            return None, None
724
725        calls = ads[0].droid.telecomCallGetCallIds()
726        ads[0].log.info("Calls in PhoneA %s", calls)
727        if num_active_calls(self.log, ads[0]) != 2:
728            return None, None
729        if calls[0] == call_ab_id:
730            call_ac_id = calls[1]
731        else:
732            call_ac_id = calls[0]
733
734        if num_swaps > 0:
735            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
736            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
737                              num_swaps):
738                self.log.error("Swap test failed.")
739                return None, None
740
741        return call_ab_id, call_ac_id
742
743    def _test_volte_mt_mt_add_volte_swap_x(self, num_swaps):
744        """Test swap feature in VoLTE call.
745
746        PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
747        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
748        Swap active call on PhoneA. (N times)
749
750        Args:
751            num_swaps: do swap for 'num_swaps' times.
752                This value can be 0 (no swap operation).
753
754        Returns:
755            call_ab_id, call_ac_id if succeed;
756            None, None if failed.
757
758        """
759        ads = self.android_devices
760
761        call_ab_id = self._three_phone_call_mt_add_mt(
762            [ads[0], ads[1], ads[2]],
763            [phone_setup_volte, phone_setup_volte, phone_setup_volte], [
764                is_phone_in_call_volte, is_phone_in_call_volte,
765                is_phone_in_call_volte
766            ])
767        if call_ab_id is None:
768            self.log.error("Failed to get call_ab_id")
769            return None, None
770
771        calls = ads[0].droid.telecomCallGetCallIds()
772        ads[0].log.info("Calls in PhoneA %s", calls)
773        if num_active_calls(self.log, ads[0]) != 2:
774            return None, None
775        if calls[0] == call_ab_id:
776            call_ac_id = calls[1]
777        else:
778            call_ac_id = calls[0]
779
780        if num_swaps > 0:
781            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
782            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
783                              num_swaps):
784                self.log.error("Swap test failed.")
785                return None, None
786
787        return call_ab_id, call_ac_id
788
789    def _test_volte_mo_mo_add_wcdma_swap_x(self, num_swaps):
790        """Test swap feature in VoLTE call.
791
792        PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
793        PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
794        Swap active call on PhoneA.(N times)
795
796        Args:
797            num_swaps: do swap for 'num_swaps' times.
798                This value can be 0 (no swap operation).
799
800        Returns:
801            call_ab_id, call_ac_id if succeed;
802            None, None if failed.
803
804        """
805        ads = self.android_devices
806
807        # make sure PhoneB and PhoneC are GSM phone before proceed.
808        for ad in [ads[1], ads[2]]:
809            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
810                ad.log.error("not GSM phone, abort wcdma swap test.")
811                return None, None
812
813        call_ab_id = self._three_phone_call_mo_add_mo(
814            [ads[0], ads[1], ads[2]],
815            [phone_setup_volte, phone_setup_voice_3g, phone_setup_voice_3g], [
816                is_phone_in_call_volte, is_phone_in_call_wcdma,
817                is_phone_in_call_wcdma
818            ])
819        if call_ab_id is None:
820            self.log.error("Failed to get call_ab_id")
821            return None, None
822
823        calls = ads[0].droid.telecomCallGetCallIds()
824        ads[0].log.info("Calls in PhoneA %s", calls)
825        if num_active_calls(self.log, ads[0]) != 2:
826            return None, None
827        if calls[0] == call_ab_id:
828            call_ac_id = calls[1]
829        else:
830            call_ac_id = calls[0]
831
832        if num_swaps > 0:
833            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
834            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
835                              num_swaps):
836                self.log.error("Swap test failed.")
837                return None, None
838
839        return call_ab_id, call_ac_id
840
841    def _test_volte_mo_mt_add_wcdma_swap_x(self, num_swaps):
842        """Test swap feature in VoLTE call.
843
844        PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
845        PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
846        Swap active call on PhoneA.(N times)
847
848        Args:
849            num_swaps: do swap for 'num_swaps' times.
850                This value can be 0 (no swap operation).
851
852        Returns:
853            call_ab_id, call_ac_id if succeed;
854            None, None if failed.
855
856        """
857        ads = self.android_devices
858
859        # make sure PhoneB and PhoneC are GSM phone before proceed.
860        for ad in [ads[1], ads[2]]:
861            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
862                ad.log.error("not GSM phone, abort wcdma swap test.")
863                return None, None
864
865        call_ab_id = self._three_phone_call_mo_add_mt(
866            [ads[0], ads[1], ads[2]],
867            [phone_setup_volte, phone_setup_voice_3g, phone_setup_voice_3g], [
868                is_phone_in_call_volte, is_phone_in_call_wcdma,
869                is_phone_in_call_wcdma
870            ])
871        if call_ab_id is None:
872            self.log.error("Failed to get call_ab_id")
873            return None, None
874
875        calls = ads[0].droid.telecomCallGetCallIds()
876        ads[0].log.info("Calls in PhoneA %s", calls)
877        if num_active_calls(self.log, ads[0]) != 2:
878            return None, None
879        if calls[0] == call_ab_id:
880            call_ac_id = calls[1]
881        else:
882            call_ac_id = calls[0]
883
884        if num_swaps > 0:
885            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
886            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
887                              num_swaps):
888                self.log.error("Swap test failed.")
889                return None, None
890
891        return call_ab_id, call_ac_id
892
893    def _test_volte_mt_mt_add_wcdma_swap_x(self, num_swaps):
894        """Test swap feature in VoLTE call.
895
896        PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
897        PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
898        Swap active call on PhoneA.(N times)
899
900        Args:
901            num_swaps: do swap for 'num_swaps' times.
902                This value can be 0 (no swap operation).
903
904        Returns:
905            call_ab_id, call_ac_id if succeed;
906            None, None if failed.
907
908        """
909        ads = self.android_devices
910
911        # make sure PhoneB and PhoneC are GSM phone before proceed.
912        for ad in [ads[1], ads[2]]:
913            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
914                ad.log.error("not GSM phone, abort wcdma swap test.")
915                return None, None
916
917        call_ab_id = self._three_phone_call_mt_add_mt(
918            [ads[0], ads[1], ads[2]],
919            [phone_setup_volte, phone_setup_voice_3g, phone_setup_voice_3g], [
920                is_phone_in_call_volte, is_phone_in_call_wcdma,
921                is_phone_in_call_wcdma
922            ])
923        if call_ab_id is None:
924            self.log.error("Failed to get call_ab_id")
925            return None, None
926
927        calls = ads[0].droid.telecomCallGetCallIds()
928        ads[0].log.info("Calls in PhoneA %s", calls)
929        if num_active_calls(self.log, ads[0]) != 2:
930            return None, None
931        if calls[0] == call_ab_id:
932            call_ac_id = calls[1]
933        else:
934            call_ac_id = calls[0]
935
936        if num_swaps > 0:
937            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
938            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
939                              num_swaps):
940                self.log.error("Swap test failed.")
941                return None, None
942
943        return call_ab_id, call_ac_id
944
945    def _test_volte_mo_mo_add_1x_swap_x(self, num_swaps):
946        """Test swap feature in VoLTE call.
947
948        PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
949        PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
950        Swap active call on PhoneA.(N times)
951
952        Args:
953            num_swaps: do swap for 'num_swaps' times.
954                This value can be 0 (no swap operation).
955
956        Returns:
957            call_ab_id, call_ac_id if succeed;
958            None, None if failed.
959
960        """
961        ads = self.android_devices
962
963        # make sure PhoneB and PhoneC are CDMA phone before proceed.
964        for ad in [ads[1], ads[2]]:
965            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
966                ad.log.error("not CDMA phone, abort 1x swap test.")
967                return None, None
968
969        call_ab_id = self._three_phone_call_mo_add_mo(
970            [ads[0], ads[1], ads[2]],
971            [phone_setup_volte, phone_setup_voice_3g, phone_setup_voice_3g],
972            [is_phone_in_call_volte, is_phone_in_call_1x, is_phone_in_call_1x])
973        if call_ab_id is None:
974            self.log.error("Failed to get call_ab_id")
975            return None, None
976
977        calls = ads[0].droid.telecomCallGetCallIds()
978        ads[0].log.info("Calls in PhoneA %s", calls)
979        if num_active_calls(self.log, ads[0]) != 2:
980            return None, None
981        if calls[0] == call_ab_id:
982            call_ac_id = calls[1]
983        else:
984            call_ac_id = calls[0]
985
986        if num_swaps > 0:
987            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
988            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
989                              num_swaps):
990                self.log.error("Swap test failed.")
991                return None, None
992
993        return call_ab_id, call_ac_id
994
995    def _test_volte_mo_mt_add_1x_swap_x(self, num_swaps):
996        """Test swap feature in VoLTE call.
997
998        PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
999        PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
1000        Swap active call on PhoneA.(N times)
1001
1002        Args:
1003            num_swaps: do swap for 'num_swaps' times.
1004                This value can be 0 (no swap operation).
1005
1006        Returns:
1007            call_ab_id, call_ac_id if succeed;
1008            None, None if failed.
1009
1010        """
1011        ads = self.android_devices
1012
1013        # make sure PhoneB and PhoneC are CDMA phone before proceed.
1014        for ad in [ads[1], ads[2]]:
1015            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
1016                ad.log.error("not CDMA phone, abort 1x swap test.")
1017                return None, None
1018
1019        call_ab_id = self._three_phone_call_mo_add_mt(
1020            [ads[0], ads[1], ads[2]],
1021            [phone_setup_volte, phone_setup_voice_3g, phone_setup_voice_3g],
1022            [is_phone_in_call_volte, is_phone_in_call_1x, is_phone_in_call_1x])
1023        if call_ab_id is None:
1024            self.log.error("Failed to get call_ab_id")
1025            return None, None
1026
1027        calls = ads[0].droid.telecomCallGetCallIds()
1028        ads[0].log.info("Calls in PhoneA %s", calls)
1029        if num_active_calls(self.log, ads[0]) != 2:
1030            return None, None
1031        if calls[0] == call_ab_id:
1032            call_ac_id = calls[1]
1033        else:
1034            call_ac_id = calls[0]
1035
1036        if num_swaps > 0:
1037            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1038            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1039                              num_swaps):
1040                self.log.error("Swap test failed.")
1041                return None, None
1042
1043        return call_ab_id, call_ac_id
1044
1045    def _test_volte_mt_mt_add_1x_swap_x(self, num_swaps):
1046        """Test swap feature in VoLTE call.
1047
1048        PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
1049        PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
1050        Swap active call on PhoneA.(N times)
1051
1052        Args:
1053            num_swaps: do swap for 'num_swaps' times.
1054                This value can be 0 (no swap operation).
1055
1056        Returns:
1057            call_ab_id, call_ac_id if succeed;
1058            None, None if failed.
1059
1060        """
1061        ads = self.android_devices
1062
1063        # make sure PhoneB and PhoneC are CDMA phone before proceed.
1064        for ad in [ads[1], ads[2]]:
1065            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
1066                self.log.error("not CDMA phone, abort 1x swap test.")
1067                return None, None
1068
1069        call_ab_id = self._three_phone_call_mt_add_mt(
1070            [ads[0], ads[1], ads[2]],
1071            [phone_setup_volte, phone_setup_voice_3g, phone_setup_voice_3g],
1072            [is_phone_in_call_volte, is_phone_in_call_1x, is_phone_in_call_1x])
1073        if call_ab_id is None:
1074            self.log.error("Failed to get call_ab_id")
1075            return None, None
1076
1077        calls = ads[0].droid.telecomCallGetCallIds()
1078        ads[0].log.info("Calls in PhoneA %s", calls)
1079        if num_active_calls(self.log, ads[0]) != 2:
1080            return None, None
1081        if calls[0] == call_ab_id:
1082            call_ac_id = calls[1]
1083        else:
1084            call_ac_id = calls[0]
1085
1086        if num_swaps > 0:
1087            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1088            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1089                              num_swaps):
1090                self.log.error("Swap test failed.")
1091                return None, None
1092
1093        return call_ab_id, call_ac_id
1094
1095    def _test_wcdma_mo_mo_add_swap_x(self, num_swaps):
1096        """Test swap feature in WCDMA call.
1097
1098        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
1099        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
1100        Swap active call on PhoneA. (N times)
1101
1102        Args:
1103            num_swaps: do swap for 'num_swaps' times.
1104                This value can be 0 (no swap operation).
1105
1106        Returns:
1107            call_ab_id, call_ac_id if succeed;
1108            None, None if failed.
1109
1110        """
1111        ads = self.android_devices
1112
1113        # make sure PhoneA is GSM phone before proceed.
1114        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
1115            ad.log.error("not GSM phone, abort wcdma swap test.")
1116            return None, None
1117
1118        call_ab_id = self._three_phone_call_mo_add_mo(
1119            [ads[0], ads[1], ads[2]], [
1120                phone_setup_voice_3g, phone_setup_voice_general,
1121                phone_setup_voice_general
1122            ], [is_phone_in_call_3g, None, None])
1123        if call_ab_id is None:
1124            self.log.error("Failed to get call_ab_id")
1125            return None, None
1126
1127        calls = ads[0].droid.telecomCallGetCallIds()
1128        ads[0].log.info("Calls in PhoneA %s", calls)
1129        if num_active_calls(self.log, ads[0]) != 2:
1130            return None, None
1131        if calls[0] == call_ab_id:
1132            call_ac_id = calls[1]
1133        else:
1134            call_ac_id = calls[0]
1135
1136        if num_swaps > 0:
1137            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1138            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1139                              num_swaps):
1140                self.log.error("Swap test failed.")
1141                return None, None
1142
1143        return call_ab_id, call_ac_id
1144
1145    def _test_wcdma_mt_mt_add_swap_x(self, num_swaps):
1146        """Test swap feature in WCDMA call.
1147
1148        PhoneB call PhoneA (WCDMA), accept on PhoneA.
1149        PhoneC call PhoneA (WCDMA), accept on PhoneA.
1150        Swap active call on PhoneA. (N times)
1151
1152        Args:
1153            num_swaps: do swap for 'num_swaps' times.
1154                This value can be 0 (no swap operation).
1155
1156        Returns:
1157            call_ab_id, call_ac_id if succeed;
1158            None, None if failed.
1159
1160        """
1161        ads = self.android_devices
1162
1163        # make sure PhoneA is GSM phone before proceed.
1164        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
1165            ads[0].log.error("not GSM phone, abort wcdma swap test.")
1166            return None, None
1167
1168        call_ab_id = self._three_phone_call_mt_add_mt(
1169            [ads[0], ads[1], ads[2]], [
1170                phone_setup_voice_3g, phone_setup_voice_general,
1171                phone_setup_voice_general
1172            ], [is_phone_in_call_3g, None, None])
1173        if call_ab_id is None:
1174            self.log.error("Failed to get call_ab_id")
1175            return None, None
1176
1177        calls = ads[0].droid.telecomCallGetCallIds()
1178        ads[0].log.info("Calls in PhoneA %s", calls)
1179        if num_active_calls(self.log, ads[0]) != 2:
1180            return None, None
1181        if calls[0] == call_ab_id:
1182            call_ac_id = calls[1]
1183        else:
1184            call_ac_id = calls[0]
1185
1186        if num_swaps > 0:
1187            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1188            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1189                              num_swaps):
1190                self.log.error("Swap test failed.")
1191                return None, None
1192
1193        return call_ab_id, call_ac_id
1194
1195    def _test_wcdma_mo_mt_add_swap_x(self, num_swaps):
1196        """Test swap feature in WCDMA call.
1197
1198        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
1199        PhoneC call PhoneA (WCDMA), accept on PhoneA.
1200        Swap active call on PhoneA. (N times)
1201
1202        Args:
1203            num_swaps: do swap for 'num_swaps' times.
1204                This value can be 0 (no swap operation).
1205
1206        Returns:
1207            call_ab_id, call_ac_id if succeed;
1208            None, None if failed.
1209
1210        """
1211        ads = self.android_devices
1212
1213        # make sure PhoneA is GSM phone before proceed.
1214        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
1215            ads[0].log.error("not GSM phone, abort wcdma swap test.")
1216            return None, None
1217
1218        call_ab_id = self._three_phone_call_mo_add_mt(
1219            [ads[0], ads[1], ads[2]], [
1220                phone_setup_voice_3g, phone_setup_voice_general,
1221                phone_setup_voice_general
1222            ], [is_phone_in_call_wcdma, None, None])
1223        if call_ab_id is None:
1224            self.log.error("Failed to get call_ab_id")
1225            return None, None
1226
1227        calls = ads[0].droid.telecomCallGetCallIds()
1228        ads[0].log.info("Calls in PhoneA %s", calls)
1229        if num_active_calls(self.log, ads[0]) != 2:
1230            return None, None
1231        if calls[0] == call_ab_id:
1232            call_ac_id = calls[1]
1233        else:
1234            call_ac_id = calls[0]
1235
1236        if num_swaps > 0:
1237            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1238            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1239                              num_swaps):
1240                self.log.error("Swap test failed.")
1241                return None, None
1242
1243        return call_ab_id, call_ac_id
1244
1245    def _test_csfb_wcdma_mo_mo_add_swap_x(self, num_swaps):
1246        """Test swap feature in CSFB WCDMA call.
1247
1248        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
1249        PhoneA (CSFB WCDMA) call PhoneC, accept on PhoneC.
1250        Swap active call on PhoneA. (N times)
1251
1252        Args:
1253            num_swaps: do swap for 'num_swaps' times.
1254                This value can be 0 (no swap operation).
1255
1256        Returns:
1257            call_ab_id, call_ac_id if succeed;
1258            None, None if failed.
1259
1260        """
1261        ads = self.android_devices
1262
1263        # make sure PhoneA is GSM phone before proceed.
1264        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
1265            ads[0].log.error("not GSM phone, abort wcdma swap test.")
1266            return None, None
1267
1268        call_ab_id = self._three_phone_call_mo_add_mo(
1269            [ads[0], ads[1], ads[2]], [
1270                phone_setup_csfb, phone_setup_voice_general,
1271                phone_setup_voice_general
1272            ], [is_phone_in_call_csfb, None, None])
1273        if call_ab_id is None:
1274            self.log.error("Failed to get call_ab_id")
1275            return None, None
1276
1277        calls = ads[0].droid.telecomCallGetCallIds()
1278        ads[0].log.info("Calls in PhoneA %s", calls)
1279        if num_active_calls(self.log, ads[0]) != 2:
1280            return None, None
1281        if calls[0] == call_ab_id:
1282            call_ac_id = calls[1]
1283        else:
1284            call_ac_id = calls[0]
1285
1286        if num_swaps > 0:
1287            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1288            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1289                              num_swaps):
1290                self.log.error("Swap test failed.")
1291                return None, None
1292
1293        return call_ab_id, call_ac_id
1294
1295    def _test_csfb_wcdma_mo_mt_add_swap_x(self, num_swaps):
1296        """Test swap feature in CSFB WCDMA call.
1297
1298        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
1299        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
1300        Swap active call on PhoneA. (N times)
1301
1302        Args:
1303            num_swaps: do swap for 'num_swaps' times.
1304                This value can be 0 (no swap operation).
1305
1306        Returns:
1307            call_ab_id, call_ac_id if succeed;
1308            None, None if failed.
1309
1310        """
1311        ads = self.android_devices
1312
1313        # make sure PhoneA is GSM phone before proceed.
1314        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
1315            ads[0].log.error("not GSM phone, abort wcdma swap test.")
1316            return None, None
1317
1318        call_ab_id = self._three_phone_call_mo_add_mt(
1319            [ads[0], ads[1], ads[2]], [
1320                phone_setup_csfb, phone_setup_voice_general,
1321                phone_setup_voice_general
1322            ], [is_phone_in_call_csfb, None, None])
1323        if call_ab_id is None:
1324            self.log.error("Failed to get call_ab_id")
1325            return None, None
1326
1327        calls = ads[0].droid.telecomCallGetCallIds()
1328        ads[0].log.info("Calls in PhoneA %s", calls)
1329        if num_active_calls(self.log, ads[0]) != 2:
1330            return None, None
1331        if calls[0] == call_ab_id:
1332            call_ac_id = calls[1]
1333        else:
1334            call_ac_id = calls[0]
1335
1336        if num_swaps > 0:
1337            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1338            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1339                              num_swaps):
1340                self.log.error("Swap test failed.")
1341                return None, None
1342
1343        return call_ab_id, call_ac_id
1344
1345    def _merge_ims_conference_call(self, call_ab_id, call_ac_id):
1346        """Merge IMS conference call for both cases of CEP enabled and disabled.
1347
1348        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneB.
1349        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneC.
1350        Merge calls to conference on PhoneA.
1351
1352        Args:
1353            call_ab_id: call id for call_AB on PhoneA.
1354            call_ac_id: call id for call_AC on PhoneA.
1355
1356        Returns:
1357            call_id for conference
1358        """
1359        ads = self.android_devices
1360        self.log.info("Step4: Merge to Conf Call and verify Conf Call.")
1361        ads[0].droid.telecomCallJoinCallsInConf(call_ab_id, call_ac_id)
1362        time.sleep(WAIT_TIME_IN_CALL)
1363        calls = ads[0].droid.telecomCallGetCallIds()
1364        ads[0].log.info("Calls in PhoneA %s", calls)
1365
1366        call_conf_id = None
1367        if num_active_calls(self.log, ads[0]) != 1:
1368            ads[0].log.info("Total number of call ids is not 1.")
1369            call_conf_id = get_cep_conference_call_id(ads[0])
1370            if call_conf_id is not None:
1371                self.log.info("New conference call id is found. CEP enabled.")
1372                calls.remove(call_conf_id)
1373                if (set(ads[0].droid.telecomCallGetCallChildren(
1374                    call_conf_id)) != set(calls)):
1375                    ads[0].log.error(
1376                        "Children list %s for conference call is not correct.",
1377                        ads[0].droid.telecomCallGetCallChildren(call_conf_id))
1378                    return None
1379
1380                if (CALL_PROPERTY_CONFERENCE not in ads[0]
1381                        .droid.telecomCallGetProperties(call_conf_id)):
1382                    ads[0].log.error(
1383                        "Conf call id % properties wrong: %s", call_conf_id,
1384                        ads[0].droid.telecomCallGetProperties(call_conf_id))
1385                    return None
1386
1387                if (CALL_CAPABILITY_MANAGE_CONFERENCE not in ads[0]
1388                        .droid.telecomCallGetCapabilities(call_conf_id)):
1389                    ads[0].log.error(
1390                        "Conf call id %s capabilities wrong: %s", call_conf_id,
1391                        ads[0].droid.telecomCallGetCapabilities(call_conf_id))
1392                    return None
1393
1394                if (call_ab_id in calls) or (call_ac_id in calls):
1395                    self.log.error("Previous call ids should not in new call"
1396                    " list after merge.")
1397                    return None
1398        else:
1399            for call_id in calls:
1400                if call_id != call_ab_id and call_id != call_ac_id:
1401                    call_conf_id = call_id
1402                    self.log.info("CEP not enabled.")
1403
1404        if not call_conf_id:
1405            self.log.error("Merge call fail, no new conference call id.")
1406            raise signals.TestFailure(
1407                "Calls were not merged. Failed to merge calls.",
1408                extras={"fail_reason": "Calls were not merged."
1409                    " Failed to merge calls."})
1410        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
1411            return False
1412
1413        # Check if Conf Call is currently active
1414        if ads[0].droid.telecomCallGetCallState(
1415                call_conf_id) != CALL_STATE_ACTIVE:
1416            ads[0].log.error(
1417                "Call_ID: %s, state: %s, expected: STATE_ACTIVE", call_conf_id,
1418                ads[0].droid.telecomCallGetCallState(call_conf_id))
1419            return None
1420
1421        return call_conf_id
1422
1423    def _test_ims_conference_merge_drop_second_call_from_participant(
1424            self, call_ab_id, call_ac_id):
1425        """Test conference merge and drop in IMS (VoLTE or WiFi Calling) call.
1426        (CEP enabled).
1427
1428        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneB.
1429        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneC.
1430        Merge calls to conference on PhoneA (CEP enabled IMS conference).
1431        Hangup on PhoneC, check call continues between AB.
1432        Hangup on PhoneB, check A ends.
1433
1434        Args:
1435            call_ab_id: call id for call_AB on PhoneA.
1436            call_ac_id: call id for call_AC on PhoneA.
1437
1438        Returns:
1439            True if succeed;
1440            False if failed.
1441        """
1442        ads = self.android_devices
1443
1444        call_conf_id = self._merge_ims_conference_call(call_ab_id, call_ac_id)
1445        if call_conf_id is None:
1446            return False
1447
1448        self.log.info("Step5: End call on PhoneC and verify call continues.")
1449        if not self._hangup_call(ads[2], "PhoneC"):
1450            return False
1451        time.sleep(WAIT_TIME_IN_CALL)
1452        calls = ads[0].droid.telecomCallGetCallIds()
1453        ads[0].log.info("Calls in PhoneA %s", calls)
1454        if not verify_incall_state(self.log, [ads[0], ads[1]], True):
1455            return False
1456        if not verify_incall_state(self.log, [ads[2]], False):
1457            return False
1458
1459        self.log.info("Step6: End call on PhoneB and verify PhoneA end.")
1460        if not self._hangup_call(ads[1], "PhoneB"):
1461            return False
1462        time.sleep(WAIT_TIME_IN_CALL)
1463        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], False):
1464            return False
1465        return True
1466
1467    def _test_ims_conference_merge_drop_first_call_from_participant(
1468            self, call_ab_id, call_ac_id):
1469        """Test conference merge and drop in IMS (VoLTE or WiFi Calling) call.
1470        (CEP enabled).
1471
1472        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneB.
1473        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneC.
1474        Merge calls to conference on PhoneA (CEP enabled IMS conference).
1475        Hangup on PhoneB, check call continues between AC.
1476        Hangup on PhoneC, check A ends.
1477
1478        Args:
1479            call_ab_id: call id for call_AB on PhoneA.
1480            call_ac_id: call id for call_AC on PhoneA.
1481
1482        Returns:
1483            True if succeed;
1484            False if failed.
1485        """
1486        ads = self.android_devices
1487
1488        call_conf_id = self._merge_ims_conference_call(call_ab_id, call_ac_id)
1489        if call_conf_id is None:
1490            return False
1491
1492        self.log.info("Step5: End call on PhoneB and verify call continues.")
1493        if not self._hangup_call(ads[1], "PhoneB"):
1494            return False
1495        time.sleep(WAIT_TIME_IN_CALL)
1496        if not verify_incall_state(self.log, [ads[0], ads[2]], True):
1497            return False
1498        if not verify_incall_state(self.log, [ads[1]], False):
1499            return False
1500
1501        self.log.info("Step6: End call on PhoneC and verify PhoneA end.")
1502        if not self._hangup_call(ads[2], "PhoneC"):
1503            return False
1504        time.sleep(WAIT_TIME_IN_CALL)
1505        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], False):
1506            return False
1507        return True
1508
1509    def _test_ims_conference_merge_drop_second_call_from_host(
1510            self, call_ab_id, call_ac_id):
1511        """Test conference merge and drop in IMS (VoLTE or WiFi Calling) call.
1512        (CEP enabled).
1513
1514        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneB.
1515        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneC.
1516        Merge calls to conference on PhoneA (CEP enabled IMS conference).
1517        On PhoneA, disconnect call between A-C, verify PhoneA PhoneB still in call.
1518        On PhoneA, disconnect call between A-B, verify PhoneA PhoneB disconnected.
1519
1520        Args:
1521            call_ab_id: call id for call_AB on PhoneA.
1522            call_ac_id: call id for call_AC on PhoneA.
1523
1524        Returns:
1525            True if succeed;
1526            False if failed.
1527        """
1528        ads = self.android_devices
1529
1530        call_ab_uri = get_call_uri(ads[0], call_ab_id)
1531        call_ac_uri = get_call_uri(ads[0], call_ac_id)
1532
1533        call_conf_id = self._merge_ims_conference_call(call_ab_id, call_ac_id)
1534        if call_conf_id is None:
1535            return False
1536
1537        calls = ads[0].droid.telecomCallGetCallIds()
1538        calls.remove(call_conf_id)
1539
1540        self.log.info("Step5: Disconnect call A-C and verify call continues.")
1541        call_to_disconnect = None
1542        for call in calls:
1543            if is_uri_equivalent(call_ac_uri, get_call_uri(ads[0], call)):
1544                call_to_disconnect = call
1545                calls.remove(call_to_disconnect)
1546                break
1547        if call_to_disconnect is None:
1548            self.log.error("Can NOT find call on host represents A-C.")
1549            return False
1550        else:
1551            ads[0].droid.telecomCallDisconnect(call_to_disconnect)
1552        time.sleep(WAIT_TIME_IN_CALL)
1553        if not verify_incall_state(self.log, [ads[0], ads[1]], True):
1554            return False
1555        if not verify_incall_state(self.log, [ads[2]], False):
1556            return False
1557
1558        self.log.info(
1559            "Step6: Disconnect call A-B and verify PhoneA PhoneB end.")
1560        calls = ads[0].droid.telecomCallGetCallIds()
1561        call_to_disconnect = None
1562        for call in calls:
1563            if is_uri_equivalent(call_ab_uri, get_call_uri(ads[0], call)):
1564                call_to_disconnect = call
1565                calls.remove(call_to_disconnect)
1566                break
1567        if call_to_disconnect is None:
1568            self.log.error("Can NOT find call on host represents A-B.")
1569            return False
1570        else:
1571            ads[0].droid.telecomCallDisconnect(call_to_disconnect)
1572        time.sleep(WAIT_TIME_IN_CALL)
1573        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], False):
1574            return False
1575        return True
1576
1577    def _test_ims_conference_merge_drop_first_call_from_host(
1578            self, call_ab_id, call_ac_id):
1579        """Test conference merge and drop in IMS (VoLTE or WiFi Calling) call.
1580        (CEP enabled).
1581
1582        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneB.
1583        PhoneA in IMS (VoLTE or WiFi Calling) call with PhoneC.
1584        Merge calls to conference on PhoneA (CEP enabled IMS conference).
1585        On PhoneA, disconnect call between A-B, verify PhoneA PhoneC still in call.
1586        On PhoneA, disconnect call between A-C, verify PhoneA PhoneC disconnected.
1587
1588        Args:
1589            call_ab_id: call id for call_AB on PhoneA.
1590            call_ac_id: call id for call_AC on PhoneA.
1591
1592        Returns:
1593            True if succeed;
1594            False if failed.
1595        """
1596        ads = self.android_devices
1597
1598        call_ab_uri = get_call_uri(ads[0], call_ab_id)
1599        call_ac_uri = get_call_uri(ads[0], call_ac_id)
1600
1601        call_conf_id = self._merge_ims_conference_call(call_ab_id, call_ac_id)
1602        if call_conf_id is None:
1603            return False
1604
1605        calls = ads[0].droid.telecomCallGetCallIds()
1606        calls.remove(call_conf_id)
1607
1608        self.log.info("Step5: Disconnect call A-B and verify call continues.")
1609        call_to_disconnect = None
1610        for call in calls:
1611            if is_uri_equivalent(call_ab_uri, get_call_uri(ads[0], call)):
1612                call_to_disconnect = call
1613                calls.remove(call_to_disconnect)
1614                break
1615        if call_to_disconnect is None:
1616            self.log.error("Can NOT find call on host represents A-B.")
1617            return False
1618        else:
1619            ads[0].droid.telecomCallDisconnect(call_to_disconnect)
1620        time.sleep(WAIT_TIME_IN_CALL)
1621        if not verify_incall_state(self.log, [ads[0], ads[2]], True):
1622            return False
1623        if not verify_incall_state(self.log, [ads[1]], False):
1624            return False
1625
1626        self.log.info(
1627            "Step6: Disconnect call A-C and verify PhoneA PhoneC end.")
1628        calls = ads[0].droid.telecomCallGetCallIds()
1629        call_to_disconnect = None
1630        for call in calls:
1631            if is_uri_equivalent(call_ac_uri, get_call_uri(ads[0], call)):
1632                call_to_disconnect = call
1633                calls.remove(call_to_disconnect)
1634                break
1635        if call_to_disconnect is None:
1636            self.log.error("Can NOT find call on host represents A-C.")
1637            return False
1638        else:
1639            ads[0].droid.telecomCallDisconnect(call_to_disconnect)
1640        time.sleep(WAIT_TIME_IN_CALL)
1641        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], False):
1642            return False
1643        return True
1644
1645    def _test_wcdma_conference_merge_drop(self, call_ab_id, call_ac_id):
1646        """Test conference merge and drop in WCDMA/CSFB_WCDMA call.
1647
1648        PhoneA in WCDMA (or CSFB_WCDMA) call with PhoneB.
1649        PhoneA in WCDMA (or CSFB_WCDMA) call with PhoneC.
1650        Merge calls to conference on PhoneA.
1651        Hangup on PhoneC, check call continues between AB.
1652        Hangup on PhoneB, check A ends.
1653
1654        Args:
1655            call_ab_id: call id for call_AB on PhoneA.
1656            call_ac_id: call id for call_AC on PhoneA.
1657
1658        Returns:
1659            True if succeed;
1660            False if failed.
1661        """
1662        ads = self.android_devices
1663
1664        self.log.info("Step4: Merge to Conf Call and verify Conf Call.")
1665        ads[0].droid.telecomCallJoinCallsInConf(call_ab_id, call_ac_id)
1666        time.sleep(WAIT_TIME_IN_CALL)
1667        calls = ads[0].droid.telecomCallGetCallIds()
1668        ads[0].log.info("Calls in PhoneA %s", calls)
1669        if num_active_calls(self.log, ads[0]) != 3:
1670            ads[0].log.error("Total number of call ids is not 3.")
1671            return False
1672        call_conf_id = None
1673        for call_id in calls:
1674            if call_id != call_ab_id and call_id != call_ac_id:
1675                call_conf_id = call_id
1676        if not call_conf_id:
1677            self.log.error("Merge call fail, no new conference call id.")
1678            return False
1679        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
1680            return False
1681
1682        # Check if Conf Call is currently active
1683        if ads[0].droid.telecomCallGetCallState(
1684                call_conf_id) != CALL_STATE_ACTIVE:
1685            ads[0].log.error(
1686                "Call_id: %s, state: %s, expected: STATE_ACTIVE", call_conf_id,
1687                ads[0].droid.telecomCallGetCallState(call_conf_id))
1688            return False
1689
1690        self.log.info("Step5: End call on PhoneC and verify call continues.")
1691        if not self._hangup_call(ads[2], "PhoneC"):
1692            return False
1693        time.sleep(WAIT_TIME_IN_CALL)
1694        calls = ads[0].droid.telecomCallGetCallIds()
1695        ads[0].log.info("Calls in PhoneA %s", calls)
1696        if num_active_calls(self.log, ads[0]) != 1:
1697            return False
1698        if not verify_incall_state(self.log, [ads[0], ads[1]], True):
1699            return False
1700        if not verify_incall_state(self.log, [ads[2]], False):
1701            return False
1702
1703        self.log.info("Step6: End call on PhoneB and verify PhoneA end.")
1704        if not self._hangup_call(ads[1], "PhoneB"):
1705            return False
1706        time.sleep(WAIT_TIME_IN_CALL)
1707        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], False):
1708            return False
1709        return True
1710
1711    def _three_phone_hangup_call_verify_call_state(
1712            self, ad_hangup, ad_verify, call_id, call_state, ads_active):
1713        """Private Test utility for swap test.
1714
1715        Hangup on 'ad_hangup'.
1716        Verify 'call_id' on 'ad_verify' is in expected 'call_state'
1717        Verify each ad in ads_active are 'in-call'.
1718
1719        Args:
1720            ad_hangup: android object to hangup call.
1721            ad_verify: android object to verify call id state.
1722            call_id: call id in 'ad_verify'.
1723            call_state: expected state for 'call_id'.
1724                'call_state' is either CALL_STATE_HOLDING or CALL_STATE_ACTIVE.
1725            ads_active: list of android object.
1726                Each one of them should be 'in-call' after 'hangup' operation.
1727
1728        Returns:
1729            True if no error happened. Otherwise False.
1730
1731        """
1732
1733        ad_hangup.log.info("Hangup, verify call continues.")
1734        if not self._hangup_call(ad_hangup):
1735            ad_hangup.log.error("Phone fails to hang up")
1736            return False
1737        time.sleep(WAIT_TIME_IN_CALL)
1738
1739        if ad_verify.droid.telecomCallGetCallState(call_id) != call_state:
1740            ad_verify.log.error(
1741                "Call_id: %s, state: %s, expected: %s", call_id,
1742                ad_verify.droid.telecomCallGetCallState(call_id), call_state)
1743            return False
1744        ad_verify.log.info("Call in expected %s state", call_state)
1745        # TODO: b/26296375 add voice check.
1746
1747        if not verify_incall_state(self.log, ads_active, True):
1748            ads_active.log.error("Phone not in call state")
1749            return False
1750        if not verify_incall_state(self.log, [ad_hangup], False):
1751            ad_hangup.log.error("Phone not in hangup state")
1752            return False
1753
1754        return True
1755
1756    def _test_epdg_mo_mo_add_epdg_swap_x(self, num_swaps):
1757        """Test swap feature in epdg call.
1758
1759        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
1760        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
1761        Swap active call on PhoneA.(N times)
1762
1763        Args:
1764            num_swaps: do swap for 'num_swaps' times.
1765                This value can be 0 (no swap operation).
1766
1767        Returns:
1768            call_ab_id, call_ac_id if succeed;
1769            None, None if failed.
1770
1771        """
1772        ads = self.android_devices
1773
1774        # To make thing simple, for epdg, setup should be called before calling
1775        # _test_epdg_mo_mo_add_epdg_swap_x in test cases.
1776        call_ab_id = self._three_phone_call_mo_add_mo(
1777            [ads[0], ads[1], ads[2]], [None, None, None], [
1778                is_phone_in_call_iwlan, is_phone_in_call_iwlan,
1779                is_phone_in_call_iwlan
1780            ])
1781        if call_ab_id is None:
1782            self.log.error("Failed to get call_ab_id")
1783            return None, None
1784
1785        calls = ads[0].droid.telecomCallGetCallIds()
1786        ads[0].log.info("Calls in PhoneA %s", calls)
1787        if num_active_calls(self.log, ads[0]) != 2:
1788            return None, None
1789        if calls[0] == call_ab_id:
1790            call_ac_id = calls[1]
1791        else:
1792            call_ac_id = calls[0]
1793
1794        if num_swaps > 0:
1795            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1796            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1797                              num_swaps):
1798                self.log.error("Swap test failed.")
1799                return None, None
1800
1801        return call_ab_id, call_ac_id
1802
1803    def _test_epdg_mo_mt_add_epdg_swap_x(self, num_swaps):
1804        """Test swap feature in epdg call.
1805
1806        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
1807        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
1808        Swap active call on PhoneA.(N times)
1809
1810        Args:
1811            num_swaps: do swap for 'num_swaps' times.
1812                This value can be 0 (no swap operation).
1813
1814        Returns:
1815            call_ab_id, call_ac_id if succeed;
1816            None, None if failed.
1817
1818        """
1819        ads = self.android_devices
1820
1821        # To make thing simple, for epdg, setup should be called before calling
1822        # _test_epdg_mo_mt_add_epdg_swap_x in test cases.
1823        call_ab_id = self._three_phone_call_mo_add_mt(
1824            [ads[0], ads[1], ads[2]], [None, None, None], [
1825                is_phone_in_call_iwlan, is_phone_in_call_iwlan,
1826                is_phone_in_call_iwlan
1827            ])
1828        if call_ab_id is None:
1829            self.log.error("Failed to get call_ab_id")
1830            return None, None
1831
1832        calls = ads[0].droid.telecomCallGetCallIds()
1833        ads[0].log.info("Calls in PhoneA %s", calls)
1834        if num_active_calls(self.log, ads[0]) != 2:
1835            return None, None
1836        if calls[0] == call_ab_id:
1837            call_ac_id = calls[1]
1838        else:
1839            call_ac_id = calls[0]
1840
1841        if num_swaps > 0:
1842            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1843            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1844                              num_swaps):
1845                self.log.error("Swap test failed.")
1846                return None, None
1847
1848        return call_ab_id, call_ac_id
1849
1850    def _test_epdg_mt_mt_add_epdg_swap_x(self, num_swaps):
1851        """Test swap feature in epdg call.
1852
1853        PhoneB (epdg) call PhoneA (epdg), accept on PhoneA.
1854        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
1855        Swap active call on PhoneA.(N times)
1856
1857        Args:
1858            num_swaps: do swap for 'num_swaps' times.
1859                This value can be 0 (no swap operation).
1860
1861        Returns:
1862            call_ab_id, call_ac_id if succeed;
1863            None, None if failed.
1864
1865        """
1866        ads = self.android_devices
1867
1868        # To make thing simple, for epdg, setup should be called before calling
1869        # _test_epdg_mt_mt_add_epdg_swap_x in test cases.
1870        call_ab_id = self._three_phone_call_mt_add_mt(
1871            [ads[0], ads[1], ads[2]], [None, None, None], [
1872                is_phone_in_call_iwlan, is_phone_in_call_iwlan,
1873                is_phone_in_call_iwlan
1874            ])
1875        if call_ab_id is None:
1876            self.log.error("Failed to get call_ab_id")
1877            return None, None
1878
1879        calls = ads[0].droid.telecomCallGetCallIds()
1880        ads[0].log.info("Calls in PhoneA %s", calls)
1881        if num_active_calls(self.log, ads[0]) != 2:
1882            return None, None
1883        if calls[0] == call_ab_id:
1884            call_ac_id = calls[1]
1885        else:
1886            call_ac_id = calls[0]
1887
1888        if num_swaps > 0:
1889            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1890            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1891                              num_swaps):
1892                self.log.error("Swap test failed.")
1893                return None, None
1894
1895        return call_ab_id, call_ac_id
1896
1897    def _test_epdg_mo_mo_add_volte_swap_x(self, num_swaps):
1898        """Test swap feature in epdg call.
1899
1900        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
1901        PhoneA (epdg) call PhoneC (VoLTE), accept on PhoneC.
1902        Swap active call on PhoneA.(N times)
1903
1904        Args:
1905            num_swaps: do swap for 'num_swaps' times.
1906                This value can be 0 (no swap operation).
1907
1908        Returns:
1909            call_ab_id, call_ac_id if succeed;
1910            None, None if failed.
1911
1912        """
1913        ads = self.android_devices
1914
1915        # To make thing simple, for epdg, setup should be called before calling
1916        # _test_epdg_mo_mo_add_volte_swap_x in test cases.
1917        call_ab_id = self._three_phone_call_mo_add_mo(
1918            [ads[0], ads[1], ads[2]], [None, None, None], [
1919                is_phone_in_call_iwlan, is_phone_in_call_volte,
1920                is_phone_in_call_volte
1921            ])
1922        if call_ab_id is None:
1923            self.log.error("Failed to get call_ab_id")
1924            return None, None
1925
1926        calls = ads[0].droid.telecomCallGetCallIds()
1927        ads[0].log.info("Calls in PhoneA: %s", calls)
1928        if num_active_calls(self.log, ads[0]) != 2:
1929            return None, None
1930        if calls[0] == call_ab_id:
1931            call_ac_id = calls[1]
1932        else:
1933            call_ac_id = calls[0]
1934
1935        if num_swaps > 0:
1936            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1937            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1938                              num_swaps):
1939                self.log.error("Swap test failed.")
1940                return None, None
1941
1942        return call_ab_id, call_ac_id
1943
1944    def _test_epdg_mo_mt_add_volte_swap_x(self, num_swaps):
1945        """Test swap feature in epdg call.
1946
1947        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
1948        PhoneC (VoLTE) call PhoneA (epdg), accept on PhoneA.
1949        Swap active call on PhoneA.(N times)
1950
1951        Args:
1952            num_swaps: do swap for 'num_swaps' times.
1953                This value can be 0 (no swap operation).
1954
1955        Returns:
1956            call_ab_id, call_ac_id if succeed;
1957            None, None if failed.
1958
1959        """
1960        ads = self.android_devices
1961
1962        # To make thing simple, for epdg, setup should be called before calling
1963        # _test_epdg_mo_mt_add_volte_swap_x in test cases.
1964        call_ab_id = self._three_phone_call_mo_add_mt(
1965            [ads[0], ads[1], ads[2]], [None, None, None], [
1966                is_phone_in_call_iwlan, is_phone_in_call_volte,
1967                is_phone_in_call_volte
1968            ])
1969        if call_ab_id is None:
1970            self.log.error("Failed to get call_ab_id")
1971            return None, None
1972
1973        calls = ads[0].droid.telecomCallGetCallIds()
1974        ads[0].log.info("Calls in PhoneA: %s", calls)
1975        if num_active_calls(self.log, ads[0]) != 2:
1976            return None, None
1977        if calls[0] == call_ab_id:
1978            call_ac_id = calls[1]
1979        else:
1980            call_ac_id = calls[0]
1981
1982        if num_swaps > 0:
1983            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
1984            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
1985                              num_swaps):
1986                self.log.error("Swap test failed.")
1987                return None, None
1988
1989        return call_ab_id, call_ac_id
1990
1991    def _test_epdg_mt_mt_add_volte_swap_x(self, num_swaps):
1992        """Test swap feature in epdg call.
1993
1994        PhoneB (VoLTE) call PhoneA (epdg), accept on PhoneA.
1995        PhoneC (VoLTE) call PhoneA (epdg), accept on PhoneA.
1996        Swap active call on PhoneA.(N times)
1997
1998        Args:
1999            num_swaps: do swap for 'num_swaps' times.
2000                This value can be 0 (no swap operation).
2001
2002        Returns:
2003            call_ab_id, call_ac_id if succeed;
2004            None, None if failed.
2005
2006        """
2007        ads = self.android_devices
2008
2009        # To make thing simple, for epdg, setup should be called before calling
2010        # _test_epdg_mt_mt_add_volte_swap_x in test cases.
2011        call_ab_id = self._three_phone_call_mt_add_mt(
2012            [ads[0], ads[1], ads[2]], [None, None, None], [
2013                is_phone_in_call_iwlan, is_phone_in_call_volte,
2014                is_phone_in_call_volte
2015            ])
2016        if call_ab_id is None:
2017            self.log.error("Failed to get call_ab_id")
2018            return None, None
2019
2020        calls = ads[0].droid.telecomCallGetCallIds()
2021        ads[0].log.info("Calls in PhoneA %s", calls)
2022        if num_active_calls(self.log, ads[0]) != 2:
2023            return None, None
2024        if calls[0] == call_ab_id:
2025            call_ac_id = calls[1]
2026        else:
2027            call_ac_id = calls[0]
2028
2029        if num_swaps > 0:
2030            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2031            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2032                              num_swaps):
2033                self.log.error("Swap test failed.")
2034                return None, None
2035
2036        return call_ab_id, call_ac_id
2037
2038    def _test_epdg_mo_mo_add_wcdma_swap_x(self, num_swaps):
2039        """Test swap feature in epdg call.
2040
2041        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
2042        PhoneA (epdg) call PhoneC (WCDMA), accept on PhoneC.
2043        Swap active call on PhoneA.(N times)
2044
2045        Args:
2046            num_swaps: do swap for 'num_swaps' times.
2047                This value can be 0 (no swap operation).
2048
2049        Returns:
2050            call_ab_id, call_ac_id if succeed;
2051            None, None if failed.
2052
2053        """
2054        ads = self.android_devices
2055
2056        # make sure PhoneB and PhoneC are GSM phone before proceed.
2057        for ad in [ads[1], ads[2]]:
2058            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2059                ad.log.error("not GSM phone, abort wcdma swap test.")
2060                return None, None
2061
2062        # To make thing simple, for epdg, setup should be called before calling
2063        # _test_epdg_mo_mo_add_wcdma_swap_x in test cases.
2064        call_ab_id = self._three_phone_call_mo_add_mo(
2065            [ads[0], ads[1], ads[2]], [None, None, None], [
2066                is_phone_in_call_iwlan, is_phone_in_call_wcdma,
2067                is_phone_in_call_wcdma
2068            ])
2069        if call_ab_id is None:
2070            self.log.error("Failed to get call_ab_id")
2071            return None, None
2072
2073        calls = ads[0].droid.telecomCallGetCallIds()
2074        ads[0].log.info("Calls in PhoneA %s", calls)
2075        if num_active_calls(self.log, ads[0]) != 2:
2076            return None, None
2077        if calls[0] == call_ab_id:
2078            call_ac_id = calls[1]
2079        else:
2080            call_ac_id = calls[0]
2081
2082        if num_swaps > 0:
2083            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2084            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2085                              num_swaps):
2086                self.log.error("Swap test failed.")
2087                return None, None
2088
2089        return call_ab_id, call_ac_id
2090
2091    def _test_epdg_mo_mt_add_wcdma_swap_x(self, num_swaps):
2092        """Test swap feature in epdg call.
2093
2094        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
2095        PhoneC (WCDMA) call PhoneA (epdg), accept on PhoneA.
2096        Swap active call on PhoneA.(N times)
2097
2098        Args:
2099            num_swaps: do swap for 'num_swaps' times.
2100                This value can be 0 (no swap operation).
2101
2102        Returns:
2103            call_ab_id, call_ac_id if succeed;
2104            None, None if failed.
2105
2106        """
2107        ads = self.android_devices
2108
2109        # make sure PhoneB and PhoneC are GSM phone before proceed.
2110        for ad in [ads[1], ads[2]]:
2111            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2112                ad.log.error("not GSM phone, abort wcdma swap test.")
2113                return None, None
2114
2115        # To make thing simple, for epdg, setup should be called before calling
2116        # _test_epdg_mo_mt_add_wcdma_swap_x in test cases.
2117        call_ab_id = self._three_phone_call_mo_add_mt(
2118            [ads[0], ads[1], ads[2]], [None, None, None], [
2119                is_phone_in_call_iwlan, is_phone_in_call_wcdma,
2120                is_phone_in_call_wcdma
2121            ])
2122        if call_ab_id is None:
2123            self.log.error("Failed to get call_ab_id")
2124            return None, None
2125
2126        calls = ads[0].droid.telecomCallGetCallIds()
2127        ads[0].log.info("Calls in PhoneA %s", calls)
2128        if num_active_calls(self.log, ads[0]) != 2:
2129            return None, None
2130        if calls[0] == call_ab_id:
2131            call_ac_id = calls[1]
2132        else:
2133            call_ac_id = calls[0]
2134
2135        if num_swaps > 0:
2136            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2137            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2138                              num_swaps):
2139                self.log.error("Swap test failed.")
2140                return None, None
2141
2142        return call_ab_id, call_ac_id
2143
2144    def _test_epdg_mt_mt_add_wcdma_swap_x(self, num_swaps):
2145        """Test swap feature in epdg call.
2146
2147        PhoneB (WCDMA) call PhoneA (epdg), accept on PhoneA.
2148        PhoneC (WCDMA) call PhoneA (epdg), accept on PhoneA.
2149        Swap active call on PhoneA.(N times)
2150
2151        Args:
2152            num_swaps: do swap for 'num_swaps' times.
2153                This value can be 0 (no swap operation).
2154
2155        Returns:
2156            call_ab_id, call_ac_id if succeed;
2157            None, None if failed.
2158
2159        """
2160        ads = self.android_devices
2161
2162        # make sure PhoneB and PhoneC are GSM phone before proceed.
2163        for ad in [ads[1], ads[2]]:
2164            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
2165                ad.log.error("not GSM phone, abort wcdma swap test.")
2166                return None, None
2167
2168        # To make thing simple, for epdg, setup should be called before calling
2169        # _test_epdg_mo_mt_add_wcdma_swap_x in test cases.
2170        call_ab_id = self._three_phone_call_mt_add_mt(
2171            [ads[0], ads[1], ads[2]], [None, None, None], [
2172                is_phone_in_call_iwlan, is_phone_in_call_wcdma,
2173                is_phone_in_call_wcdma
2174            ])
2175        if call_ab_id is None:
2176            self.log.error("Failed to get call_ab_id")
2177            return None, None
2178
2179        calls = ads[0].droid.telecomCallGetCallIds()
2180        ads[0].log.info("Calls in PhoneA %s", calls)
2181        if num_active_calls(self.log, ads[0]) != 2:
2182            return None, None
2183        if calls[0] == call_ab_id:
2184            call_ac_id = calls[1]
2185        else:
2186            call_ac_id = calls[0]
2187
2188        if num_swaps > 0:
2189            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2190            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2191                              num_swaps):
2192                self.log.error("Swap test failed.")
2193                return None, None
2194
2195        return call_ab_id, call_ac_id
2196
2197    def _test_epdg_mo_mo_add_1x_swap_x(self, num_swaps):
2198        """Test swap feature in epdg call.
2199
2200        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
2201        PhoneA (epdg) call PhoneC (1x), accept on PhoneC.
2202        Swap active call on PhoneA.(N times)
2203
2204        Args:
2205            num_swaps: do swap for 'num_swaps' times.
2206                This value can be 0 (no swap operation).
2207
2208        Returns:
2209            call_ab_id, call_ac_id if succeed;
2210            None, None if failed.
2211
2212        """
2213        ads = self.android_devices
2214
2215        # make sure PhoneB and PhoneC are CDMA phone before proceed.
2216        for ad in [ads[1], ads[2]]:
2217            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
2218                ad.log.error("not CDMA phone, abort 1x swap test.")
2219                return None, None
2220
2221        # To make thing simple, for epdg, setup should be called before calling
2222        # _test_epdg_mo_mo_add_1x_swap_x in test cases.
2223        call_ab_id = self._three_phone_call_mo_add_mo(
2224            [ads[0], ads[1], ads[2]], [None, None, None],
2225            [is_phone_in_call_iwlan, is_phone_in_call_1x, is_phone_in_call_1x])
2226        if call_ab_id is None:
2227            self.log.error("Failed to get call_ab_id")
2228            return None, None
2229
2230        calls = ads[0].droid.telecomCallGetCallIds()
2231        ads[0].log.info("Calls in PhoneA %s", calls)
2232        if num_active_calls(self.log, ads[0]) != 2:
2233            return None, None
2234        if calls[0] == call_ab_id:
2235            call_ac_id = calls[1]
2236        else:
2237            call_ac_id = calls[0]
2238
2239        if num_swaps > 0:
2240            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2241            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2242                              num_swaps):
2243                self.log.error("Swap test failed.")
2244                return None, None
2245
2246        return call_ab_id, call_ac_id
2247
2248    def _test_epdg_mo_mt_add_1x_swap_x(self, num_swaps):
2249        """Test swap feature in epdg call.
2250
2251        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
2252        PhoneC (1x) call PhoneA (epdg), accept on PhoneA.
2253        Swap active call on PhoneA.(N times)
2254
2255        Args:
2256            num_swaps: do swap for 'num_swaps' times.
2257                This value can be 0 (no swap operation).
2258
2259        Returns:
2260            call_ab_id, call_ac_id if succeed;
2261            None, None if failed.
2262
2263        """
2264        ads = self.android_devices
2265
2266        # make sure PhoneB and PhoneC are CDMA phone before proceed.
2267        for ad in [ads[1], ads[2]]:
2268            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
2269                ad.log.error("not CDMA phone, abort 1x swap test.")
2270                return None, None
2271
2272        # To make thing simple, for epdg, setup should be called before calling
2273        # _test_epdg_mo_mt_add_1x_swap_x in test cases.
2274        call_ab_id = self._three_phone_call_mo_add_mt(
2275            [ads[0], ads[1], ads[2]], [None, None, None],
2276            [is_phone_in_call_iwlan, is_phone_in_call_1x, is_phone_in_call_1x])
2277        if call_ab_id is None:
2278            self.log.error("Failed to get call_ab_id")
2279            return None, None
2280
2281        calls = ads[0].droid.telecomCallGetCallIds()
2282        ads[0].log.info("Calls in PhoneA %s", calls)
2283        if num_active_calls(self.log, ads[0]) != 2:
2284            return None, None
2285        if calls[0] == call_ab_id:
2286            call_ac_id = calls[1]
2287        else:
2288            call_ac_id = calls[0]
2289
2290        if num_swaps > 0:
2291            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2292            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2293                              num_swaps):
2294                self.log.error("Swap test failed.")
2295                return None, None
2296
2297        return call_ab_id, call_ac_id
2298
2299    def _test_epdg_mt_mt_add_1x_swap_x(self, num_swaps):
2300        """Test swap feature in epdg call.
2301
2302        PhoneB (1x) call PhoneA (epdg), accept on PhoneA.
2303        PhoneC (1x) call PhoneA (epdg), accept on PhoneA.
2304        Swap active call on PhoneA.(N times)
2305
2306        Args:
2307            num_swaps: do swap for 'num_swaps' times.
2308                This value can be 0 (no swap operation).
2309
2310        Returns:
2311            call_ab_id, call_ac_id if succeed;
2312            None, None if failed.
2313
2314        """
2315        ads = self.android_devices
2316
2317        # make sure PhoneB and PhoneC are CDMA phone before proceed.
2318        for ad in [ads[1], ads[2]]:
2319            if (ad.droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA):
2320                ad.log.error("not CDMA phone, abort 1x swap test.")
2321                return None, None
2322
2323        # To make thing simple, for epdg, setup should be called before calling
2324        # _test_epdg_mo_mt_add_1x_swap_x in test cases.
2325        call_ab_id = self._three_phone_call_mt_add_mt(
2326            [ads[0], ads[1], ads[2]], [None, None, None],
2327            [is_phone_in_call_iwlan, is_phone_in_call_1x, is_phone_in_call_1x])
2328        if call_ab_id is None:
2329            self.log.error("Failed to get call_ab_id")
2330            return None, None
2331
2332        calls = ads[0].droid.telecomCallGetCallIds()
2333        ads[0].log.info("Calls in PhoneA %s", calls)
2334        if num_active_calls(self.log, ads[0]) != 2:
2335            return None, None
2336        if calls[0] == call_ab_id:
2337            call_ac_id = calls[1]
2338        else:
2339            call_ac_id = calls[0]
2340
2341        if num_swaps > 0:
2342            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
2343            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
2344                              num_swaps):
2345                self.log.error("Swap test failed.")
2346                return None, None
2347
2348        return call_ab_id, call_ac_id
2349
2350    """ Tests Begin """
2351
2352    @TelephonyBaseTest.tel_test_wrap
2353    @test_tracker_info(uuid="3cd45972-3862-4956-9504-7fefacdd5ca6")
2354    def test_wcdma_mo_mo_add_merge_drop(self):
2355        """ Test Conf Call among three phones.
2356
2357        Call from PhoneA to PhoneB, accept on PhoneB.
2358        Call from PhoneA to PhoneC, accept on PhoneC.
2359        On PhoneA, merge to conference call.
2360        End call on PhoneC, verify call continues.
2361        End call on PhoneB, verify call end on PhoneA.
2362
2363        Returns:
2364            True if pass; False if fail.
2365        """
2366        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(0)
2367        if call_ab_id is None or call_ac_id is None:
2368            return False
2369
2370        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
2371
2372    @TelephonyBaseTest.tel_test_wrap
2373    @test_tracker_info(uuid="c1158bd3-6327-4c91-96a7-400e69f68698")
2374    def test_wcdma_mt_mt_add_merge_drop(self):
2375        """ Test Conf Call among three phones.
2376
2377        Call from PhoneB to PhoneA, accept on PhoneA.
2378        Call from PhoneC to PhoneA, accept on PhoneA.
2379        On PhoneA, merge to conference call.
2380        End call on PhoneC, verify call continues.
2381        End call on PhoneB, verify call end on PhoneA.
2382
2383        Returns:
2384            True if pass; False if fail.
2385        """
2386        call_ab_id, call_ac_id = self._test_wcdma_mt_mt_add_swap_x(0)
2387        if call_ab_id is None or call_ac_id is None:
2388            return False
2389
2390        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
2391
2392    @TelephonyBaseTest.tel_test_wrap
2393    @test_tracker_info(uuid="804478b4-a826-48be-a9fa-9a0cec66ee54")
2394    def test_1x_mo_mo_add_merge_drop_from_participant(self):
2395        """ Test 1x Conf Call among three phones.
2396
2397        Steps:
2398        1. DUT in 1x idle, PhoneB and PhoneC idle.
2399        2. Call from DUT to PhoneB, accept on PhoneB.
2400        3. Call from DUT to PhoneC, accept on PhoneC.
2401        4. On DUT, merge to conference call.
2402        5. End call PhoneC, verify call continues on DUT and PhoneB.
2403        6. End call on PhoneB, verify call end on PhoneA.
2404
2405        Expected Results:
2406        4. Merge Call succeed on DUT.
2407        5. PhoneC drop call, DUT and PhoneB call continues.
2408        6. PhoneB drop call, call also end on DUT.
2409
2410        Returns:
2411            True if pass; False if fail.
2412        """
2413
2414        ads = self.android_devices
2415
2416        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mo_add()
2417        if ((call_ab_id is None) or (call_ac_id is None)
2418                or (call_conf_id is None)):
2419            self.log.error("Failed to setup 3 way call.")
2420            return False
2421
2422        self.log.info("Merge to Conf Call and verify Conf Call.")
2423        if not self._test_1x_merge_conference(ads[0], [ads[1], ads[2]],
2424                                              call_conf_id):
2425            self.log.error("1x Conference merge failed.")
2426
2427        self.log.info("End call on PhoneC, and end call on PhoneB.")
2428        return self._test_1x_multi_call_drop_from_participant(
2429            ads[0], ads[2], ads[1])
2430
2431    @TelephonyBaseTest.tel_test_wrap
2432    @test_tracker_info(uuid="a36b02a6-480e-4cb6-9201-bd8bfa5ae8a4")
2433    def test_1x_mo_mo_add_merge_drop_from_host(self):
2434        """ Test 1x Conf Call among three phones.
2435
2436        Steps:
2437        1. DUT in 1x idle, PhoneB and PhoneC idle.
2438        2. Call from DUT to PhoneB, accept on PhoneB.
2439        3. Call from DUT to PhoneC, accept on PhoneC.
2440        4. On DUT, merge to conference call.
2441        5. End call on DUT, make sure all participants drop.
2442
2443        Expected Results:
2444        4. Merge Call succeed on DUT.
2445        5. Make sure DUT and all participants drop call.
2446
2447        Returns:
2448            True if pass; False if fail.
2449        """
2450
2451        ads = self.android_devices
2452
2453        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mo_add()
2454        if ((call_ab_id is None) or (call_ac_id is None)
2455                or (call_conf_id is None)):
2456            self.log.error("Failed to setup 3 way call.")
2457            return False
2458
2459        self.log.info("Merge to Conf Call and verify Conf Call.")
2460        if not self._test_1x_merge_conference(ads[0], [ads[1], ads[2]],
2461                                              call_conf_id):
2462            self.log.error("1x Conference merge failed.")
2463
2464        self.log.info("End call on PhoneC, and end call on PhoneB.")
2465        return self._test_1x_conf_call_drop_from_host(ads[0], [ads[2], ads[1]])
2466
2467    @TelephonyBaseTest.tel_test_wrap
2468    @test_tracker_info(uuid="0c9e5da6-90db-4cb5-9b2c-4be3460b49d0")
2469    def test_1x_mo_mt_add_drop_active(self):
2470        """ Test 1x MO+MT call among three phones.
2471
2472        Steps:
2473        1. DUT in 1x idle, PhoneB and PhoneC idle.
2474        2. Call from DUT to PhoneB, accept on PhoneB.
2475        3. Call from PhoneC to DUT, accept on DUT.
2476        4. End call PhoneC, verify call continues on DUT and PhoneB.
2477        5. End call on PhoneB, verify call end on PhoneA.
2478
2479        Expected Results:
2480        4. PhoneC drop call, DUT and PhoneB call continues.
2481        5. PhoneB drop call, call also end on DUT.
2482
2483        Returns:
2484            True if pass; False if fail.
2485        """
2486        ads = self.android_devices
2487
2488        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2489            0)
2490        if ((call_ab_id is None) or (call_ac_id is None)
2491                or (call_conf_id is None)):
2492            self.log.error("Failed to setup 3 way call.")
2493            return False
2494
2495        self.log.info("Verify no one dropped call.")
2496        time.sleep(WAIT_TIME_IN_CALL)
2497        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2498            return False
2499
2500        self.log.info("End call on PhoneC, and end call on PhoneB.")
2501        return self._test_1x_multi_call_drop_from_participant(
2502            ads[0], ads[2], ads[1])
2503
2504    @TelephonyBaseTest.tel_test_wrap
2505    @test_tracker_info(uuid="9dc16b45-3470-44c8-abf8-19cd5944a53c")
2506    def test_1x_mo_mt_add_swap_twice_drop_active(self):
2507        """ Test 1x MO+MT call among three phones.
2508
2509        Steps:
2510        1. DUT in 1x idle, PhoneB and PhoneC idle.
2511        2. DUT MO call to PhoneB, answer on PhoneB.
2512        3. PhoneC call to DUT, answer on DUT
2513        4. Swap active call on DUT.
2514        5. Swap active call on DUT.
2515        6. Drop on PhoneC.
2516        7. Drop on PhoneB.
2517
2518        Expected Results:
2519        4. Swap call succeed.
2520        5. Swap call succeed.
2521        6. Call between DUT and PhoneB continues.
2522        7. All participant call end.
2523
2524        Returns:
2525            True if pass; False if fail.
2526        """
2527        ads = self.android_devices
2528
2529        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2530            2)
2531        if ((call_ab_id is None) or (call_ac_id is None)
2532                or (call_conf_id is None)):
2533            self.log.error("Failed to setup 3 way call.")
2534            return False
2535
2536        self.log.info("Verify no one dropped call.")
2537        time.sleep(WAIT_TIME_IN_CALL)
2538        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2539            return False
2540
2541        self.log.info("End call on PhoneC, and end call on PhoneB.")
2542        return self._test_1x_multi_call_drop_from_participant(
2543            ads[0], ads[2], ads[1])
2544
2545    @TelephonyBaseTest.tel_test_wrap
2546    @test_tracker_info(uuid="dc7a3187-142e-4754-a914-d0241397a2b3")
2547    def test_1x_mo_mt_add_swap_once_drop_active(self):
2548        """ Test 1x MO+MT call among three phones.
2549
2550        Steps:
2551        1. DUT in 1x idle, PhoneB and PhoneC idle.
2552        2. DUT MO call to PhoneB, answer on PhoneB.
2553        3. PhoneC call to DUT, answer on DUT
2554        4. Swap active call on DUT.
2555        5. Drop on PhoneB.
2556        6. Drop on PhoneC.
2557
2558        Expected Results:
2559        4. Swap call succeed.
2560        5. Call between DUT and PhoneC continues.
2561        6. All participant call end.
2562
2563        Returns:
2564            True if pass; False if fail.
2565        """
2566        ads = self.android_devices
2567
2568        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2569            1)
2570        if ((call_ab_id is None) or (call_ac_id is None)
2571                or (call_conf_id is None)):
2572            self.log.error("Failed to setup 3 way call.")
2573            return False
2574
2575        self.log.info("Verify no one dropped call.")
2576        time.sleep(WAIT_TIME_IN_CALL)
2577        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2578            return False
2579
2580        self.log.info("End call on PhoneB, and end call on PhoneC.")
2581        return self._test_1x_multi_call_drop_from_participant(
2582            ads[0], ads[1], ads[2])
2583
2584    @TelephonyBaseTest.tel_test_wrap
2585    @test_tracker_info(uuid="24cd0ef0-1a69-4603-89c2-0f2b96715348")
2586    def test_1x_mo_mt_add_drop_held(self):
2587        """ Test 1x MO+MT call among three phones.
2588
2589        Steps:
2590        1. DUT in 1x idle, PhoneB and PhoneC idle.
2591        2. Call from DUT to PhoneB, accept on PhoneB.
2592        3. Call from PhoneC to DUT, accept on DUT.
2593        4. End call PhoneB, verify call continues on DUT and PhoneC.
2594        5. End call on PhoneC, verify call end on PhoneA.
2595
2596        Expected Results:
2597        4. DUT drop call, PhoneC also end. Then DUT receive callback from PhoneB.
2598        5. DUT drop call, call also end on PhoneB.
2599
2600        Returns:
2601            True if pass; False if fail.
2602        """
2603        ads = self.android_devices
2604
2605        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2606            0)
2607        if ((call_ab_id is None) or (call_ac_id is None)
2608                or (call_conf_id is None)):
2609            self.log.error("Failed to setup 3 way call.")
2610            return False
2611
2612        self.log.info("Verify no one dropped call.")
2613        time.sleep(WAIT_TIME_IN_CALL)
2614        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2615            return False
2616
2617        self.log.info("End call on PhoneB, and end call on PhoneC.")
2618        return self._test_1x_multi_call_drop_from_participant(
2619            ads[0], ads[1], ads[2])
2620
2621    @TelephonyBaseTest.tel_test_wrap
2622    @test_tracker_info(uuid="1c5c1780-84c2-4547-9e57-eeadac6569d7")
2623    def test_1x_mo_mt_add_swap_twice_drop_held(self):
2624        """ Test 1x MO+MT call among three phones.
2625
2626        Steps:
2627        1. DUT in 1x idle, PhoneB and PhoneC idle.
2628        2. DUT MO call to PhoneB, answer on PhoneB.
2629        3. PhoneC call to DUT, answer on DUT
2630        4. Swap active call on DUT.
2631        5. Swap active call on DUT.
2632        6. Drop on PhoneB.
2633        7. Drop on PhoneC.
2634
2635        Expected Results:
2636        4. Swap call succeed.
2637        5. Swap call succeed.
2638        6. Call between DUT and PhoneC continues.
2639        7. All participant call end.
2640
2641        Returns:
2642            True if pass; False if fail.
2643        """
2644        ads = self.android_devices
2645
2646        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2647            2)
2648        if ((call_ab_id is None) or (call_ac_id is None)
2649                or (call_conf_id is None)):
2650            self.log.error("Failed to setup 3 way call.")
2651            return False
2652
2653        self.log.info("Verify no one dropped call.")
2654        time.sleep(WAIT_TIME_IN_CALL)
2655        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2656            return False
2657
2658        self.log.info("End call on PhoneB, and end call on PhoneC.")
2659        return self._test_1x_multi_call_drop_from_participant(
2660            ads[0], ads[1], ads[2])
2661
2662    @TelephonyBaseTest.tel_test_wrap
2663    @test_tracker_info(uuid="928a2b21-c4ca-4553-9acc-8d3db61ed6eb")
2664    def test_1x_mo_mt_add_swap_once_drop_held(self):
2665        """ Test 1x MO+MT call among three phones.
2666
2667        Steps:
2668        1. DUT in 1x idle, PhoneB and PhoneC idle.
2669        2. DUT MO call to PhoneB, answer on PhoneB.
2670        3. PhoneC call to DUT, answer on DUT
2671        4. Swap active call on DUT.
2672        5. Drop on PhoneC.
2673        6. Drop on PhoneB.
2674
2675        Expected Results:
2676        4. Swap call succeed.
2677        5. Call between DUT and PhoneB continues.
2678        6. All participant call end.
2679
2680        Returns:
2681            True if pass; False if fail.
2682        """
2683        ads = self.android_devices
2684
2685        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2686            1)
2687        if ((call_ab_id is None) or (call_ac_id is None)
2688                or (call_conf_id is None)):
2689            self.log.error("Failed to setup 3 way call.")
2690            return False
2691
2692        self.log.info("Verify no one dropped call.")
2693        time.sleep(WAIT_TIME_IN_CALL)
2694        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2695            return False
2696
2697        self.log.info("End call on PhoneC, and end call on PhoneB.")
2698        return self._test_1x_multi_call_drop_from_participant(
2699            ads[0], ads[2], ads[1])
2700
2701    @TelephonyBaseTest.tel_test_wrap
2702    @test_tracker_info(uuid="deb57627-a717-41f0-b8f4-f3ccf9ce2e15")
2703    def test_1x_mo_mt_add_drop_on_dut(self):
2704        """ Test 1x MO+MT call among three phones.
2705
2706        Steps:
2707        1. DUT in 1x idle, PhoneB and PhoneC idle.
2708        2. Call from DUT to PhoneB, accept on PhoneB.
2709        3. Call from PhoneC to DUT, accept on DUT.
2710        4. End call on DUT.
2711        5. End call on DUT.
2712
2713        Expected Results:
2714        4. DUT drop call, PhoneC also end. Then DUT receive callback from PhoneB.
2715        5. DUT drop call, call also end on PhoneB.
2716
2717        Returns:
2718            True if pass; False if fail.
2719        """
2720        ads = self.android_devices
2721
2722        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2723            0)
2724        if ((call_ab_id is None) or (call_ac_id is None)
2725                or (call_conf_id is None)):
2726            self.log.error("Failed to setup 3 way call.")
2727            return False
2728
2729        self.log.info("Verify no one dropped call.")
2730        time.sleep(WAIT_TIME_IN_CALL)
2731        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2732            return False
2733
2734        self.log.info("End call on DUT, DUT should receive callback.")
2735        return self._test_1x_multi_call_drop_from_host(ads[0], ads[2], ads[1])
2736
2737    @TelephonyBaseTest.tel_test_wrap
2738    @test_tracker_info(uuid="9cdee9c2-98cf-40de-9396-516192e493a1")
2739    def test_1x_mo_mt_add_swap_twice_drop_on_dut(self):
2740        """ Test 1x MO+MT call among three phones.
2741
2742        Steps:
2743        1. DUT in 1x idle, PhoneB and PhoneC idle.
2744        2. DUT MO call to PhoneB, answer on PhoneB.
2745        3. PhoneC call to DUT, answer on DUT
2746        4. Swap active call on DUT.
2747        5. Swap active call on DUT.
2748        6. Drop current call on DUT.
2749        7. Drop current call on DUT.
2750
2751        Expected Results:
2752        4. Swap call succeed.
2753        5. Swap call succeed.
2754        6. DUT drop call, PhoneC also end. Then DUT receive callback from PhoneB.
2755        7. DUT drop call, call also end on PhoneB.
2756
2757        Returns:
2758            True if pass; False if fail.
2759        """
2760        ads = self.android_devices
2761
2762        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2763            2)
2764        if ((call_ab_id is None) or (call_ac_id is None)
2765                or (call_conf_id is None)):
2766            self.log.error("Failed to setup 3 way call.")
2767            return False
2768
2769        self.log.info("Verify no one dropped call.")
2770        time.sleep(WAIT_TIME_IN_CALL)
2771        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2772            return False
2773
2774        self.log.info("End call on DUT, DUT should receive callback.")
2775        return self._test_1x_multi_call_drop_from_host(ads[0], ads[2], ads[1])
2776
2777    @TelephonyBaseTest.tel_test_wrap
2778    @test_tracker_info(uuid="26187827-64c0-436e-9792-20c216aeb442")
2779    def test_1x_mo_mt_add_swap_once_drop_on_dut(self):
2780        """ Test 1x MO+MT call among three phones.
2781
2782        Steps:
2783        1. DUT in 1x idle, PhoneB and PhoneC idle.
2784        2. DUT MO call to PhoneB, answer on PhoneB.
2785        3. PhoneC call to DUT, answer on DUT
2786        4. Swap active call on DUT.
2787        5. Drop current call on DUT.
2788        6. Drop current call on DUT.
2789
2790        Expected Results:
2791        4. Swap call succeed.
2792        5. DUT drop call, PhoneB also end. Then DUT receive callback from PhoneC.
2793        6. DUT drop call, call also end on PhoneC.
2794
2795        Returns:
2796            True if pass; False if fail.
2797        """
2798        ads = self.android_devices
2799
2800        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mo_mt_add_swap_x(
2801            1)
2802        if ((call_ab_id is None) or (call_ac_id is None)
2803                or (call_conf_id is None)):
2804            self.log.error("Failed to setup 3 way call.")
2805            return False
2806
2807        self.log.info("Verify no one dropped call.")
2808        time.sleep(WAIT_TIME_IN_CALL)
2809        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2810            return False
2811
2812        self.log.info("End call on DUT, DUT should receive callback.")
2813        return self._test_1x_multi_call_drop_from_host(ads[0], ads[1], ads[2])
2814
2815    @TelephonyBaseTest.tel_test_wrap
2816    @test_tracker_info(uuid="ce590b72-b4ab-4a27-9c01-f8e3b110419f")
2817    def test_1x_mt_mt_add_drop_active(self):
2818        """ Test 1x MT+MT call among three phones.
2819
2820        Steps:
2821        1. DUT in 1x idle, PhoneB and PhoneC idle.
2822        2. Call from PhoneB to DUT, accept on DUT.
2823        3. Call from PhoneC to DUT, accept on DUT.
2824        4. End call PhoneC, verify call continues on DUT and PhoneB.
2825        5. End call on PhoneB, verify call end on PhoneA.
2826
2827        Expected Results:
2828        4. PhoneC drop call, DUT and PhoneB call continues.
2829        5. PhoneB drop call, call also end on DUT.
2830
2831        Returns:
2832            True if pass; False if fail.
2833        """
2834        ads = self.android_devices
2835
2836        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
2837            0)
2838        if ((call_ab_id is None) or (call_ac_id is None)
2839                or (call_conf_id is None)):
2840            self.log.error("Failed to setup 3 way call.")
2841            return False
2842
2843        self.log.info("Verify no one dropped call.")
2844        time.sleep(WAIT_TIME_IN_CALL)
2845        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2846            return False
2847
2848        self.log.info("End call on PhoneC, and end call on PhoneB.")
2849        return self._test_1x_multi_call_drop_from_participant(
2850            ads[0], ads[2], ads[1])
2851
2852    @TelephonyBaseTest.tel_test_wrap
2853    @test_tracker_info(uuid="736aa74e-1d0b-4f85-b0f7-11840543cf54")
2854    def test_1x_mt_mt_add_swap_twice_drop_active(self):
2855        """ Test 1x MT+MT call among three phones.
2856
2857        Steps:
2858        1. DUT in 1x idle, PhoneB and PhoneC idle.
2859        2. PhoneB call to DUT, answer on DUT.
2860        3. PhoneC call to DUT, answer on DUT
2861        4. Swap active call on DUT.
2862        5. Swap active call on DUT.
2863        6. Drop on PhoneC.
2864        7. Drop on PhoneB.
2865
2866        Expected Results:
2867        4. Swap call succeed.
2868        5. Swap call succeed.
2869        6. Call between DUT and PhoneB continues.
2870        7. All participant call end.
2871
2872        Returns:
2873            True if pass; False if fail.
2874        """
2875        ads = self.android_devices
2876
2877        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
2878            2)
2879        if ((call_ab_id is None) or (call_ac_id is None)
2880                or (call_conf_id is None)):
2881            self.log.error("Failed to setup 3 way call.")
2882            return False
2883
2884        self.log.info("Verify no one dropped call.")
2885        time.sleep(WAIT_TIME_IN_CALL)
2886        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2887            return False
2888
2889        self.log.info("End call on PhoneC, and end call on PhoneB.")
2890        return self._test_1x_multi_call_drop_from_participant(
2891            ads[0], ads[2], ads[1])
2892
2893    @TelephonyBaseTest.tel_test_wrap
2894    @test_tracker_info(uuid="3eee6b6e-e1b1-43ec-82d5-d298b514fc07")
2895    def test_1x_mt_mt_add_swap_once_drop_active(self):
2896        """ Test 1x MT+MT call among three phones.
2897
2898        Steps:
2899        1. DUT in 1x idle, PhoneB and PhoneC idle.
2900        2. PhoneB call to DUT, answer on DUT.
2901        3. PhoneC call to DUT, answer on DUT
2902        4. Swap active call on DUT.
2903        5. Drop on PhoneB.
2904        6. Drop on PhoneC.
2905
2906        Expected Results:
2907        4. Swap call succeed.
2908        5. Call between DUT and PhoneC continues.
2909        6. All participant call end.
2910
2911        Returns:
2912            True if pass; False if fail.
2913        """
2914        ads = self.android_devices
2915
2916        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
2917            1)
2918        if ((call_ab_id is None) or (call_ac_id is None)
2919                or (call_conf_id is None)):
2920            self.log.error("Failed to setup 3 way call.")
2921            return False
2922
2923        self.log.info("Verify no one dropped call.")
2924        time.sleep(WAIT_TIME_IN_CALL)
2925        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2926            return False
2927
2928        self.log.info("End call on PhoneB, and end call on PhoneC.")
2929        return self._test_1x_multi_call_drop_from_participant(
2930            ads[0], ads[1], ads[2])
2931
2932    @TelephonyBaseTest.tel_test_wrap
2933    @test_tracker_info(uuid="432549a9-e4bb-44d3-bd44-befffc1af02d")
2934    def test_1x_mt_mt_add_drop_held(self):
2935        """ Test 1x MT+MT call among three phones.
2936
2937        Steps:
2938        1. DUT in 1x idle, PhoneB and PhoneC idle.
2939        2. Call from PhoneB to DUT, accept on DUT.
2940        3. Call from PhoneC to DUT, accept on DUT.
2941        4. End call PhoneB, verify call continues on DUT and PhoneC.
2942        5. End call on PhoneC, verify call end on PhoneA.
2943
2944        Expected Results:
2945        4. PhoneB drop call, DUT and PhoneC call continues.
2946        5. PhoneC drop call, call also end on DUT.
2947
2948        Returns:
2949            True if pass; False if fail.
2950        """
2951        ads = self.android_devices
2952
2953        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
2954            0)
2955        if ((call_ab_id is None) or (call_ac_id is None)
2956                or (call_conf_id is None)):
2957            self.log.error("Failed to setup 3 way call.")
2958            return False
2959
2960        self.log.info("Verify no one dropped call.")
2961        time.sleep(WAIT_TIME_IN_CALL)
2962        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
2963            return False
2964
2965        self.log.info("End call on PhoneB, and end call on PhoneC.")
2966        return self._test_1x_multi_call_drop_from_participant(
2967            ads[0], ads[1], ads[2])
2968
2969    @TelephonyBaseTest.tel_test_wrap
2970    @test_tracker_info(uuid="c8f30fc1-8586-4eb0-854e-264989fd69b8")
2971    def test_1x_mt_mt_add_swap_twice_drop_held(self):
2972        """ Test 1x MT+MT call among three phones.
2973
2974        Steps:
2975        1. DUT in 1x idle, PhoneB and PhoneC idle.
2976        2. PhoneB call to DUT, answer on DUT.
2977        3. PhoneC call to DUT, answer on DUT
2978        4. Swap active call on DUT.
2979        5. Swap active call on DUT.
2980        6. Drop on PhoneB.
2981        7. Drop on PhoneC.
2982
2983        Expected Results:
2984        4. Swap call succeed.
2985        5. Swap call succeed.
2986        6. Call between DUT and PhoneC continues.
2987        7. All participant call end.
2988
2989        Returns:
2990            True if pass; False if fail.
2991        """
2992        ads = self.android_devices
2993
2994        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
2995            2)
2996        if ((call_ab_id is None) or (call_ac_id is None)
2997                or (call_conf_id is None)):
2998            self.log.error("Failed to setup 3 way call.")
2999            return False
3000
3001        self.log.info("Verify no one dropped call.")
3002        time.sleep(WAIT_TIME_IN_CALL)
3003        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
3004            return False
3005
3006        self.log.info("End call on PhoneB, and end call on PhoneC.")
3007        return self._test_1x_multi_call_drop_from_participant(
3008            ads[0], ads[1], ads[2])
3009
3010    @TelephonyBaseTest.tel_test_wrap
3011    @test_tracker_info(uuid="065ba51e-9843-4018-8009-7fdc6590011d")
3012    def test_1x_mt_mt_add_swap_once_drop_held(self):
3013        """ Test 1x MT+MT call among three phones.
3014
3015        Steps:
3016        1. DUT in 1x idle, PhoneB and PhoneC idle.
3017        2. PhoneB call to DUT, answer on DUT.
3018        3. PhoneC call to DUT, answer on DUT
3019        4. Swap active call on DUT.
3020        5. Drop on PhoneC.
3021        6. Drop on PhoneB.
3022
3023        Expected Results:
3024        4. Swap call succeed.
3025        5. Call between DUT and PhoneB continues.
3026        6. All participant call end.
3027
3028        Returns:
3029            True if pass; False if fail.
3030        """
3031        ads = self.android_devices
3032
3033        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
3034            1)
3035        if ((call_ab_id is None) or (call_ac_id is None)
3036                or (call_conf_id is None)):
3037            self.log.error("Failed to setup 3 way call.")
3038            return False
3039
3040        self.log.info("Verify no one dropped call.")
3041        time.sleep(WAIT_TIME_IN_CALL)
3042        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
3043            return False
3044
3045        self.log.info("End call on PhoneC, and end call on PhoneB.")
3046        return self._test_1x_multi_call_drop_from_participant(
3047            ads[0], ads[2], ads[1])
3048
3049    @TelephonyBaseTest.tel_test_wrap
3050    @test_tracker_info(uuid="69c69449-d430-4f00-ae19-c51242561ac9")
3051    def test_1x_mt_mt_add_drop_on_dut(self):
3052        """ Test 1x MT+MT call among three phones.
3053
3054        Steps:
3055        1. DUT in 1x idle, PhoneB and PhoneC idle.
3056        2. Call from PhoneB to DUT, accept on DUT.
3057        3. Call from PhoneC to DUT, accept on DUT.
3058        4. End call on DUT.
3059        5. End call on DUT.
3060
3061        Expected Results:
3062        4. DUT drop call, PhoneC also end. Then DUT receive callback from PhoneB.
3063        5. DUT drop call, call also end on PhoneB.
3064
3065        Returns:
3066            True if pass; False if fail.
3067        """
3068        ads = self.android_devices
3069
3070        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
3071            0)
3072        if ((call_ab_id is None) or (call_ac_id is None)
3073                or (call_conf_id is None)):
3074            self.log.error("Failed to setup 3 way call.")
3075            return False
3076
3077        self.log.info("Verify no one dropped call.")
3078        time.sleep(WAIT_TIME_IN_CALL)
3079        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
3080            return False
3081
3082        self.log.info("End call on DUT, DUT should receive callback.")
3083        return self._test_1x_multi_call_drop_from_host(ads[0], ads[2], ads[1])
3084
3085    @TelephonyBaseTest.tel_test_wrap
3086    @test_tracker_info(uuid="282583a3-d455-4caf-a184-718f8bbccb91")
3087    def test_1x_mt_mt_add_swap_twice_drop_on_dut(self):
3088        """ Test 1x MT+MT call among three phones.
3089
3090        Steps:
3091        1. DUT in 1x idle, PhoneB and PhoneC idle.
3092        2. PhoneB call to DUT, answer on DUT.
3093        3. PhoneC call to DUT, answer on DUT
3094        4. Swap active call on DUT.
3095        5. Swap active call on DUT.
3096        6. Drop current call on DUT.
3097        7. Drop current call on DUT.
3098
3099        Expected Results:
3100        4. Swap call succeed.
3101        5. Swap call succeed.
3102        6. DUT drop call, PhoneC also end. Then DUT receive callback from PhoneB.
3103        7. DUT drop call, call also end on PhoneB.
3104
3105        Returns:
3106            True if pass; False if fail.
3107        """
3108        ads = self.android_devices
3109
3110        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
3111            2)
3112        if ((call_ab_id is None) or (call_ac_id is None)
3113                or (call_conf_id is None)):
3114            self.log.error("Failed to setup 3 way call.")
3115            return False
3116
3117        self.log.info("Verify no one dropped call.")
3118        time.sleep(WAIT_TIME_IN_CALL)
3119        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
3120            return False
3121
3122        self.log.info("End call on DUT, DUT should receive callback.")
3123        return self._test_1x_multi_call_drop_from_host(ads[0], ads[2], ads[1])
3124
3125    @TelephonyBaseTest.tel_test_wrap
3126    @test_tracker_info(uuid="1cf83159-d230-41a4-842c-064be5ef11e6")
3127    def test_1x_mt_mt_add_swap_once_drop_on_dut(self):
3128        """ Test 1x MT+MT call among three phones.
3129
3130        Steps:
3131        1. DUT in 1x idle, PhoneB and PhoneC idle.
3132        2. PhoneB call to DUT, answer on DUT.
3133        3. PhoneC call to DUT, answer on DUT
3134        4. Swap active call on DUT.
3135        5. Drop current call on DUT.
3136        6. Drop current call on DUT.
3137
3138        Expected Results:
3139        4. Swap call succeed.
3140        5. DUT drop call, PhoneB also end. Then DUT receive callback from PhoneC.
3141        6. DUT drop call, call also end on PhoneC.
3142
3143        Returns:
3144            True if pass; False if fail.
3145        """
3146        ads = self.android_devices
3147
3148        call_ab_id, call_ac_id, call_conf_id = self._test_1x_mt_mt_add_swap_x(
3149            1)
3150        if ((call_ab_id is None) or (call_ac_id is None)
3151                or (call_conf_id is None)):
3152            self.log.error("Failed to setup 3 way call.")
3153            return False
3154
3155        self.log.info("Verify no one dropped call.")
3156        time.sleep(WAIT_TIME_IN_CALL)
3157        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
3158            return False
3159
3160        self.log.info("End call on DUT, DUT should receive callback.")
3161        return self._test_1x_multi_call_drop_from_host(ads[0], ads[1], ads[2])
3162
3163    @TelephonyBaseTest.tel_test_wrap
3164    @test_tracker_info(uuid="602db3cb-e02b-4e4c-9043-338e1231f51b")
3165    def test_volte_mo_mo_add_volte_merge_drop_second_call_from_participant_no_cep(
3166            self):
3167        """ Test VoLTE Conference Call among three phones. No CEP.
3168
3169        Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3170        Call from PhoneA (VoLTE) to PhoneC (VoLTE), accept on PhoneC.
3171        On PhoneA, merge to conference call (No CEP).
3172        End call on PhoneC, verify call continues.
3173        End call on PhoneB, verify call end on PhoneA.
3174
3175        Returns:
3176            True if pass; False if fail.
3177        """
3178        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(0)
3179        if call_ab_id is None or call_ac_id is None:
3180            return False
3181
3182        return self._test_ims_conference_merge_drop_second_call_from_participant(
3183            call_ab_id, call_ac_id)
3184
3185    @TelephonyBaseTest.tel_test_wrap
3186    @test_tracker_info(uuid="7c9ae738-9031-4a77-9ff7-356a186820a5")
3187    def test_volte_mo_mo_add_volte_merge_drop_second_call_from_participant_cep(
3188            self):
3189        """ Test VoLTE Conference Call among three phones. CEP enabled.
3190
3191        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3192        2. Call from PhoneA (VoLTE) to PhoneC (VoLTE), accept on PhoneC.
3193        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3194        4. End call on PhoneC, verify call continues.
3195        5. End call on PhoneB, verify call end on PhoneA.
3196
3197        Returns:
3198            True if pass; False if fail.
3199        """
3200        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(0)
3201        if call_ab_id is None or call_ac_id is None:
3202            return False
3203
3204        return self._test_ims_conference_merge_drop_second_call_from_participant(
3205            call_ab_id, call_ac_id)
3206
3207    @TelephonyBaseTest.tel_test_wrap
3208    @test_tracker_info(uuid="f50e7e94-0956-41c4-b02b-384a12668f10")
3209    def test_volte_mo_mo_add_volte_merge_drop_second_call_from_host_cep(self):
3210        """ Test VoLTE Conference Call among three phones. CEP enabled.
3211
3212        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3213        2. Call from PhoneA (VoLTE) to PhoneC (VoLTE), accept on PhoneC.
3214        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3215        4. On PhoneA disconnect call between A-C, verify call continues.
3216        5. On PhoneA disconnect call between A-B, verify call continues.
3217
3218        Returns:
3219            True if pass; False if fail.
3220        """
3221        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(0)
3222        if call_ab_id is None or call_ac_id is None:
3223            return False
3224
3225        return self._test_ims_conference_merge_drop_second_call_from_host(
3226            call_ab_id, call_ac_id)
3227
3228    @TelephonyBaseTest.tel_test_wrap
3229    @test_tracker_info(uuid="a6c22e39-fd7e-4bed-982a-145065572281")
3230    def test_volte_mo_mo_add_volte_merge_drop_first_call_from_participant_cep(
3231            self):
3232        """ Test VoLTE Conference Call among three phones. CEP enabled.
3233
3234        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3235        2. Call from PhoneA (VoLTE) to PhoneC (VoLTE), accept on PhoneC.
3236        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3237        4. End call on PhoneB, verify call continues.
3238        5. End call on PhoneC, verify call end on PhoneA.
3239
3240        Returns:
3241            True if pass; False if fail.
3242        """
3243        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(0)
3244        if call_ab_id is None or call_ac_id is None:
3245            return False
3246
3247        return self._test_ims_conference_merge_drop_first_call_from_participant(
3248            call_ab_id, call_ac_id)
3249
3250    @TelephonyBaseTest.tel_test_wrap
3251    @test_tracker_info(uuid="2188722a-31e3-4e46-8f74-6ea4cbc08476")
3252    def test_volte_mo_mo_add_volte_merge_drop_first_call_from_host_cep(self):
3253        """ Test VoLTE Conference Call among three phones. CEP enabled.
3254
3255        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3256        2. Call from PhoneA (VoLTE) to PhoneC (VoLTE), accept on PhoneC.
3257        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3258        4. On PhoneA disconnect call between A-B, verify call continues.
3259        5. On PhoneA disconnect call between A-C, verify call continues.
3260
3261        Returns:
3262            True if pass; False if fail.
3263        """
3264        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(0)
3265        if call_ab_id is None or call_ac_id is None:
3266            return False
3267
3268        return self._test_ims_conference_merge_drop_first_call_from_host(
3269            call_ab_id, call_ac_id)
3270
3271    @TelephonyBaseTest.tel_test_wrap
3272    @test_tracker_info(uuid="ef5ec1c9-7771-4289-ad94-08a80145d680")
3273    def test_volte_mo_mt_add_volte_merge_drop_second_call_from_participant_no_cep(
3274            self):
3275        """ Test VoLTE Conference Call among three phones. No CEP.
3276
3277        Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3278        Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3279        On PhoneA, merge to conference call (No CEP).
3280        End call on PhoneC, verify call continues.
3281        End call on PhoneB, verify call end on PhoneA.
3282
3283        Returns:
3284            True if pass; False if fail.
3285        """
3286        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(0)
3287        if call_ab_id is None or call_ac_id is None:
3288            return False
3289
3290        return self._test_ims_conference_merge_drop_second_call_from_participant(
3291            call_ab_id, call_ac_id)
3292
3293    @TelephonyBaseTest.tel_test_wrap
3294    @test_tracker_info(uuid="2111001d-c310-4eff-a6ef-201d199796ea")
3295    def test_volte_mo_mt_add_volte_merge_drop_second_call_from_participant_cep(
3296            self):
3297        """ Test VoLTE Conference Call among three phones. CEP enabled.
3298
3299        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3300        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3301        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3302        4. End call on PhoneC, verify call continues.
3303        5. End call on PhoneB, verify call end on PhoneA.
3304
3305        Returns:
3306            True if pass; False if fail.
3307        """
3308        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(0)
3309        if call_ab_id is None or call_ac_id is None:
3310            return False
3311
3312        return self._test_ims_conference_merge_drop_second_call_from_participant(
3313            call_ab_id, call_ac_id)
3314
3315    @TelephonyBaseTest.tel_test_wrap
3316    @test_tracker_info(uuid="eee3577b-5427-43ee-aff0-ed7f7846b41c")
3317    def test_volte_mo_mt_add_volte_merge_drop_second_call_from_host_cep(self):
3318        """ Test VoLTE Conference Call among three phones. CEP enabled.
3319
3320        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3321        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3322        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3323        4. On PhoneA disconnect call between A-C, verify call continues.
3324        5. On PhoneA disconnect call between A-B, verify call continues.
3325
3326        Returns:
3327            True if pass; False if fail.
3328        """
3329        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(0)
3330        if call_ab_id is None or call_ac_id is None:
3331            return False
3332
3333        return self._test_ims_conference_merge_drop_second_call_from_host(
3334            call_ab_id, call_ac_id)
3335
3336    @TelephonyBaseTest.tel_test_wrap
3337    @test_tracker_info(uuid="86faf200-be78-452d-8662-85e7f42a2d3b")
3338    def test_volte_mo_mt_add_volte_merge_drop_first_call_from_participant_cep(
3339            self):
3340        """ Test VoLTE Conference Call among three phones. CEP enabled.
3341
3342        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3343        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3344        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3345        4. End call on PhoneB, verify call continues.
3346        5. End call on PhoneC, verify call end on PhoneA.
3347
3348        Returns:
3349            True if pass; False if fail.
3350        """
3351        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(0)
3352        if call_ab_id is None or call_ac_id is None:
3353            return False
3354
3355        return self._test_ims_conference_merge_drop_first_call_from_participant(
3356            call_ab_id, call_ac_id)
3357
3358    @TelephonyBaseTest.tel_test_wrap
3359    @test_tracker_info(uuid="d0e18f3c-71a1-49c9-b3ad-b8c24f8a43ec")
3360    def test_volte_mo_mt_add_volte_merge_drop_first_call_from_host_cep(self):
3361        """ Test VoLTE Conference Call among three phones. CEP enabled.
3362
3363        1. Call from PhoneA (VoLTE) to PhoneB (VoLTE), accept on PhoneB.
3364        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3365        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3366        4. On PhoneA disconnect call between A-B, verify call continues.
3367        5. On PhoneA disconnect call between A-C, verify call continues.
3368
3369        Returns:
3370            True if pass; False if fail.
3371        """
3372        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(0)
3373        if call_ab_id is None or call_ac_id is None:
3374            return False
3375
3376        return self._test_ims_conference_merge_drop_first_call_from_host(
3377            call_ab_id, call_ac_id)
3378
3379    @TelephonyBaseTest.tel_test_wrap
3380    @test_tracker_info(uuid="b27d6b3d-b73b-4a20-a5ae-2990d73a07fe")
3381    def test_volte_mt_mt_add_volte_merge_drop_second_call_from_participant_no_cep(
3382            self):
3383        """ Test VoLTE Conference Call among three phones. No CEP.
3384
3385        Call from PhoneB (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3386        Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3387        On PhoneA, merge to conference call (No CEP).
3388        End call on PhoneC, verify call continues.
3389        End call on PhoneB, verify call end on PhoneA.
3390
3391        Returns:
3392            True if pass; False if fail.
3393        """
3394        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(0)
3395        if call_ab_id is None or call_ac_id is None:
3396            return False
3397
3398        return self._test_ims_conference_merge_drop_second_call_from_participant(
3399            call_ab_id, call_ac_id)
3400
3401    @TelephonyBaseTest.tel_test_wrap
3402    @test_tracker_info(uuid="f66e940c-30bd-48c7-b5e2-91147fa04ba2")
3403    def test_volte_mt_mt_add_volte_merge_drop_second_call_from_participant_cep(
3404            self):
3405        """ Test VoLTE Conference Call among three phones. CEP enabled.
3406
3407        1. Call from PhoneB (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3408        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3409        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3410        4. End call on PhoneC, verify call continues.
3411        5. End call on PhoneB, verify call end on PhoneA.
3412
3413        Returns:
3414            True if pass; False if fail.
3415        """
3416        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(0)
3417        if call_ab_id is None or call_ac_id is None:
3418            return False
3419
3420        return self._test_ims_conference_merge_drop_second_call_from_participant(
3421            call_ab_id, call_ac_id)
3422
3423    @TelephonyBaseTest.tel_test_wrap
3424    @test_tracker_info(uuid="ad313a8b-8bb0-43eb-a10e-e2c17f530ee4")
3425    def test_volte_mt_mt_add_volte_merge_drop_second_call_from_host_cep(self):
3426        """ Test VoLTE Conference Call among three phones. CEP enabled.
3427
3428        1. Call from PhoneB (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3429        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3430        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3431        4. On PhoneA disconnect call between A-C, verify call continues.
3432        5. On PhoneA disconnect call between A-B, verify call continues.
3433
3434        Returns:
3435            True if pass; False if fail.
3436        """
3437        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(0)
3438        if call_ab_id is None or call_ac_id is None:
3439            return False
3440
3441        return self._test_ims_conference_merge_drop_second_call_from_host(
3442            call_ab_id, call_ac_id)
3443
3444    @TelephonyBaseTest.tel_test_wrap
3445    @test_tracker_info(uuid="18b30c14-fef1-4055-8987-ee6137609b81")
3446    def test_volte_mt_mt_add_volte_merge_drop_first_call_from_participant_cep(
3447            self):
3448        """ Test VoLTE Conference Call among three phones. CEP enabled.
3449
3450        1. Call from PhoneB (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3451        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3452        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3453        4. End call on PhoneB, verify call continues.
3454        5. End call on PhoneC, verify call end on PhoneA.
3455
3456        Returns:
3457            True if pass; False if fail.
3458        """
3459        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(0)
3460        if call_ab_id is None or call_ac_id is None:
3461            return False
3462
3463        return self._test_ims_conference_merge_drop_first_call_from_participant(
3464            call_ab_id, call_ac_id)
3465
3466    @TelephonyBaseTest.tel_test_wrap
3467    @test_tracker_info(uuid="7dc24162-f06e-453b-93e6-926d31e6d387")
3468    def test_volte_mt_mt_add_volte_merge_drop_first_call_from_host_cep(self):
3469        """ Test VoLTE Conference Call among three phones. CEP enabled.
3470
3471        1. Call from PhoneB (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3472        2. Call from PhoneC (VoLTE) to PhoneA (VoLTE), accept on PhoneA.
3473        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3474        4. On PhoneA disconnect call between A-B, verify call continues.
3475        5. On PhoneA disconnect call between A-C, verify call continues.
3476
3477        Returns:
3478            True if pass; False if fail.
3479        """
3480        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(0)
3481        if call_ab_id is None or call_ac_id is None:
3482            return False
3483
3484        return self._test_ims_conference_merge_drop_first_call_from_host(
3485            call_ab_id, call_ac_id)
3486
3487    @TelephonyBaseTest.tel_test_wrap
3488    @test_tracker_info(uuid="eb90a56b-2085-4fde-a156-ada3620200df")
3489    def test_volte_mo_mo_add_wcdma_merge_drop_second_call_from_participant_no_cep(
3490            self):
3491        """ Test VoLTE Conference Call among three phones. No CEP.
3492
3493        Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3494        Call from PhoneA (VOLTE) to PhoneC (WCDMA), accept on PhoneC.
3495        On PhoneA, merge to conference call (No CEP).
3496        End call on PhoneC, verify call continues.
3497        End call on PhoneB, verify call end on PhoneA.
3498
3499        Returns:
3500            True if pass; False if fail.
3501        """
3502        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(0)
3503        if call_ab_id is None or call_ac_id is None:
3504            return False
3505
3506        return self._test_ims_conference_merge_drop_second_call_from_participant(
3507            call_ab_id, call_ac_id)
3508
3509    @TelephonyBaseTest.tel_test_wrap
3510    @test_tracker_info(uuid="ae999260-7856-41cc-bf4c-67b26e18c9a3")
3511    def test_volte_mo_mo_add_wcdma_merge_drop_second_call_from_participant_cep(
3512            self):
3513        """ Test VoLTE Conference Call among three phones. CEP enabled.
3514
3515        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3516        2. Call from PhoneA (VoLTE) to PhoneC (WCDMA), accept on PhoneC.
3517        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3518        4. End call on PhoneC, verify call continues.
3519        5. End call on PhoneB, verify call end on PhoneA.
3520
3521        Returns:
3522            True if pass; False if fail.
3523        """
3524        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(0)
3525        if call_ab_id is None or call_ac_id is None:
3526            return False
3527
3528        return self._test_ims_conference_merge_drop_second_call_from_participant(
3529            call_ab_id, call_ac_id)
3530
3531    @TelephonyBaseTest.tel_test_wrap
3532    @test_tracker_info(uuid="cd48de00-c1e5-4716-b232-3f1f98e89510")
3533    def test_volte_mo_mo_add_wcdma_merge_drop_second_call_from_host_cep(self):
3534        """ Test VoLTE Conference Call among three phones. CEP enabled.
3535
3536        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3537        2. Call from PhoneA (VoLTE) to PhoneC (WCDMA), accept on PhoneC.
3538        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3539        4. On PhoneA disconnect call between A-C, verify call continues.
3540        5. On PhoneA disconnect call between A-B, verify call continues.
3541
3542        Returns:
3543            True if pass; False if fail.
3544        """
3545        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(0)
3546        if call_ab_id is None or call_ac_id is None:
3547            return False
3548
3549        return self._test_ims_conference_merge_drop_second_call_from_host(
3550            call_ab_id, call_ac_id)
3551
3552    @TelephonyBaseTest.tel_test_wrap
3553    @test_tracker_info(uuid="a84ea6e8-dabc-4bab-b6d1-700b0a0fb9e9")
3554    def test_volte_mo_mo_add_wcdma_merge_drop_first_call_from_participant_cep(
3555            self):
3556        """ Test VoLTE Conference Call among three phones. CEP enabled.
3557
3558        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3559        2. Call from PhoneA (VoLTE) to PhoneC (WCDMA), accept on PhoneC.
3560        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3561        4. End call on PhoneB, verify call continues.
3562        5. End call on PhoneC, verify call end on PhoneA.
3563
3564        Returns:
3565            True if pass; False if fail.
3566        """
3567        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(0)
3568        if call_ab_id is None or call_ac_id is None:
3569            return False
3570
3571        return self._test_ims_conference_merge_drop_first_call_from_participant(
3572            call_ab_id, call_ac_id)
3573
3574    @TelephonyBaseTest.tel_test_wrap
3575    @test_tracker_info(uuid="7ac9a806-c608-42dd-a4fd-66b0ba535434")
3576    def test_volte_mo_mo_add_wcdma_merge_drop_first_call_from_host_cep(self):
3577        """ Test VoLTE Conference Call among three phones. CEP enabled.
3578
3579        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3580        2. Call from PhoneA (VoLTE) to PhoneC (WCDMA), accept on PhoneC.
3581        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3582        4. On PhoneA disconnect call between A-B, verify call continues.
3583        5. On PhoneA disconnect call between A-C, verify call continues.
3584
3585        Returns:
3586            True if pass; False if fail.
3587        """
3588        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(0)
3589        if call_ab_id is None or call_ac_id is None:
3590            return False
3591
3592        return self._test_ims_conference_merge_drop_first_call_from_host(
3593            call_ab_id, call_ac_id)
3594
3595    @TelephonyBaseTest.tel_test_wrap
3596    @test_tracker_info(uuid="35f9eb31-3a77-457c-aeb0-55a73c60dda1")
3597    def test_volte_mo_mt_add_wcdma_merge_drop_second_call_from_participant_no_cep(
3598            self):
3599        """ Test VoLTE Conference Call among three phones. No CEP.
3600
3601        Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3602        Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3603        On PhoneA, merge to conference call (No CEP).
3604        End call on PhoneC, verify call continues.
3605        End call on PhoneB, verify call end on PhoneA.
3606
3607        Returns:
3608            True if pass; False if fail.
3609        """
3610        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(0)
3611        if call_ab_id is None or call_ac_id is None:
3612            return False
3613
3614        return self._test_ims_conference_merge_drop_second_call_from_participant(
3615            call_ab_id, call_ac_id)
3616
3617    @TelephonyBaseTest.tel_test_wrap
3618    @test_tracker_info(uuid="f3314f74-e929-45ed-91cb-27c1c26e240f")
3619    def test_volte_mo_mt_add_wcdma_merge_drop_second_call_from_participant_cep(
3620            self):
3621        """ Test VoLTE Conference Call among three phones. CEP enabled.
3622
3623        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3624        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3625        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3626        4. End call on PhoneC, verify call continues.
3627        5. End call on PhoneB, verify call end on PhoneA.
3628
3629        Returns:
3630            True if pass; False if fail.
3631        """
3632        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(0)
3633        if call_ab_id is None or call_ac_id is None:
3634            return False
3635
3636        return self._test_ims_conference_merge_drop_second_call_from_participant(
3637            call_ab_id, call_ac_id)
3638
3639    @TelephonyBaseTest.tel_test_wrap
3640    @test_tracker_info(uuid="5e521ff1-505b-4d63-8b12-7b0187dea94b")
3641    def test_volte_mo_mt_add_wcdma_merge_drop_second_call_from_host_cep(self):
3642        """ Test VoLTE Conference Call among three phones. CEP enabled.
3643
3644        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3645        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3646        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3647        4. On PhoneA disconnect call between A-C, verify call continues.
3648        5. On PhoneA disconnect call between A-B, verify call continues.
3649
3650        Returns:
3651            True if pass; False if fail.
3652        """
3653        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(0)
3654        if call_ab_id is None or call_ac_id is None:
3655            return False
3656
3657        return self._test_ims_conference_merge_drop_second_call_from_host(
3658            call_ab_id, call_ac_id)
3659
3660    @TelephonyBaseTest.tel_test_wrap
3661    @test_tracker_info(uuid="d5732ea2-a657-40ea-bb30-151e53cf8058")
3662    def test_volte_mo_mt_add_wcdma_merge_drop_first_call_from_participant_cep(
3663            self):
3664        """ Test VoLTE Conference Call among three phones. CEP enabled.
3665
3666        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3667        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3668        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3669        4. End call on PhoneB, verify call continues.
3670        5. End call on PhoneC, verify call end on PhoneA.
3671
3672        Returns:
3673            True if pass; False if fail.
3674        """
3675        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(0)
3676        if call_ab_id is None or call_ac_id is None:
3677            return False
3678
3679        return self._test_ims_conference_merge_drop_first_call_from_participant(
3680            call_ab_id, call_ac_id)
3681
3682    @TelephonyBaseTest.tel_test_wrap
3683    @test_tracker_info(uuid="78e73444-3dde-465f-bf5e-dc48b40a93f3")
3684    def test_volte_mo_mt_add_wcdma_merge_drop_first_call_from_host_cep(self):
3685        """ Test VoLTE Conference Call among three phones. CEP enabled.
3686
3687        1. Call from PhoneA (VoLTE) to PhoneB (WCDMA), accept on PhoneB.
3688        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3689        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3690        4. On PhoneA disconnect call between A-B, verify call continues.
3691        5. On PhoneA disconnect call between A-C, verify call continues.
3692
3693        Returns:
3694            True if pass; False if fail.
3695        """
3696        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(0)
3697        if call_ab_id is None or call_ac_id is None:
3698            return False
3699
3700        return self._test_ims_conference_merge_drop_first_call_from_host(
3701            call_ab_id, call_ac_id)
3702
3703    @TelephonyBaseTest.tel_test_wrap
3704    @test_tracker_info(uuid="f4efbf04-b117-4508-ba86-0ef37481cc3a")
3705    def test_volte_mt_mt_add_wcdma_merge_drop_second_call_from_participant_no_cep(
3706            self):
3707        """ Test VoLTE Conference Call among three phones. No CEP.
3708
3709        Call from PhoneB (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3710        Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3711        On PhoneA, merge to conference call (No CEP).
3712        End call on PhoneC, verify call continues.
3713        End call on PhoneB, verify call end on PhoneA.
3714
3715        Returns:
3716            True if pass; False if fail.
3717        """
3718        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(0)
3719        if call_ab_id is None or call_ac_id is None:
3720            return False
3721
3722        return self._test_ims_conference_merge_drop_second_call_from_participant(
3723            call_ab_id, call_ac_id)
3724
3725    @TelephonyBaseTest.tel_test_wrap
3726    @test_tracker_info(uuid="064109cf-d166-448a-8655-81744ea37e05")
3727    def test_volte_mt_mt_add_wcdma_merge_drop_second_call_from_participant_cep(
3728            self):
3729        """ Test VoLTE Conference Call among three phones. CEP enabled.
3730
3731        1. Call from PhoneB (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3732        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3733        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3734        4. End call on PhoneC, verify call continues.
3735        5. End call on PhoneB, verify call end on PhoneA.
3736
3737        Returns:
3738            True if pass; False if fail.
3739        """
3740        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(0)
3741        if call_ab_id is None or call_ac_id is None:
3742            return False
3743
3744        return self._test_ims_conference_merge_drop_second_call_from_participant(
3745            call_ab_id, call_ac_id)
3746
3747    @TelephonyBaseTest.tel_test_wrap
3748    @test_tracker_info(uuid="bedd0576-5bb6-4fef-9700-f638cf742201")
3749    def test_volte_mt_mt_add_wcdma_merge_drop_second_call_from_host_cep(self):
3750        """ Test VoLTE Conference Call among three phones. CEP enabled.
3751
3752        1. Call from PhoneB (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3753        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3754        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3755        4. On PhoneA disconnect call between A-C, verify call continues.
3756        5. On PhoneA disconnect call between A-B, verify call continues.
3757
3758        Returns:
3759            True if pass; False if fail.
3760        """
3761        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(0)
3762        if call_ab_id is None or call_ac_id is None:
3763            return False
3764
3765        return self._test_ims_conference_merge_drop_second_call_from_host(
3766            call_ab_id, call_ac_id)
3767
3768    @TelephonyBaseTest.tel_test_wrap
3769    @test_tracker_info(uuid="46178387-a0dc-4e77-8ca4-06f731e1104f")
3770    def test_volte_mt_mt_add_wcdma_merge_drop_first_call_from_participant_cep(
3771            self):
3772        """ Test VoLTE Conference Call among three phones. CEP enabled.
3773
3774        1. Call from PhoneB (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3775        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3776        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3777        4. End call on PhoneB, verify call continues.
3778        5. End call on PhoneC, verify call end on PhoneA.
3779
3780        Returns:
3781            True if pass; False if fail.
3782        """
3783        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(0)
3784        if call_ab_id is None or call_ac_id is None:
3785            return False
3786
3787        return self._test_ims_conference_merge_drop_first_call_from_participant(
3788            call_ab_id, call_ac_id)
3789
3790    @TelephonyBaseTest.tel_test_wrap
3791    @test_tracker_info(uuid="a1d13168-078b-47d8-89f0-0798b085502d")
3792    def test_volte_mt_mt_add_wcdma_merge_drop_first_call_from_host_cep(self):
3793        """ Test VoLTE Conference Call among three phones. CEP enabled.
3794
3795        1. Call from PhoneB (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3796        2. Call from PhoneC (WCDMA) to PhoneA (VoLTE), accept on PhoneA.
3797        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3798        4. On PhoneA disconnect call between A-B, verify call continues.
3799        5. On PhoneA disconnect call between A-C, verify call continues.
3800
3801        Returns:
3802            True if pass; False if fail.
3803        """
3804        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(0)
3805        if call_ab_id is None or call_ac_id is None:
3806            return False
3807
3808        return self._test_ims_conference_merge_drop_first_call_from_host(
3809            call_ab_id, call_ac_id)
3810
3811    @TelephonyBaseTest.tel_test_wrap
3812    @test_tracker_info(uuid="08a26dc4-78e5-47cb-af75-9695453e82bb")
3813    def test_volte_mo_mo_add_1x_merge_drop_second_call_from_participant_no_cep(
3814            self):
3815        """ Test VoLTE Conference Call among three phones. No CEP.
3816
3817        Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3818        Call from PhoneA (VOLTE) to PhoneC (1x), accept on PhoneC.
3819        On PhoneA, merge to conference call (No CEP).
3820        End call on PhoneC, verify call continues.
3821        End call on PhoneB, verify call end on PhoneA.
3822
3823        Returns:
3824            True if pass; False if fail.
3825        """
3826        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(0)
3827        if call_ab_id is None or call_ac_id is None:
3828            return False
3829
3830        return self._test_ims_conference_merge_drop_second_call_from_participant(
3831            call_ab_id, call_ac_id)
3832
3833    @TelephonyBaseTest.tel_test_wrap
3834    @test_tracker_info(uuid="bde45028-b844-4192-89b1-8579941a03ed")
3835    def test_volte_mo_mo_add_1x_merge_drop_second_call_from_participant_cep(
3836            self):
3837        """ Test VoLTE Conference Call among three phones. CEP enabled.
3838
3839        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3840        2. Call from PhoneA (VoLTE) to PhoneC (1x), accept on PhoneC.
3841        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3842        4. End call on PhoneC, verify call continues.
3843        5. End call on PhoneB, verify call end on PhoneA.
3844
3845        Returns:
3846            True if pass; False if fail.
3847        """
3848        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(0)
3849        if call_ab_id is None or call_ac_id is None:
3850            return False
3851
3852        return self._test_ims_conference_merge_drop_second_call_from_participant(
3853            call_ab_id, call_ac_id)
3854
3855    @TelephonyBaseTest.tel_test_wrap
3856    @test_tracker_info(uuid="f38d3031-d7f1-4990-bce3-9c329beb5eeb")
3857    def test_volte_mo_mo_add_1x_merge_drop_second_call_from_host_cep(self):
3858        """ Test VoLTE Conference Call among three phones. CEP enabled.
3859
3860        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3861        2. Call from PhoneA (VoLTE) to PhoneC (1x), accept on PhoneC.
3862        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3863        4. On PhoneA disconnect call between A-C, verify call continues.
3864        5. On PhoneA disconnect call between A-B, verify call continues.
3865
3866        Returns:
3867            True if pass; False if fail.
3868        """
3869        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(0)
3870        if call_ab_id is None or call_ac_id is None:
3871            return False
3872
3873        return self._test_ims_conference_merge_drop_second_call_from_host(
3874            call_ab_id, call_ac_id)
3875
3876    @TelephonyBaseTest.tel_test_wrap
3877    @test_tracker_info(uuid="d1391513-8592-4159-81b7-16cb10c406e8")
3878    def test_volte_mo_mo_add_1x_merge_drop_first_call_from_participant_cep(
3879            self):
3880        """ Test VoLTE Conference Call among three phones. CEP enabled.
3881
3882        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3883        2. Call from PhoneA (VoLTE) to PhoneC (1x), accept on PhoneC.
3884        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3885        4. End call on PhoneB, verify call continues.
3886        5. End call on PhoneC, verify call end on PhoneA.
3887
3888        Returns:
3889            True if pass; False if fail.
3890        """
3891        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(0)
3892        if call_ab_id is None or call_ac_id is None:
3893            return False
3894
3895        return self._test_ims_conference_merge_drop_first_call_from_participant(
3896            call_ab_id, call_ac_id)
3897
3898    @TelephonyBaseTest.tel_test_wrap
3899    @test_tracker_info(uuid="e05c261e-e99a-4ca7-a8db-9ad982e06913")
3900    def test_volte_mo_mo_add_1x_merge_drop_first_call_from_host_cep(self):
3901        """ Test VoLTE Conference Call among three phones. CEP enabled.
3902
3903        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3904        2. Call from PhoneA (VoLTE) to PhoneC (1x), accept on PhoneC.
3905        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3906        4. On PhoneA disconnect call between A-B, verify call continues.
3907        5. On PhoneA disconnect call between A-C, verify call continues.
3908
3909        Returns:
3910            True if pass; False if fail.
3911        """
3912        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(0)
3913        if call_ab_id is None or call_ac_id is None:
3914            return False
3915
3916        return self._test_ims_conference_merge_drop_first_call_from_host(
3917            call_ab_id, call_ac_id)
3918
3919    @TelephonyBaseTest.tel_test_wrap
3920    @test_tracker_info(uuid="f4329201-a388-4070-9225-37d4c8045096")
3921    def test_volte_mo_mt_add_1x_merge_drop_second_call_from_participant_no_cep(
3922            self):
3923        """ Test VoLTE Conference Call among three phones. No CEP.
3924
3925        Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3926        Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
3927        On PhoneA, merge to conference call (No CEP).
3928        End call on PhoneC, verify call continues.
3929        End call on PhoneB, verify call end on PhoneA.
3930
3931        Returns:
3932            True if pass; False if fail.
3933        """
3934        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(0)
3935        if call_ab_id is None or call_ac_id is None:
3936            return False
3937
3938        return self._test_ims_conference_merge_drop_second_call_from_participant(
3939            call_ab_id, call_ac_id)
3940
3941    @TelephonyBaseTest.tel_test_wrap
3942    @test_tracker_info(uuid="fafa96ef-649a-4ff7-8fed-d4bfd6d88c2e")
3943    def test_volte_mo_mt_add_1x_merge_drop_second_call_from_participant_cep(
3944            self):
3945        """ Test VoLTE Conference Call among three phones. CEP enabled.
3946
3947        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3948        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
3949        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3950        4. End call on PhoneC, verify call continues.
3951        5. End call on PhoneB, verify call end on PhoneA.
3952
3953        Returns:
3954            True if pass; False if fail.
3955        """
3956        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(0)
3957        if call_ab_id is None or call_ac_id is None:
3958            return False
3959
3960        return self._test_ims_conference_merge_drop_second_call_from_participant(
3961            call_ab_id, call_ac_id)
3962
3963    @TelephonyBaseTest.tel_test_wrap
3964    @test_tracker_info(uuid="66d79e0b-879d-461c-bf5d-b27495f73754")
3965    def test_volte_mo_mt_add_1x_merge_drop_second_call_from_host_cep(self):
3966        """ Test VoLTE Conference Call among three phones. CEP enabled.
3967
3968        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3969        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
3970        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3971        4. On PhoneA disconnect call between A-C, verify call continues.
3972        5. On PhoneA disconnect call between A-B, verify call continues.
3973
3974        Returns:
3975            True if pass; False if fail.
3976        """
3977        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(0)
3978        if call_ab_id is None or call_ac_id is None:
3979            return False
3980
3981        return self._test_ims_conference_merge_drop_second_call_from_host(
3982            call_ab_id, call_ac_id)
3983
3984    @TelephonyBaseTest.tel_test_wrap
3985    @test_tracker_info(uuid="a5f2a3d0-9b00-4496-8316-ea626b1c978a")
3986    def test_volte_mo_mt_add_1x_merge_drop_first_call_from_participant_cep(
3987            self):
3988        """ Test VoLTE Conference Call among three phones. CEP enabled.
3989
3990        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
3991        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
3992        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
3993        4. End call on PhoneB, verify call continues.
3994        5. End call on PhoneC, verify call end on PhoneA.
3995
3996        Returns:
3997            True if pass; False if fail.
3998        """
3999        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(0)
4000        if call_ab_id is None or call_ac_id is None:
4001            return False
4002
4003        return self._test_ims_conference_merge_drop_first_call_from_participant(
4004            call_ab_id, call_ac_id)
4005
4006    @TelephonyBaseTest.tel_test_wrap
4007    @test_tracker_info(uuid="98cfd8d8-200f-4820-94ed-1561df1ed152")
4008    def test_volte_mo_mt_add_1x_merge_drop_first_call_from_host_cep(self):
4009        """ Test VoLTE Conference Call among three phones. CEP enabled.
4010
4011        1. Call from PhoneA (VoLTE) to PhoneB (1x), accept on PhoneB.
4012        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
4013        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
4014        4. On PhoneA disconnect call between A-B, verify call continues.
4015        5. On PhoneA disconnect call between A-C, verify call continues.
4016
4017        Returns:
4018            True if pass; False if fail.
4019        """
4020        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(0)
4021        if call_ab_id is None or call_ac_id is None:
4022            return False
4023
4024        return self._test_ims_conference_merge_drop_first_call_from_host(
4025            call_ab_id, call_ac_id)
4026
4027    @TelephonyBaseTest.tel_test_wrap
4028    @test_tracker_info(uuid="c9ee6bb1-4aee-4fc9-95b0-f899d3d31d82")
4029    def test_volte_mt_mt_add_1x_merge_drop_second_call_from_participant_no_cep(
4030            self):
4031        """ Test VoLTE Conference Call among three phones. No CEP.
4032
4033        Call from PhoneB (1x) to PhoneA (VoLTE), accept on PhoneA.
4034        Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
4035        On PhoneA, merge to conference call (No CEP).
4036        End call on PhoneC, verify call continues.
4037        End call on PhoneB, verify call end on PhoneA.
4038
4039        Returns:
4040            True if pass; False if fail.
4041        """
4042        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(0)
4043        if call_ab_id is None or call_ac_id is None:
4044            return False
4045
4046        return self._test_ims_conference_merge_drop_second_call_from_participant(
4047            call_ab_id, call_ac_id)
4048
4049    @TelephonyBaseTest.tel_test_wrap
4050    @test_tracker_info(uuid="f4fb92a1-d4a0-4796-bdb4-f441b926c63c")
4051    def test_volte_mt_mt_add_1x_merge_drop_second_call_from_participant_cep(
4052            self):
4053        """ Test VoLTE Conference Call among three phones. CEP enabled.
4054
4055        1. Call from PhoneB (1x) to PhoneA (VoLTE), accept on PhoneA.
4056        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
4057        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
4058        4. End call on PhoneC, verify call continues.
4059        5. End call on PhoneB, verify call end on PhoneA.
4060
4061        Returns:
4062            True if pass; False if fail.
4063        """
4064        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(0)
4065        if call_ab_id is None or call_ac_id is None:
4066            return False
4067
4068        return self._test_ims_conference_merge_drop_second_call_from_participant(
4069            call_ab_id, call_ac_id)
4070
4071    @TelephonyBaseTest.tel_test_wrap
4072    @test_tracker_info(uuid="8ad0e672-83cc-463a-aa12-d331faa5eb17")
4073    def test_volte_mt_mt_add_1x_merge_drop_second_call_from_host_cep(self):
4074        """ Test VoLTE Conference Call among three phones. CEP enabled.
4075
4076        1. Call from PhoneB (1x) to PhoneA (VoLTE), accept on PhoneA.
4077        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
4078        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
4079        4. On PhoneA disconnect call between A-C, verify call continues.
4080        5. On PhoneA disconnect call between A-B, verify call continues.
4081
4082        Returns:
4083            True if pass; False if fail.
4084        """
4085        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(0)
4086        if call_ab_id is None or call_ac_id is None:
4087            return False
4088
4089        return self._test_ims_conference_merge_drop_second_call_from_host(
4090            call_ab_id, call_ac_id)
4091
4092    @TelephonyBaseTest.tel_test_wrap
4093    @test_tracker_info(uuid="3dad2fd1-d2c0-477c-a758-3c054df6e92a")
4094    def test_volte_mt_mt_add_1x_merge_drop_first_call_from_participant_cep(
4095            self):
4096        """ Test VoLTE Conference Call among three phones. CEP enabled.
4097
4098        1. Call from PhoneB (1x) to PhoneA (VoLTE), accept on PhoneA.
4099        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
4100        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
4101        4. End call on PhoneB, verify call continues.
4102        5. End call on PhoneC, verify call end on PhoneA.
4103
4104        Returns:
4105            True if pass; False if fail.
4106        """
4107        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(0)
4108        if call_ab_id is None or call_ac_id is None:
4109            return False
4110
4111        return self._test_ims_conference_merge_drop_first_call_from_participant(
4112            call_ab_id, call_ac_id)
4113
4114    @TelephonyBaseTest.tel_test_wrap
4115    @test_tracker_info(uuid="e382469b-8767-47fd-b3e6-8c81d8fb45ef")
4116    def test_volte_mt_mt_add_1x_merge_drop_first_call_from_host_cep(self):
4117        """ Test VoLTE Conference Call among three phones. CEP enabled.
4118
4119        1. Call from PhoneB (1x) to PhoneA (VoLTE), accept on PhoneA.
4120        2. Call from PhoneC (1x) to PhoneA (VoLTE), accept on PhoneA.
4121        3. On PhoneA, merge to conference call (VoLTE CEP conference call).
4122        4. On PhoneA disconnect call between A-B, verify call continues.
4123        5. On PhoneA disconnect call between A-C, verify call continues.
4124
4125        Returns:
4126            True if pass; False if fail.
4127        """
4128        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(0)
4129        if call_ab_id is None or call_ac_id is None:
4130            return False
4131
4132        return self._test_ims_conference_merge_drop_first_call_from_host(
4133            call_ab_id, call_ac_id)
4134
4135    @TelephonyBaseTest.tel_test_wrap
4136    @test_tracker_info(uuid="98db2430-07c2-4ec7-8644-2aa081a3eb22")
4137    def test_volte_mo_mo_add_volte_swap_twice_drop_held(self):
4138        """Test swap feature in VoLTE call.
4139
4140        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4141        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4142        Swap active call on PhoneA.
4143        Swap active call on PhoneA.
4144        Hangup call from PhoneB, check if call continues between AC.
4145
4146        """
4147        ads = self.android_devices
4148
4149        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4150        if call_ab_id is None or call_ac_id is None:
4151            return False
4152
4153        return self._three_phone_hangup_call_verify_call_state(
4154            ad_hangup=ads[1],
4155            ad_verify=ads[0],
4156            call_id=call_ac_id,
4157            call_state=CALL_STATE_ACTIVE,
4158            ads_active=[ads[0], ads[2]])
4159
4160    @TelephonyBaseTest.tel_test_wrap
4161    @test_tracker_info(uuid="7504958b-172b-4afc-97ea-9562b8429dfe")
4162    def test_volte_mo_mo_add_volte_swap_twice_drop_active(self):
4163        """Test swap feature in VoLTE call.
4164
4165        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4166        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4167        Swap active call on PhoneA.
4168        Swap active call on PhoneA.
4169        Hangup call from PhoneC, check if call continues between AB.
4170
4171        """
4172        ads = self.android_devices
4173
4174        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4175        if call_ab_id is None or call_ac_id is None:
4176            return False
4177
4178        return self._three_phone_hangup_call_verify_call_state(
4179            ad_hangup=ads[2],
4180            ad_verify=ads[0],
4181            call_id=call_ab_id,
4182            call_state=self._get_expected_call_state(ads[0]),
4183            ads_active=[ads[0], ads[1]])
4184
4185    @TelephonyBaseTest.tel_test_wrap
4186    @test_tracker_info(uuid="ac02ce22-fd8c-48ba-9e68-6748d1e48c68")
4187    def test_volte_mo_mt_add_volte_swap_twice_drop_held(self):
4188        """Test swap feature in VoLTE call.
4189
4190        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4191        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
4192        Swap active call on PhoneA.
4193        Swap active call on PhoneA.
4194        Hangup call from PhoneB, check if call continues between AC.
4195
4196        """
4197        ads = self.android_devices
4198
4199        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
4200        if call_ab_id is None or call_ac_id is None:
4201            return False
4202
4203        return self._three_phone_hangup_call_verify_call_state(
4204            ad_hangup=ads[1],
4205            ad_verify=ads[0],
4206            call_id=call_ac_id,
4207            call_state=CALL_STATE_ACTIVE,
4208            ads_active=[ads[0], ads[2]])
4209
4210    @TelephonyBaseTest.tel_test_wrap
4211    @test_tracker_info(uuid="2fb2c4f6-1c14-4122-bc3e-a7a6416003a3")
4212    def test_volte_mo_mt_add_volte_swap_twice_drop_active(self):
4213        """Test swap feature in VoLTE call.
4214
4215        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4216        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
4217        Swap active call on PhoneA.
4218        Swap active call on PhoneA.
4219        Hangup call from PhoneC, check if call continues between AB.
4220
4221        """
4222        ads = self.android_devices
4223
4224        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
4225        if call_ab_id is None or call_ac_id is None:
4226            return False
4227
4228        return self._three_phone_hangup_call_verify_call_state(
4229            ad_hangup=ads[2],
4230            ad_verify=ads[0],
4231            call_id=call_ab_id,
4232            call_state=self._get_expected_call_state(ads[0]),
4233            ads_active=[ads[0], ads[1]])
4234
4235    @TelephonyBaseTest.tel_test_wrap
4236    @test_tracker_info(uuid="deed9c13-2e9d-464a-b8f7-62e91265451d")
4237    def test_volte_mo_mo_add_volte_swap_once_drop_held(self):
4238        """Test swap feature in VoLTE call.
4239
4240        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4241        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4242        Swap active call on PhoneA.
4243        Hangup call from PhoneC, check if call continues between AB.
4244
4245        """
4246        ads = self.android_devices
4247
4248        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4249        if call_ab_id is None or call_ac_id is None:
4250            return False
4251
4252        return self._three_phone_hangup_call_verify_call_state(
4253            ad_hangup=ads[2],
4254            ad_verify=ads[0],
4255            call_id=call_ab_id,
4256            call_state=CALL_STATE_ACTIVE,
4257            ads_active=[ads[0], ads[1]])
4258
4259    @TelephonyBaseTest.tel_test_wrap
4260    @test_tracker_info(uuid="3324a4d3-68db-41a4-b0d0-3e8e82b84f46")
4261    def test_volte_mo_mo_add_volte_swap_once_drop_active(self):
4262        """Test swap feature in VoLTE call.
4263
4264        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4265        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4266        Swap active call on PhoneA.
4267        Swap active call on PhoneA.
4268        Hangup call from PhoneB, check if call continues between AC.
4269
4270        """
4271        ads = self.android_devices
4272
4273        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4274        if call_ab_id is None or call_ac_id is None:
4275            return False
4276
4277        return self._three_phone_hangup_call_verify_call_state(
4278            ad_hangup=ads[1],
4279            ad_verify=ads[0],
4280            call_id=call_ac_id,
4281            call_state=self._get_expected_call_state(ads[0]),
4282            ads_active=[ads[0], ads[2]])
4283
4284    @TelephonyBaseTest.tel_test_wrap
4285    @test_tracker_info(uuid="57c8c3f6-c690-41c3-aaed-98e5548cc4b6")
4286    def test_volte_mo_mt_add_volte_swap_once_drop_held(self):
4287        """Test swap feature in VoLTE call.
4288
4289        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4290        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
4291        Swap active call on PhoneA.
4292        Hangup call from PhoneC, check if call continues between AB.
4293
4294        """
4295        ads = self.android_devices
4296
4297        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
4298        if call_ab_id is None or call_ac_id is None:
4299            return False
4300        return self._three_phone_hangup_call_verify_call_state(
4301            ad_hangup=ads[2],
4302            ad_verify=ads[0],
4303            call_id=call_ab_id,
4304            call_state=CALL_STATE_ACTIVE,
4305            ads_active=[ads[0], ads[1]])
4306
4307    @TelephonyBaseTest.tel_test_wrap
4308    @test_tracker_info(uuid="96376148-f069-41f9-b22f-f5240de427f7")
4309    def test_volte_mo_mt_add_volte_swap_once_drop_active(self):
4310        """Test swap feature in VoLTE call.
4311
4312        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4313        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
4314        Swap active call on PhoneA.
4315        Hangup call from PhoneB, check if call continues between AC.
4316
4317        """
4318        ads = self.android_devices
4319
4320        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
4321        if call_ab_id is None or call_ac_id is None:
4322            return False
4323
4324        return self._three_phone_hangup_call_verify_call_state(
4325            ad_hangup=ads[1],
4326            ad_verify=ads[0],
4327            call_id=call_ac_id,
4328            call_state=self._get_expected_call_state(ads[0]),
4329            ads_active=[ads[0], ads[2]])
4330
4331    @TelephonyBaseTest.tel_test_wrap
4332    @test_tracker_info(uuid="baac4ef4-198b-4a33-a09a-5507c6aa740d")
4333    def test_wcdma_mo_mo_add_swap_twice_drop_held(self):
4334        """Test swap feature in WCDMA call.
4335
4336        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4337        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
4338        Swap active call on PhoneA.
4339        Swap active call on PhoneA.
4340        Hangup call from PhoneB, check if call continues between AC.
4341
4342        """
4343        ads = self.android_devices
4344
4345        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(2)
4346        if call_ab_id is None or call_ac_id is None:
4347            return False
4348
4349        return self._three_phone_hangup_call_verify_call_state(
4350            ad_hangup=ads[1],
4351            ad_verify=ads[0],
4352            call_id=call_ac_id,
4353            call_state=CALL_STATE_ACTIVE,
4354            ads_active=[ads[0], ads[2]])
4355
4356    @TelephonyBaseTest.tel_test_wrap
4357    @test_tracker_info(uuid="8c2588ff-3857-49eb-8db0-9e76d7c99c68")
4358    def test_wcdma_mo_mo_add_swap_twice_drop_active(self):
4359        """Test swap feature in WCDMA call.
4360
4361        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4362        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
4363        Swap active call on PhoneA.
4364        Swap active call on PhoneA.
4365        Hangup call from PhoneC, check if call continues between AB.
4366
4367        """
4368        ads = self.android_devices
4369
4370        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(2)
4371        if call_ab_id is None or call_ac_id is None:
4372            return False
4373
4374        return self._three_phone_hangup_call_verify_call_state(
4375            ad_hangup=ads[2],
4376            ad_verify=ads[0],
4377            call_id=call_ab_id,
4378            call_state=self._get_expected_call_state(ads[0]),
4379            ads_active=[ads[0], ads[1]])
4380
4381    @TelephonyBaseTest.tel_test_wrap
4382    @test_tracker_info(uuid="16a6aa3c-fe68-41b4-af42-75847062d4ec")
4383    def test_wcdma_mo_mt_add_swap_twice_drop_held(self):
4384        """Test swap feature in WCDMA call.
4385
4386        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4387        PhoneC call PhoneA (WCDMA), accept on PhoneA.
4388        Swap active call on PhoneA.
4389        Swap active call on PhoneA.
4390        Hangup call from PhoneB, check if call continues between AC.
4391
4392        """
4393        ads = self.android_devices
4394
4395        call_ab_id, call_ac_id = self._test_wcdma_mo_mt_add_swap_x(2)
4396        if call_ab_id is None or call_ac_id is None:
4397            return False
4398
4399        return self._three_phone_hangup_call_verify_call_state(
4400            ad_hangup=ads[1],
4401            ad_verify=ads[0],
4402            call_id=call_ac_id,
4403            call_state=CALL_STATE_ACTIVE,
4404            ads_active=[ads[0], ads[2]])
4405
4406    @TelephonyBaseTest.tel_test_wrap
4407    @test_tracker_info(uuid="f38c4cd5-53b4-43d0-a5fa-2a008a96cedc")
4408    def test_wcdma_mo_mt_add_swap_twice_drop_active(self):
4409        """Test swap feature in WCDMA call.
4410
4411        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4412        PhoneC call PhoneA (WCDMA), accept on PhoneA.
4413        Swap active call on PhoneA.
4414        Swap active call on PhoneA.
4415        Hangup call from PhoneC, check if call continues between AB.
4416
4417        """
4418        ads = self.android_devices
4419
4420        call_ab_id, call_ac_id = self._test_wcdma_mo_mt_add_swap_x(2)
4421        if call_ab_id is None or call_ac_id is None:
4422            return False
4423
4424        return self._three_phone_hangup_call_verify_call_state(
4425            ad_hangup=ads[2],
4426            ad_verify=ads[0],
4427            call_id=call_ab_id,
4428            call_state=self._get_expected_call_state(ads[0]),
4429            ads_active=[ads[0], ads[1]])
4430
4431    @TelephonyBaseTest.tel_test_wrap
4432    @test_tracker_info(uuid="734689e8-2acd-405f-be93-db62e2606252")
4433    def test_wcdma_mo_mo_add_swap_once_drop_held(self):
4434        """Test swap feature in WCDMA call.
4435
4436        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4437        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
4438        Swap active call on PhoneA.
4439        Hangup call from PhoneC, check if call continues between AB.
4440
4441        """
4442        ads = self.android_devices
4443
4444        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(1)
4445        if call_ab_id is None or call_ac_id is None:
4446            return False
4447
4448        return self._three_phone_hangup_call_verify_call_state(
4449            ad_hangup=ads[2],
4450            ad_verify=ads[0],
4451            call_id=call_ab_id,
4452            call_state=CALL_STATE_ACTIVE,
4453            ads_active=[ads[0], ads[1]])
4454
4455    @TelephonyBaseTest.tel_test_wrap
4456    @test_tracker_info(uuid="126f294e-590a-4392-8fbd-1b826cd97214")
4457    def test_wcdma_mo_mo_add_swap_once_drop_active(self):
4458        """Test swap feature in WCDMA call.
4459
4460        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4461        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
4462        Swap active call on PhoneA.
4463        Hangup call from PhoneB, check if call continues between AC.
4464
4465        """
4466        ads = self.android_devices
4467
4468        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(1)
4469        if call_ab_id is None or call_ac_id is None:
4470            return False
4471
4472        return self._three_phone_hangup_call_verify_call_state(
4473            ad_hangup=ads[1],
4474            ad_verify=ads[0],
4475            call_id=call_ac_id,
4476            call_state=self._get_expected_call_state(ads[0]),
4477            ads_active=[ads[0], ads[2]])
4478
4479    @TelephonyBaseTest.tel_test_wrap
4480    @test_tracker_info(uuid="e5f36f28-ec2b-4958-8578-c0454ef2a8ad")
4481    def test_wcdma_mo_mt_add_swap_once_drop_held(self):
4482        """Test swap feature in WCDMA call.
4483
4484        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4485        PhoneC call PhoneA (WCDMA), accept on PhoneA.
4486        Swap active call on PhoneA.
4487        Hangup call from PhoneC, check if call continues between AB.
4488
4489        """
4490        ads = self.android_devices
4491
4492        call_ab_id, call_ac_id = self._test_wcdma_mo_mt_add_swap_x(1)
4493        if call_ab_id is None or call_ac_id is None:
4494            return False
4495
4496        return self._three_phone_hangup_call_verify_call_state(
4497            ad_hangup=ads[2],
4498            ad_verify=ads[0],
4499            call_id=call_ab_id,
4500            call_state=CALL_STATE_ACTIVE,
4501            ads_active=[ads[0], ads[1]])
4502
4503    @TelephonyBaseTest.tel_test_wrap
4504    @test_tracker_info(uuid="a2252ebe-3ee2-4b9e-b76b-6be68d6b2719")
4505    def test_wcdma_mo_mt_add_swap_once_drop_active(self):
4506        """Test swap feature in WCDMA call.
4507
4508        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
4509        PhoneC call PhoneA (WCDMA), accept on PhoneA.
4510        Swap active call on PhoneA.
4511        Hangup call from PhoneB, check if call continues between AC.
4512
4513        """
4514        ads = self.android_devices
4515
4516        call_ab_id, call_ac_id = self._test_wcdma_mo_mt_add_swap_x(1)
4517        if call_ab_id is None or call_ac_id is None:
4518            return False
4519
4520        return self._three_phone_hangup_call_verify_call_state(
4521            ad_hangup=ads[1],
4522            ad_verify=ads[0],
4523            call_id=call_ac_id,
4524            call_state=self._get_expected_call_state(ads[0]),
4525            ads_active=[ads[0], ads[2]])
4526
4527    @TelephonyBaseTest.tel_test_wrap
4528    @test_tracker_info(uuid="cba48f87-4026-422d-a760-f913d2763ee9")
4529    def test_csfb_wcdma_mo_mo_add_swap_twice_drop_held(self):
4530        """Test swap feature in CSFB WCDMA call.
4531
4532        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4533        PhoneA (CSFB WCDMA) call PhoneC, accept on PhoneC.
4534        Swap active call on PhoneA.
4535        Swap active call on PhoneA.
4536        Hangup call from PhoneB, check if call continues between AC.
4537
4538        """
4539        ads = self.android_devices
4540
4541        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mo_add_swap_x(2)
4542        if call_ab_id is None or call_ac_id is None:
4543            return False
4544
4545        return self._three_phone_hangup_call_verify_call_state(
4546            ad_hangup=ads[1],
4547            ad_verify=ads[0],
4548            call_id=call_ac_id,
4549            call_state=CALL_STATE_ACTIVE,
4550            ads_active=[ads[0], ads[2]])
4551
4552    @TelephonyBaseTest.tel_test_wrap
4553    @test_tracker_info(uuid="3e6bd083-ccae-4962-a3d7-4194ed685b64")
4554    def test_csfb_wcdma_mo_mo_add_swap_twice_drop_active(self):
4555        """Test swap feature in CSFB WCDMA call.
4556
4557        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4558        PhoneA (CSFB WCDMA) call PhoneC, accept on PhoneC.
4559        Swap active call on PhoneA.
4560        Swap active call on PhoneA.
4561        Hangup call from PhoneC, check if call continues between AB.
4562
4563        """
4564        ads = self.android_devices
4565
4566        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mo_add_swap_x(2)
4567        if call_ab_id is None or call_ac_id is None:
4568            return False
4569
4570        return self._three_phone_hangup_call_verify_call_state(
4571            ad_hangup=ads[2],
4572            ad_verify=ads[0],
4573            call_id=call_ab_id,
4574            call_state=self._get_expected_call_state(ads[0]),
4575            ads_active=[ads[0], ads[1]])
4576
4577    @TelephonyBaseTest.tel_test_wrap
4578    @test_tracker_info(uuid="a1972846-0bca-4583-a966-11ebf0670c04")
4579    def test_csfb_wcdma_mo_mt_add_swap_twice_drop_held(self):
4580        """Test swap feature in CSFB WCDMA call.
4581
4582        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4583        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
4584        Swap active call on PhoneA.
4585        Swap active call on PhoneA.
4586        Hangup call from PhoneB, check if call continues between AC.
4587
4588        """
4589        ads = self.android_devices
4590
4591        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mt_add_swap_x(2)
4592        if call_ab_id is None or call_ac_id is None:
4593            return False
4594
4595        return self._three_phone_hangup_call_verify_call_state(
4596            ad_hangup=ads[1],
4597            ad_verify=ads[0],
4598            call_id=call_ac_id,
4599            call_state=CALL_STATE_ACTIVE,
4600            ads_active=[ads[0], ads[2]])
4601
4602    @TelephonyBaseTest.tel_test_wrap
4603    @test_tracker_info(uuid="98609dfd-07fb-4414-bf6e-46144205fe70")
4604    def test_csfb_wcdma_mo_mt_add_swap_twice_drop_active(self):
4605        """Test swap feature in CSFB WCDMA call.
4606
4607        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4608        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
4609        Swap active call on PhoneA.
4610        Swap active call on PhoneA.
4611        Hangup call from PhoneC, check if call continues between AB.
4612
4613        """
4614        ads = self.android_devices
4615
4616        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mt_add_swap_x(2)
4617        if call_ab_id is None or call_ac_id is None:
4618            return False
4619
4620        return self._three_phone_hangup_call_verify_call_state(
4621            ad_hangup=ads[2],
4622            ad_verify=ads[0],
4623            call_id=call_ab_id,
4624            call_state=self._get_expected_call_state(ads[0]),
4625            ads_active=[ads[0], ads[1]])
4626
4627    @TelephonyBaseTest.tel_test_wrap
4628    @test_tracker_info(uuid="0c4c9b0b-ef7a-4e3d-9d31-dde721444820")
4629    def test_csfb_wcdma_mo_mo_add_swap_once_drop_held(self):
4630        """Test swap feature in CSFB WCDMA call.
4631
4632        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4633        PhoneA (CSFB WCDMA) call PhoneC, accept on PhoneC.
4634        Swap active call on PhoneA.
4635        Hangup call from PhoneC, check if call continues between AB.
4636
4637        """
4638        ads = self.android_devices
4639
4640        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mo_add_swap_x(1)
4641        if call_ab_id is None or call_ac_id is None:
4642            return False
4643
4644        return self._three_phone_hangup_call_verify_call_state(
4645            ad_hangup=ads[2],
4646            ad_verify=ads[0],
4647            call_id=call_ab_id,
4648            call_state=CALL_STATE_ACTIVE,
4649            ads_active=[ads[0], ads[1]])
4650
4651    @TelephonyBaseTest.tel_test_wrap
4652    @test_tracker_info(uuid="ee0f7772-9e58-4a00-8eb5-a03b3e5baf40")
4653    def test_csfb_wcdma_mo_mo_add_swap_once_drop_active(self):
4654        """Test swap feature in CSFB WCDMA call.
4655
4656        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4657        PhoneA (CSFB WCDMA) call PhoneC, accept on PhoneC.
4658        Swap active call on PhoneA.
4659        Hangup call from PhoneB, check if call continues between AC.
4660
4661        """
4662        ads = self.android_devices
4663
4664        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mo_add_swap_x(1)
4665        if call_ab_id is None or call_ac_id is None:
4666            return False
4667
4668        return self._three_phone_hangup_call_verify_call_state(
4669            ad_hangup=ads[1],
4670            ad_verify=ads[0],
4671            call_id=call_ac_id,
4672            call_state=self._get_expected_call_state(ads[0]),
4673            ads_active=[ads[0], ads[2]])
4674
4675    @TelephonyBaseTest.tel_test_wrap
4676    @test_tracker_info(uuid="2f9e0120-c052-467b-be45-313ada433dce")
4677    def test_csfb_wcdma_mo_mt_add_swap_once_drop_held(self):
4678        """Test swap feature in CSFB WCDMA call.
4679
4680        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4681        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
4682        Swap active call on PhoneA.
4683        Hangup call from PhoneC, check if call continues between AB.
4684
4685        """
4686        ads = self.android_devices
4687
4688        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mt_add_swap_x(1)
4689        if call_ab_id is None or call_ac_id is None:
4690            return False
4691
4692        return self._three_phone_hangup_call_verify_call_state(
4693            ad_hangup=ads[2],
4694            ad_verify=ads[0],
4695            call_id=call_ab_id,
4696            call_state=CALL_STATE_ACTIVE,
4697            ads_active=[ads[0], ads[1]])
4698
4699    @TelephonyBaseTest.tel_test_wrap
4700    @test_tracker_info(uuid="9110ad34-04e4-4d0f-9ac0-183ad9e6fa8a")
4701    def test_csfb_wcdma_mo_mt_add_swap_once_drop_active(self):
4702        """Test swap feature in CSFB WCDMA call.
4703
4704        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
4705        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
4706        Swap active call on PhoneA.
4707        Hangup call from PhoneB, check if call continues between AC.
4708
4709        """
4710        ads = self.android_devices
4711
4712        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mt_add_swap_x(1)
4713        if call_ab_id is None or call_ac_id is None:
4714            return False
4715
4716        return self._three_phone_hangup_call_verify_call_state(
4717            ad_hangup=ads[1],
4718            ad_verify=ads[0],
4719            call_id=call_ac_id,
4720            call_state=self._get_expected_call_state(ads[0]),
4721            ads_active=[ads[0], ads[2]])
4722
4723    @TelephonyBaseTest.tel_test_wrap
4724    @test_tracker_info(uuid="8cca4681-a5d4-472a-b0b5-46b79a6892a7")
4725    def test_volte_mo_mo_add_volte_swap_once_merge_drop_second_call_from_participant_no_cep(
4726            self):
4727        """ Test swap and merge features in VoLTE call. No CEP.
4728
4729        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4730        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4731        Swap active call on PhoneA.
4732        On PhoneA, merge to conference call (No CEP).
4733        End call on PhoneC, verify call continues.
4734        End call on PhoneB, verify call end on PhoneA.
4735
4736        Returns:
4737            True if pass; False if fail.
4738        """
4739        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4740        if call_ab_id is None or call_ac_id is None:
4741            return False
4742
4743        return self._test_ims_conference_merge_drop_second_call_from_participant(
4744            call_ab_id, call_ac_id)
4745
4746    @TelephonyBaseTest.tel_test_wrap
4747    @test_tracker_info(uuid="9168698e-987a-42e3-8bc6-2a433fa4b5e3")
4748    def test_volte_mo_mo_add_volte_swap_once_merge_drop_second_call_from_participant_cep(
4749            self):
4750        """ Test swap and merge features in VoLTE call. CEP enabled.
4751
4752        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4753        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4754        3. Swap active call on PhoneA.
4755        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
4756        5. End call on PhoneC, verify call continues.
4757        6. End call on PhoneB, verify call end on PhoneA.
4758
4759        Returns:
4760            True if pass; False if fail.
4761        """
4762        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4763        if call_ab_id is None or call_ac_id is None:
4764            return False
4765
4766        return self._test_ims_conference_merge_drop_second_call_from_participant(
4767            call_ab_id, call_ac_id)
4768
4769    @TelephonyBaseTest.tel_test_wrap
4770    @test_tracker_info(uuid="397bfab8-6651-4438-a603-22657fd69b84")
4771    def test_volte_mo_mo_add_volte_swap_once_merge_drop_second_call_from_host_cep(
4772            self):
4773        """ Test swap and merge features in VoLTE call. CEP enabled.
4774
4775        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4776        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4777        3. Swap active call on PhoneA.
4778        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
4779        5. On PhoneA disconnect call between A-C, verify call continues.
4780        6. On PhoneA disconnect call between A-B, verify call continues.
4781
4782        Returns:
4783            True if pass; False if fail.
4784        """
4785        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4786        if call_ab_id is None or call_ac_id is None:
4787            return False
4788
4789        return self._test_ims_conference_merge_drop_second_call_from_host(
4790            call_ab_id, call_ac_id)
4791
4792    @TelephonyBaseTest.tel_test_wrap
4793    @test_tracker_info(uuid="ba766c4c-690f-407b-87f8-05a91783e224")
4794    def test_volte_mo_mo_add_volte_swap_once_merge_drop_first_call_from_participant_cep(
4795            self):
4796        """ Test swap and merge features in VoLTE call. CEP enabled.
4797
4798        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4799        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4800        3. Swap active call on PhoneA.
4801        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
4802        5. End call on PhoneB, verify call continues.
4803        6. End call on PhoneC, verify call end on PhoneA.
4804
4805        Returns:
4806            True if pass; False if fail.
4807        """
4808        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4809        if call_ab_id is None or call_ac_id is None:
4810            return False
4811
4812        return self._test_ims_conference_merge_drop_first_call_from_participant(
4813            call_ab_id, call_ac_id)
4814
4815    @TelephonyBaseTest.tel_test_wrap
4816    @test_tracker_info(uuid="1e45c749-6d4c-4d30-b104-bfcc37e13f1d")
4817    def test_volte_mo_mo_add_volte_swap_once_merge_drop_first_call_from_host_cep(
4818            self):
4819        """ Test swap and merge features in VoLTE call. CEP enabled.
4820
4821        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4822        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4823        3. Swap active call on PhoneA.
4824        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
4825        5. On PhoneA disconnect call between A-B, verify call continues.
4826        6. On PhoneA disconnect call between A-C, verify call continues.
4827
4828        Returns:
4829            True if pass; False if fail.
4830        """
4831        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(1)
4832        if call_ab_id is None or call_ac_id is None:
4833            return False
4834
4835        return self._test_ims_conference_merge_drop_first_call_from_host(
4836            call_ab_id, call_ac_id)
4837
4838    @TelephonyBaseTest.tel_test_wrap
4839    @test_tracker_info(uuid="d6648e19-8001-483a-a83b-a92b638a7650")
4840    def test_volte_mo_mo_add_volte_swap_twice_merge_drop_second_call_from_participant_no_cep(
4841            self):
4842        """ Test swap and merge features in VoLTE call. No CEP.
4843
4844        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4845        PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4846        Swap active call on PhoneA.
4847        Swap active call on PhoneA.
4848        On PhoneA, merge to conference call (No CEP).
4849        End call on PhoneC, verify call continues.
4850        End call on PhoneB, verify call end on PhoneA.
4851
4852        Returns:
4853            True if pass; False if fail.
4854        """
4855        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4856        if call_ab_id is None or call_ac_id is None:
4857            return False
4858
4859        return self._test_ims_conference_merge_drop_second_call_from_participant(
4860            call_ab_id, call_ac_id)
4861
4862    @TelephonyBaseTest.tel_test_wrap
4863    @test_tracker_info(uuid="18d3c304-ad04-409f-bfd4-fd3f01f9a51e")
4864    def test_volte_mo_mo_add_volte_swap_twice_merge_drop_second_call_from_participant_cep(
4865            self):
4866        """ Test swap and merge features in VoLTE call. CEP enabled.
4867
4868        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4869        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4870        3. Swap active call on PhoneA.
4871        4. Swap active call on PhoneA.
4872        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
4873        6. End call on PhoneC, verify call continues.
4874        7. End call on PhoneB, verify call end on PhoneA.
4875
4876        Returns:
4877            True if pass; False if fail.
4878        """
4879        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4880        if call_ab_id is None or call_ac_id is None:
4881            return False
4882
4883        return self._test_ims_conference_merge_drop_second_call_from_participant(
4884            call_ab_id, call_ac_id)
4885
4886    @TelephonyBaseTest.tel_test_wrap
4887    @test_tracker_info(uuid="f1e71550-3a45-45e4-88e4-7e4da919d58e")
4888    def test_volte_mo_mo_add_volte_swap_twice_merge_drop_second_call_from_host_cep(
4889            self):
4890        """ Test swap and merge features in VoLTE call. CEP enabled.
4891
4892        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4893        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4894        3. Swap active call on PhoneA.
4895        4. Swap active call on PhoneA.
4896        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
4897        6. On PhoneA disconnect call between A-C, verify call continues.
4898        7. On PhoneA disconnect call between A-B, verify call continues.
4899
4900        Returns:
4901            True if pass; False if fail.
4902        """
4903        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4904        if call_ab_id is None or call_ac_id is None:
4905            return False
4906
4907        return self._test_ims_conference_merge_drop_second_call_from_host(
4908            call_ab_id, call_ac_id)
4909
4910    @TelephonyBaseTest.tel_test_wrap
4911    @test_tracker_info(uuid="60cc8bd1-4270-4b5c-9d29-9fa36a357503")
4912    def test_volte_mo_mo_add_volte_swap_twice_merge_drop_first_call_from_participant_cep(
4913            self):
4914        """ Test swap and merge features in VoLTE call. CEP enabled.
4915
4916        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4917        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4918        3. Swap active call on PhoneA.
4919        4. Swap active call on PhoneA.
4920        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
4921        6. End call on PhoneB, verify call continues.
4922        7. End call on PhoneC, verify call end on PhoneA.
4923
4924        Returns:
4925            True if pass; False if fail.
4926        """
4927        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4928        if call_ab_id is None or call_ac_id is None:
4929            return False
4930
4931        return self._test_ims_conference_merge_drop_first_call_from_participant(
4932            call_ab_id, call_ac_id)
4933
4934    @TelephonyBaseTest.tel_test_wrap
4935    @test_tracker_info(uuid="7d81c5f8-5ee1-4ad2-b08e-3e4c97748a66")
4936    def test_volte_mo_mo_add_volte_swap_twice_merge_drop_first_call_from_host_cep(
4937            self):
4938        """ Test swap and merge features in VoLTE call. CEP enabled.
4939
4940        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4941        2. PhoneA (VoLTE) call PhoneC (VoLTE), accept on PhoneC.
4942        3. Swap active call on PhoneA.
4943        4. Swap active call on PhoneA.
4944        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
4945        6. On PhoneA disconnect call between A-B, verify call continues.
4946        7. On PhoneA disconnect call between A-C, verify call continues.
4947
4948        Returns:
4949            True if pass; False if fail.
4950        """
4951        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_volte_swap_x(2)
4952        if call_ab_id is None or call_ac_id is None:
4953            return False
4954
4955        return self._test_ims_conference_merge_drop_first_call_from_host(
4956            call_ab_id, call_ac_id)
4957
4958    @TelephonyBaseTest.tel_test_wrap
4959    @test_tracker_info(uuid="5a887fde-8f9b-436b-ae8d-5ff97a884fc9")
4960    def test_volte_mo_mt_add_volte_swap_once_merge_drop_second_call_from_participant_no_cep(
4961            self):
4962        """ Test swap and merge features in VoLTE call. No CEP.
4963
4964        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4965        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
4966        Swap active call on PhoneA.
4967        On PhoneA, merge to conference call (No CEP).
4968        End call on PhoneC, verify call continues.
4969        End call on PhoneB, verify call end on PhoneA.
4970
4971        Returns:
4972            True if pass; False if fail.
4973        """
4974        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
4975        if call_ab_id is None or call_ac_id is None:
4976            return False
4977
4978        return self._test_ims_conference_merge_drop_second_call_from_participant(
4979            call_ab_id, call_ac_id)
4980
4981    @TelephonyBaseTest.tel_test_wrap
4982    @test_tracker_info(uuid="82574508-0d77-42cf-bf60-9fdddee24c42")
4983    def test_volte_mo_mt_add_volte_swap_once_merge_drop_second_call_from_participant_cep(
4984            self):
4985        """ Test swap and merge features in VoLTE call. CEP enabled.
4986
4987        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
4988        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
4989        3. Swap active call on PhoneA.
4990        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
4991        5. End call on PhoneC, verify call continues.
4992        6. End call on PhoneB, verify call end on PhoneA.
4993
4994        Returns:
4995            True if pass; False if fail.
4996        """
4997        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
4998        if call_ab_id is None or call_ac_id is None:
4999            return False
5000
5001        return self._test_ims_conference_merge_drop_second_call_from_participant(
5002            call_ab_id, call_ac_id)
5003
5004    @TelephonyBaseTest.tel_test_wrap
5005    @test_tracker_info(uuid="8f30c425-c689-43b8-84f3-f24f7d9216f6")
5006    def test_volte_mo_mt_add_volte_swap_once_merge_drop_second_call_from_host_cep(
5007            self):
5008        """ Test swap and merge features in VoLTE call. CEP enabled.
5009
5010        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5011        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5012        3. Swap active call on PhoneA.
5013        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5014        5. On PhoneA disconnect call between A-C, verify call continues.
5015        6. On PhoneA disconnect call between A-B, verify call continues.
5016
5017        Returns:
5018            True if pass; False if fail.
5019        """
5020        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
5021        if call_ab_id is None or call_ac_id is None:
5022            return False
5023
5024        return self._test_ims_conference_merge_drop_second_call_from_host(
5025            call_ab_id, call_ac_id)
5026
5027    @TelephonyBaseTest.tel_test_wrap
5028    @test_tracker_info(uuid="2a67845f-ccfd-4c06-aedc-9d6c1f022959")
5029    def test_volte_mo_mt_add_volte_swap_once_merge_drop_first_call_from_participant_cep(
5030            self):
5031        """ Test swap and merge features in VoLTE call. CEP enabled.
5032
5033        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5034        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5035        3. Swap active call on PhoneA.
5036        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5037        5. End call on PhoneB, verify call continues.
5038        6. End call on PhoneC, verify call end on PhoneA.
5039
5040        Returns:
5041            True if pass; False if fail.
5042        """
5043        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
5044        if call_ab_id is None or call_ac_id is None:
5045            return False
5046
5047        return self._test_ims_conference_merge_drop_first_call_from_participant(
5048            call_ab_id, call_ac_id)
5049
5050    @TelephonyBaseTest.tel_test_wrap
5051    @test_tracker_info(uuid="0a5d1305-0890-40c4-8c7a-070876423e16")
5052    def test_volte_mo_mt_add_volte_swap_once_merge_drop_first_call_from_host_cep(
5053            self):
5054        """ Test swap and merge features in VoLTE call. CEP enabled.
5055
5056        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5057        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5058        3. Swap active call on PhoneA.
5059        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5060        5. On PhoneA disconnect call between A-B, verify call continues.
5061        6. On PhoneA disconnect call between A-C, verify call continues.
5062
5063        Returns:
5064            True if pass; False if fail.
5065        """
5066        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(1)
5067        if call_ab_id is None or call_ac_id is None:
5068            return False
5069
5070        return self._test_ims_conference_merge_drop_first_call_from_host(
5071            call_ab_id, call_ac_id)
5072
5073    @TelephonyBaseTest.tel_test_wrap
5074    @test_tracker_info(uuid="77bbb5ec-fd16-4031-b316-7f6563b79a3d")
5075    def test_volte_mo_mt_add_volte_swap_twice_merge_drop_second_call_from_participant_no_cep(
5076            self):
5077        """ Test swap and merge features in VoLTE call. No CEP.
5078
5079        PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5080        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5081        Swap active call on PhoneA.
5082        Swap active call on PhoneA.
5083        On PhoneA, merge to conference call (No CEP).
5084        End call on PhoneC, verify call continues.
5085        End call on PhoneB, verify call end on PhoneA.
5086
5087        Returns:
5088            True if pass; False if fail.
5089        """
5090        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
5091        if call_ab_id is None or call_ac_id is None:
5092            return False
5093
5094        return self._test_ims_conference_merge_drop_second_call_from_participant(
5095            call_ab_id, call_ac_id)
5096
5097    @TelephonyBaseTest.tel_test_wrap
5098    @test_tracker_info(uuid="09cd41cd-821d-4d09-9b1e-7330dca77150")
5099    def test_volte_mo_mt_add_volte_swap_twice_merge_drop_second_call_from_participant_cep(
5100            self):
5101        """ Test swap and merge features in VoLTE call. CEP enabled.
5102
5103        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5104        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5105        3. Swap active call on PhoneA.
5106        4. Swap active call on PhoneA.
5107        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5108        6. End call on PhoneC, verify call continues.
5109        7. End call on PhoneB, verify call end on PhoneA.
5110
5111        Returns:
5112            True if pass; False if fail.
5113        """
5114        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
5115        if call_ab_id is None or call_ac_id is None:
5116            return False
5117
5118        return self._test_ims_conference_merge_drop_second_call_from_participant(
5119            call_ab_id, call_ac_id)
5120
5121    @TelephonyBaseTest.tel_test_wrap
5122    @test_tracker_info(uuid="bdb2791e-92d0-44a3-aa8f-bd83e8159cb7")
5123    def test_volte_mo_mt_add_volte_swap_twice_merge_drop_second_call_from_host_cep(
5124            self):
5125        """ Test swap and merge features in VoLTE call. CEP enabled.
5126
5127        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5128        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5129        3. Swap active call on PhoneA.
5130        4. Swap active call on PhoneA.
5131        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5132        6. On PhoneA disconnect call between A-C, verify call continues.
5133        7. On PhoneA disconnect call between A-B, verify call continues.
5134
5135        Returns:
5136            True if pass; False if fail.
5137        """
5138        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
5139        if call_ab_id is None or call_ac_id is None:
5140            return False
5141
5142        return self._test_ims_conference_merge_drop_second_call_from_host(
5143            call_ab_id, call_ac_id)
5144
5145    @TelephonyBaseTest.tel_test_wrap
5146    @test_tracker_info(uuid="4f54e67d-7c7a-4952-ae09-f940094ec1ff")
5147    def test_volte_mo_mt_add_volte_swap_twice_merge_drop_first_call_from_participant_cep(
5148            self):
5149        """ Test swap and merge features in VoLTE call. CEP enabled.
5150
5151        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5152        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5153        3. Swap active call on PhoneA.
5154        4. Swap active call on PhoneA.
5155        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5156        6. End call on PhoneB, verify call continues.
5157        7. End call on PhoneC, verify call end on PhoneA.
5158
5159        Returns:
5160            True if pass; False if fail.
5161        """
5162        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
5163        if call_ab_id is None or call_ac_id is None:
5164            return False
5165
5166        return self._test_ims_conference_merge_drop_first_call_from_participant(
5167            call_ab_id, call_ac_id)
5168
5169    @TelephonyBaseTest.tel_test_wrap
5170    @test_tracker_info(uuid="4ca28f9f-098f-4f71-b89c-9b2793aa2f5f")
5171    def test_volte_mo_mt_add_volte_swap_twice_merge_drop_first_call_from_host_cep(
5172            self):
5173        """ Test swap and merge features in VoLTE call. CEP enabled.
5174
5175        1. PhoneA (VoLTE) call PhoneB (VoLTE), accept on PhoneB.
5176        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5177        3. Swap active call on PhoneA.
5178        4. Swap active call on PhoneA.
5179        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5180        6. On PhoneA disconnect call between A-B, verify call continues.
5181        7. On PhoneA disconnect call between A-C, verify call continues.
5182
5183        Returns:
5184            True if pass; False if fail.
5185        """
5186        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_volte_swap_x(2)
5187        if call_ab_id is None or call_ac_id is None:
5188            return False
5189
5190        return self._test_ims_conference_merge_drop_first_call_from_host(
5191            call_ab_id, call_ac_id)
5192
5193    @TelephonyBaseTest.tel_test_wrap
5194    @test_tracker_info(uuid="f025c100-bb77-436e-b8ab-0c23a3d43318")
5195    def test_volte_mt_mt_add_volte_swap_once_merge_drop_second_call_from_participant_no_cep(
5196            self):
5197        """ Test swap and merge features in VoLTE call. No CEP.
5198
5199        PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5200        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5201        Swap active call on PhoneA.
5202        On PhoneA, merge to conference call (No CEP).
5203        End call on PhoneC, verify call continues.
5204        End call on PhoneB, verify call end on PhoneA.
5205
5206        Returns:
5207            True if pass; False if fail.
5208        """
5209        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(1)
5210        if call_ab_id is None or call_ac_id is None:
5211            return False
5212
5213        return self._test_ims_conference_merge_drop_second_call_from_participant(
5214            call_ab_id, call_ac_id)
5215
5216    @TelephonyBaseTest.tel_test_wrap
5217    @test_tracker_info(uuid="b6cd6b06-0984-4588-892e-939d332bf147")
5218    def test_volte_mt_mt_add_volte_swap_once_merge_drop_second_call_from_participant_cep(
5219            self):
5220        """ Test swap and merge features in VoLTE call. CEP enabled.
5221
5222        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5223        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5224        3. Swap active call on PhoneA.
5225        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5226        5. End call on PhoneC, verify call continues.
5227        6. End call on PhoneB, verify call end on PhoneA.
5228
5229        Returns:
5230            True if pass; False if fail.
5231        """
5232        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(1)
5233        if call_ab_id is None or call_ac_id is None:
5234            return False
5235
5236        return self._test_ims_conference_merge_drop_second_call_from_participant(
5237            call_ab_id, call_ac_id)
5238
5239    @TelephonyBaseTest.tel_test_wrap
5240    @test_tracker_info(uuid="f7bda827-79bd-41cc-b720-140f49b381d9")
5241    def test_volte_mt_mt_add_volte_swap_once_merge_drop_second_call_from_host_cep(
5242            self):
5243        """ Test swap and merge features in VoLTE call. CEP enabled.
5244
5245        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5246        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5247        3. Swap active call on PhoneA.
5248        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5249        5. On PhoneA disconnect call between A-C, verify call continues.
5250        6. On PhoneA disconnect call between A-B, verify call continues.
5251
5252        Returns:
5253            True if pass; False if fail.
5254        """
5255        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(1)
5256        if call_ab_id is None or call_ac_id is None:
5257            return False
5258
5259        return self._test_ims_conference_merge_drop_second_call_from_host(
5260            call_ab_id, call_ac_id)
5261
5262    @TelephonyBaseTest.tel_test_wrap
5263    @test_tracker_info(uuid="de8aae4e-c8fc-4996-9d0b-56c3904c9bb4")
5264    def test_volte_mt_mt_add_volte_swap_once_merge_drop_first_call_from_participant_cep(
5265            self):
5266        """ Test swap and merge features in VoLTE call. CEP enabled.
5267
5268        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5269        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5270        3. Swap active call on PhoneA.
5271        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5272        5. End call on PhoneB, verify call continues.
5273        6. End call on PhoneC, verify call end on PhoneA.
5274
5275        Returns:
5276            True if pass; False if fail.
5277        """
5278        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(1)
5279        if call_ab_id is None or call_ac_id is None:
5280            return False
5281
5282        return self._test_ims_conference_merge_drop_first_call_from_participant(
5283            call_ab_id, call_ac_id)
5284
5285    @TelephonyBaseTest.tel_test_wrap
5286    @test_tracker_info(uuid="35d72ebf-1a99-4571-8993-2899925f5489")
5287    def test_volte_mt_mt_add_volte_swap_once_merge_drop_first_call_from_host_cep(
5288            self):
5289        """ Test swap and merge features in VoLTE call. CEP enabled.
5290
5291        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5292        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5293        3. Swap active call on PhoneA.
5294        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5295        5. On PhoneA disconnect call between A-B, verify call continues.
5296        6. On PhoneA disconnect call between A-C, verify call continues.
5297
5298        Returns:
5299            True if pass; False if fail.
5300        """
5301        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(1)
5302        if call_ab_id is None or call_ac_id is None:
5303            return False
5304
5305        return self._test_ims_conference_merge_drop_first_call_from_host(
5306            call_ab_id, call_ac_id)
5307
5308    @TelephonyBaseTest.tel_test_wrap
5309    @test_tracker_info(uuid="96c4c9d2-2e00-41a8-b4ce-3a9377262d36")
5310    def test_volte_mt_mt_add_volte_swap_twice_merge_drop_second_call_from_participant_no_cep(
5311            self):
5312        """ Test swap and merge features in VoLTE call. No CEP.
5313
5314        PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5315        PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5316        Swap active call on PhoneA.
5317        Swap active call on PhoneA.
5318        On PhoneA, merge to conference call (No CEP).
5319        End call on PhoneC, verify call continues.
5320        End call on PhoneB, verify call end on PhoneA.
5321
5322        Returns:
5323            True if pass; False if fail.
5324        """
5325        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(2)
5326        if call_ab_id is None or call_ac_id is None:
5327            return False
5328
5329        return self._test_ims_conference_merge_drop_second_call_from_participant(
5330            call_ab_id, call_ac_id)
5331
5332    @TelephonyBaseTest.tel_test_wrap
5333    @test_tracker_info(uuid="e1e0bb6c-c2d5-4566-80b1-46bfb0b95544")
5334    def test_volte_mt_mt_add_volte_swap_twice_merge_drop_second_call_from_participant_cep(
5335            self):
5336        """ Test swap and merge features in VoLTE call. CEP enabled.
5337
5338        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5339        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5340        3. Swap active call on PhoneA.
5341        4. Swap active call on PhoneA.
5342        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5343        6. End call on PhoneC, verify call continues.
5344        7. End call on PhoneB, verify call end on PhoneA.
5345
5346        Returns:
5347            True if pass; False if fail.
5348        """
5349        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(2)
5350        if call_ab_id is None or call_ac_id is None:
5351            return False
5352
5353        return self._test_ims_conference_merge_drop_second_call_from_participant(
5354            call_ab_id, call_ac_id)
5355
5356    @TelephonyBaseTest.tel_test_wrap
5357    @test_tracker_info(uuid="764b5930-ba96-4901-b629-e753bc5c8d8e")
5358    def test_volte_mt_mt_add_volte_swap_twice_merge_drop_second_call_from_host_cep(
5359            self):
5360        """ Test swap and merge features in VoLTE call. CEP enabled.
5361
5362        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5363        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5364        3. Swap active call on PhoneA.
5365        4. Swap active call on PhoneA.
5366        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5367        6. On PhoneA disconnect call between A-C, verify call continues.
5368        7. On PhoneA disconnect call between A-B, verify call continues.
5369
5370        Returns:
5371            True if pass; False if fail.
5372        """
5373        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(2)
5374        if call_ab_id is None or call_ac_id is None:
5375            return False
5376
5377        return self._test_ims_conference_merge_drop_second_call_from_host(
5378            call_ab_id, call_ac_id)
5379
5380    @TelephonyBaseTest.tel_test_wrap
5381    @test_tracker_info(uuid="e03e52a1-7e7b-4a53-a496-3092a35153ae")
5382    def test_volte_mt_mt_add_volte_swap_twice_merge_drop_first_call_from_participant_cep(
5383            self):
5384        """ Test swap and merge features in VoLTE call. CEP enabled.
5385
5386        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5387        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5388        3. Swap active call on PhoneA.
5389        4. Swap active call on PhoneA.
5390        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5391        6. End call on PhoneB, verify call continues.
5392        7. End call on PhoneC, verify call end on PhoneA.
5393
5394        Returns:
5395            True if pass; False if fail.
5396        """
5397        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(2)
5398        if call_ab_id is None or call_ac_id is None:
5399            return False
5400
5401        return self._test_ims_conference_merge_drop_first_call_from_participant(
5402            call_ab_id, call_ac_id)
5403
5404    @TelephonyBaseTest.tel_test_wrap
5405    @test_tracker_info(uuid="10a63692-56de-4563-b223-91e8814ddbc9")
5406    def test_volte_mt_mt_add_volte_swap_twice_merge_drop_first_call_from_host_cep(
5407            self):
5408        """ Test swap and merge features in VoLTE call. CEP enabled.
5409
5410        1. PhoneB (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5411        2. PhoneC (VoLTE) call PhoneA (VoLTE), accept on PhoneA.
5412        3. Swap active call on PhoneA.
5413        4. Swap active call on PhoneA.
5414        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5415        6. On PhoneA disconnect call between A-B, verify call continues.
5416        7. On PhoneA disconnect call between A-C, verify call continues.
5417
5418        Returns:
5419            True if pass; False if fail.
5420        """
5421        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_volte_swap_x(2)
5422        if call_ab_id is None or call_ac_id is None:
5423            return False
5424
5425        return self._test_ims_conference_merge_drop_first_call_from_host(
5426            call_ab_id, call_ac_id)
5427
5428    @TelephonyBaseTest.tel_test_wrap
5429    @test_tracker_info(uuid="cf4b1fe2-40d7-409b-a4ec-06bdb9a0d957")
5430    def test_volte_mo_mo_add_wcdma_swap_once_merge_drop_second_call_from_participant_no_cep(
5431            self):
5432        """ Test VoLTE Conference Call among three phones. No CEP.
5433
5434        PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5435        PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5436        Swap active call on PhoneA.
5437        On PhoneA, merge to conference call (No CEP).
5438        End call on PhoneC, verify call continues.
5439        End call on PhoneB, verify call end on PhoneA.
5440
5441        Returns:
5442            True if pass; False if fail.
5443        """
5444        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(1)
5445        if call_ab_id is None or call_ac_id is None:
5446            return False
5447
5448        return self._test_ims_conference_merge_drop_second_call_from_participant(
5449            call_ab_id, call_ac_id)
5450
5451    @TelephonyBaseTest.tel_test_wrap
5452    @test_tracker_info(uuid="fcc9dbd2-919d-4552-838c-2b672fb24b2b")
5453    def test_volte_mo_mo_add_wcdma_swap_once_merge_drop_second_call_from_participant_cep(
5454            self):
5455        """ Test swap and merge features in VoLTE call. CEP enabled.
5456
5457        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5458        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5459        3. Swap active call on PhoneA.
5460        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5461        5. End call on PhoneC, verify call continues.
5462        6. End call on PhoneB, verify call end on PhoneA.
5463
5464        Returns:
5465            True if pass; False if fail.
5466        """
5467        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(1)
5468        if call_ab_id is None or call_ac_id is None:
5469            return False
5470
5471        return self._test_ims_conference_merge_drop_second_call_from_participant(
5472            call_ab_id, call_ac_id)
5473
5474    @TelephonyBaseTest.tel_test_wrap
5475    @test_tracker_info(uuid="37021d31-4242-46a2-adbf-eb7b987e4a43")
5476    def test_volte_mo_mo_add_wcdma_swap_once_merge_drop_second_call_from_host_cep(
5477            self):
5478        """ Test swap and merge features in VoLTE call. CEP enabled.
5479
5480        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5481        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5482        3. Swap active call on PhoneA.
5483        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5484        5. On PhoneA disconnect call between A-C, verify call continues.
5485        6. On PhoneA disconnect call between A-B, verify call continues.
5486
5487        Returns:
5488            True if pass; False if fail.
5489        """
5490        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(1)
5491        if call_ab_id is None or call_ac_id is None:
5492            return False
5493
5494        return self._test_ims_conference_merge_drop_second_call_from_host(
5495            call_ab_id, call_ac_id)
5496
5497    @TelephonyBaseTest.tel_test_wrap
5498    @test_tracker_info(uuid="cc362118-ccd1-4502-96f1-b3584b0c6bf3")
5499    def test_volte_mo_mo_add_wcdma_swap_once_merge_drop_first_call_from_participant_cep(
5500            self):
5501        """ Test swap and merge features in VoLTE call. CEP enabled.
5502
5503        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5504        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5505        3. Swap active call on PhoneA.
5506        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5507        5. End call on PhoneB, verify call continues.
5508        6. End call on PhoneC, verify call end on PhoneA.
5509
5510        Returns:
5511            True if pass; False if fail.
5512        """
5513        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(1)
5514        if call_ab_id is None or call_ac_id is None:
5515            return False
5516
5517        return self._test_ims_conference_merge_drop_first_call_from_participant(
5518            call_ab_id, call_ac_id)
5519
5520    @TelephonyBaseTest.tel_test_wrap
5521    @test_tracker_info(uuid="be57dd4f-020f-4491-9cd0-2461dcd0806b")
5522    def test_volte_mo_mo_add_wcdma_swap_once_merge_drop_first_call_from_host_cep(
5523            self):
5524        """ Test swap and merge features in VoLTE call. CEP enabled.
5525
5526        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5527        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5528        3. Swap active call on PhoneA.
5529        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5530        5. On PhoneA disconnect call between A-B, verify call continues.
5531        6. On PhoneA disconnect call between A-C, verify call continues.
5532
5533        Returns:
5534            True if pass; False if fail.
5535        """
5536        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(1)
5537        if call_ab_id is None or call_ac_id is None:
5538            return False
5539
5540        return self._test_ims_conference_merge_drop_first_call_from_host(
5541            call_ab_id, call_ac_id)
5542
5543    @TelephonyBaseTest.tel_test_wrap
5544    @test_tracker_info(uuid="058425ca-7b25-4a85-a5c7-bfdcd7920f15")
5545    def test_volte_mo_mo_add_wcdma_swap_twice_merge_drop_second_call_from_participant_no_cep(
5546            self):
5547        """ Test VoLTE Conference Call among three phones. No CEP.
5548
5549        PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5550        PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5551        Swap active call on PhoneA.
5552        Swap active call on PhoneA.
5553        On PhoneA, merge to conference call (No CEP).
5554        End call on PhoneC, verify call continues.
5555        End call on PhoneB, verify call end on PhoneA.
5556
5557        Returns:
5558            True if pass; False if fail.
5559        """
5560        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(2)
5561        if call_ab_id is None or call_ac_id is None:
5562            return False
5563
5564        return self._test_ims_conference_merge_drop_second_call_from_participant(
5565            call_ab_id, call_ac_id)
5566
5567    @TelephonyBaseTest.tel_test_wrap
5568    @test_tracker_info(uuid="5f691165-d099-419d-a50e-1547c8677f6b")
5569    def test_volte_mo_mo_add_wcdma_swap_twice_merge_drop_second_call_from_participant_cep(
5570            self):
5571        """ Test swap and merge features in VoLTE call. CEP enabled.
5572
5573        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5574        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5575        3. Swap active call on PhoneA.
5576        4. Swap active call on PhoneA.
5577        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5578        6. End call on PhoneC, verify call continues.
5579        7. End call on PhoneB, verify call end on PhoneA.
5580
5581        Returns:
5582            True if pass; False if fail.
5583        """
5584        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(2)
5585        if call_ab_id is None or call_ac_id is None:
5586            return False
5587
5588        return self._test_ims_conference_merge_drop_second_call_from_participant(
5589            call_ab_id, call_ac_id)
5590
5591    @TelephonyBaseTest.tel_test_wrap
5592    @test_tracker_info(uuid="4fc8459e-23c6-408a-a061-e8f182086dd6")
5593    def test_volte_mo_mo_add_wcdma_swap_twice_merge_drop_second_call_from_host_cep(
5594            self):
5595        """ Test swap and merge features in VoLTE call. CEP enabled.
5596
5597        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5598        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5599        3. Swap active call on PhoneA.
5600        4. Swap active call on PhoneA.
5601        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5602        6. On PhoneA disconnect call between A-C, verify call continues.
5603        7. On PhoneA disconnect call between A-B, verify call continues.
5604
5605        Returns:
5606            True if pass; False if fail.
5607        """
5608        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(2)
5609        if call_ab_id is None or call_ac_id is None:
5610            return False
5611
5612        return self._test_ims_conference_merge_drop_second_call_from_host(
5613            call_ab_id, call_ac_id)
5614
5615    @TelephonyBaseTest.tel_test_wrap
5616    @test_tracker_info(uuid="3026802f-ddca-41e4-ae6f-db0c994613a7")
5617    def test_volte_mo_mo_add_wcdma_swap_twice_merge_drop_first_call_from_participant_cep(
5618            self):
5619        """ Test swap and merge features in VoLTE call. CEP enabled.
5620
5621        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5622        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5623        3. Swap active call on PhoneA.
5624        4. Swap active call on PhoneA.
5625        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5626        6. End call on PhoneB, verify call continues.
5627        7. End call on PhoneC, verify call end on PhoneA.
5628
5629        Returns:
5630            True if pass; False if fail.
5631        """
5632        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(2)
5633        if call_ab_id is None or call_ac_id is None:
5634            return False
5635
5636        return self._test_ims_conference_merge_drop_first_call_from_participant(
5637            call_ab_id, call_ac_id)
5638
5639    @TelephonyBaseTest.tel_test_wrap
5640    @test_tracker_info(uuid="5ce98774-66b4-4710-b0da-e43bb7fa1c0f")
5641    def test_volte_mo_mo_add_wcdma_swap_twice_merge_drop_first_call_from_host_cep(
5642            self):
5643        """ Test swap and merge features in VoLTE call. CEP enabled.
5644
5645        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5646        2. PhoneA (VoLTE) call PhoneC (WCDMA), accept on PhoneC.
5647        3. Swap active call on PhoneA.
5648        4. Swap active call on PhoneA.
5649        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5650        6. On PhoneA disconnect call between A-B, verify call continues.
5651        7. On PhoneA disconnect call between A-C, verify call continues.
5652
5653        Returns:
5654            True if pass; False if fail.
5655        """
5656        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_wcdma_swap_x(2)
5657        if call_ab_id is None or call_ac_id is None:
5658            return False
5659
5660        return self._test_ims_conference_merge_drop_first_call_from_host(
5661            call_ab_id, call_ac_id)
5662
5663    @TelephonyBaseTest.tel_test_wrap
5664    @test_tracker_info(uuid="61766517-8762-4db3-9366-609c0f1a43b5")
5665    def test_volte_mo_mt_add_wcdma_swap_once_merge_drop_second_call_from_participant_no_cep(
5666            self):
5667        """ Test VoLTE Conference Call among three phones. No CEP.
5668
5669        PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5670        PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5671        Swap active call on PhoneA.
5672        On PhoneA, merge to conference call (No CEP).
5673        End call on PhoneC, verify call continues.
5674        End call on PhoneB, verify call end on PhoneA.
5675
5676        Returns:
5677            True if pass; False if fail.
5678        """
5679        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(1)
5680        if call_ab_id is None or call_ac_id is None:
5681            return False
5682
5683        return self._test_ims_conference_merge_drop_second_call_from_participant(
5684            call_ab_id, call_ac_id)
5685
5686    @TelephonyBaseTest.tel_test_wrap
5687    @test_tracker_info(uuid="9a809168-1ca4-4672-a5b3-934aeed0f06c")
5688    def test_volte_mo_mt_add_wcdma_swap_once_merge_drop_second_call_from_participant_cep(
5689            self):
5690        """ Test swap and merge features in VoLTE call. CEP enabled.
5691
5692        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5693        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5694        3. Swap active call on PhoneA.
5695        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5696        5. End call on PhoneC, verify call continues.
5697        6. End call on PhoneB, verify call end on PhoneA.
5698
5699        Returns:
5700            True if pass; False if fail.
5701        """
5702        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(1)
5703        if call_ab_id is None or call_ac_id is None:
5704            return False
5705
5706        return self._test_ims_conference_merge_drop_second_call_from_participant(
5707            call_ab_id, call_ac_id)
5708
5709    @TelephonyBaseTest.tel_test_wrap
5710    @test_tracker_info(uuid="4a146608-fbc7-4828-b2ee-77e08c19ddec")
5711    def test_volte_mo_mt_add_wcdma_swap_once_merge_drop_second_call_from_host_cep(
5712            self):
5713        """ Test swap and merge features in VoLTE call. CEP enabled.
5714
5715        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5716        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5717        3. Swap active call on PhoneA.
5718        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5719        5. On PhoneA disconnect call between A-C, verify call continues.
5720        6. On PhoneA disconnect call between A-B, verify call continues.
5721
5722        Returns:
5723            True if pass; False if fail.
5724        """
5725        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(1)
5726        if call_ab_id is None or call_ac_id is None:
5727            return False
5728
5729        return self._test_ims_conference_merge_drop_second_call_from_host(
5730            call_ab_id, call_ac_id)
5731
5732    @TelephonyBaseTest.tel_test_wrap
5733    @test_tracker_info(uuid="4a3d4c0b-912a-4922-a4a3-f0bdf600c376")
5734    def test_volte_mo_mt_add_wcdma_swap_once_merge_drop_first_call_from_participant_cep(
5735            self):
5736        """ Test swap and merge features in VoLTE call. CEP enabled.
5737
5738        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5739        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5740        3. Swap active call on PhoneA.
5741        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5742        5. End call on PhoneB, verify call continues.
5743        6. End call on PhoneC, verify call end on PhoneA.
5744
5745        Returns:
5746            True if pass; False if fail.
5747        """
5748        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(1)
5749        if call_ab_id is None or call_ac_id is None:
5750            return False
5751
5752        return self._test_ims_conference_merge_drop_first_call_from_participant(
5753            call_ab_id, call_ac_id)
5754
5755    @TelephonyBaseTest.tel_test_wrap
5756    @test_tracker_info(uuid="614903e0-7091-4791-9af6-076799e43a97")
5757    def test_volte_mo_mt_add_wcdma_swap_once_merge_drop_first_call_from_host_cep(
5758            self):
5759        """ Test swap and merge features in VoLTE call. CEP enabled.
5760
5761        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5762        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5763        3. Swap active call on PhoneA.
5764        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5765        5. On PhoneA disconnect call between A-B, verify call continues.
5766        6. On PhoneA disconnect call between A-C, verify call continues.
5767
5768        Returns:
5769            True if pass; False if fail.
5770        """
5771        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(1)
5772        if call_ab_id is None or call_ac_id is None:
5773            return False
5774
5775        return self._test_ims_conference_merge_drop_first_call_from_host(
5776            call_ab_id, call_ac_id)
5777
5778    @TelephonyBaseTest.tel_test_wrap
5779    @test_tracker_info(uuid="cea2ffc9-b8c8-46df-8f58-b606f3d352e2")
5780    def test_volte_mo_mt_add_wcdma_swap_twice_merge_drop_second_call_from_participant_no_cep(
5781            self):
5782        """ Test VoLTE Conference Call among three phones. No CEP.
5783
5784        PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5785        PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5786        Swap active call on PhoneA.
5787        Swap active call on PhoneA.
5788        On PhoneA, merge to conference call (No CEP).
5789        End call on PhoneC, verify call continues.
5790        End call on PhoneB, verify call end on PhoneA.
5791
5792        Returns:
5793            True if pass; False if fail.
5794        """
5795        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(2)
5796        if call_ab_id is None or call_ac_id is None:
5797            return False
5798
5799        return self._test_ims_conference_merge_drop_second_call_from_participant(
5800            call_ab_id, call_ac_id)
5801
5802    @TelephonyBaseTest.tel_test_wrap
5803    @test_tracker_info(uuid="4b0e040a-f199-4dc4-9f98-eb923f79814e")
5804    def test_volte_mo_mt_add_wcdma_swap_twice_merge_drop_second_call_from_participant_cep(
5805            self):
5806        """ Test swap and merge features in VoLTE call. CEP enabled.
5807
5808        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5809        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5810        3. Swap active call on PhoneA.
5811        4. Swap active call on PhoneA.
5812        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5813        6. End call on PhoneC, verify call continues.
5814        7. End call on PhoneB, verify call end on PhoneA.
5815
5816        Returns:
5817            True if pass; False if fail.
5818        """
5819        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(2)
5820        if call_ab_id is None or call_ac_id is None:
5821            return False
5822
5823        return self._test_ims_conference_merge_drop_second_call_from_participant(
5824            call_ab_id, call_ac_id)
5825
5826    @TelephonyBaseTest.tel_test_wrap
5827    @test_tracker_info(uuid="56d45561-8e9b-40d4-bacc-a4c5ac4c2af0")
5828    def test_volte_mo_mt_add_wcdma_swap_twice_merge_drop_second_call_from_host_cep(
5829            self):
5830        """ Test swap and merge features in VoLTE call. CEP enabled.
5831
5832        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5833        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5834        3. Swap active call on PhoneA.
5835        4. Swap active call on PhoneA.
5836        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5837        6. On PhoneA disconnect call between A-C, verify call continues.
5838        7. On PhoneA disconnect call between A-B, verify call continues.
5839
5840        Returns:
5841            True if pass; False if fail.
5842        """
5843        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(2)
5844        if call_ab_id is None or call_ac_id is None:
5845            return False
5846
5847        return self._test_ims_conference_merge_drop_second_call_from_host(
5848            call_ab_id, call_ac_id)
5849
5850    @TelephonyBaseTest.tel_test_wrap
5851    @test_tracker_info(uuid="790ccd53-07e6-471b-a224-b7eeb3a83116")
5852    def test_volte_mo_mt_add_wcdma_swap_twice_merge_drop_first_call_from_participant_cep(
5853            self):
5854        """ Test swap and merge features in VoLTE call. CEP enabled.
5855
5856        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5857        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5858        3. Swap active call on PhoneA.
5859        4. Swap active call on PhoneA.
5860        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5861        6. End call on PhoneB, verify call continues.
5862        7. End call on PhoneC, verify call end on PhoneA.
5863
5864        Returns:
5865            True if pass; False if fail.
5866        """
5867        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(2)
5868        if call_ab_id is None or call_ac_id is None:
5869            return False
5870
5871        return self._test_ims_conference_merge_drop_first_call_from_participant(
5872            call_ab_id, call_ac_id)
5873
5874    @TelephonyBaseTest.tel_test_wrap
5875    @test_tracker_info(uuid="84083401-22af-4568-929a-4fd29e39db5c")
5876    def test_volte_mo_mt_add_wcdma_swap_twice_merge_drop_first_call_from_host_cep(
5877            self):
5878        """ Test swap and merge features in VoLTE call. CEP enabled.
5879
5880        1. PhoneA (VoLTE) call PhoneB (WCDMA), accept on PhoneB.
5881        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5882        3. Swap active call on PhoneA.
5883        4. Swap active call on PhoneA.
5884        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
5885        6. On PhoneA disconnect call between A-B, verify call continues.
5886        7. On PhoneA disconnect call between A-C, verify call continues.
5887
5888        Returns:
5889            True if pass; False if fail.
5890        """
5891        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_wcdma_swap_x(2)
5892        if call_ab_id is None or call_ac_id is None:
5893            return False
5894
5895        return self._test_ims_conference_merge_drop_first_call_from_host(
5896            call_ab_id, call_ac_id)
5897
5898    @TelephonyBaseTest.tel_test_wrap
5899    @test_tracker_info(uuid="11a3d9cd-6f05-4638-9683-3ee475e41fdb")
5900    def test_volte_mt_mt_add_wcdma_swap_once_merge_drop_second_call_from_participant_no_cep(
5901            self):
5902        """ Test VoLTE Conference Call among three phones. No CEP.
5903
5904        PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5905        PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5906        Swap active call on PhoneA.
5907        On PhoneA, merge to conference call (No CEP).
5908        End call on PhoneC, verify call continues.
5909        End call on PhoneB, verify call end on PhoneA.
5910
5911        Returns:
5912            True if pass; False if fail.
5913        """
5914        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(1)
5915        if call_ab_id is None or call_ac_id is None:
5916            return False
5917
5918        return self._test_ims_conference_merge_drop_second_call_from_participant(
5919            call_ab_id, call_ac_id)
5920
5921    @TelephonyBaseTest.tel_test_wrap
5922    @test_tracker_info(uuid="ff03b64e-fccd-45e3-8245-f8c6cb328212")
5923    def test_volte_mt_mt_add_wcdma_swap_once_merge_drop_second_call_from_participant_cep(
5924            self):
5925        """ Test swap and merge features in VoLTE call. CEP enabled.
5926
5927        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5928        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5929        3. Swap active call on PhoneA.
5930        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5931        5. End call on PhoneC, verify call continues.
5932        6. End call on PhoneB, verify call end on PhoneA.
5933
5934        Returns:
5935            True if pass; False if fail.
5936        """
5937        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(1)
5938        if call_ab_id is None or call_ac_id is None:
5939            return False
5940
5941        return self._test_ims_conference_merge_drop_second_call_from_participant(
5942            call_ab_id, call_ac_id)
5943
5944    @TelephonyBaseTest.tel_test_wrap
5945    @test_tracker_info(uuid="c1822404-df8e-4b0c-b5d2-f70bb8c3119d")
5946    def test_volte_mt_mt_add_wcdma_swap_once_merge_drop_second_call_from_host_cep(
5947            self):
5948        """ Test swap and merge features in VoLTE call. CEP enabled.
5949
5950        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5951        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5952        3. Swap active call on PhoneA.
5953        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5954        5. On PhoneA disconnect call between A-C, verify call continues.
5955        6. On PhoneA disconnect call between A-B, verify call continues.
5956
5957        Returns:
5958            True if pass; False if fail.
5959        """
5960        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(1)
5961        if call_ab_id is None or call_ac_id is None:
5962            return False
5963
5964        return self._test_ims_conference_merge_drop_second_call_from_host(
5965            call_ab_id, call_ac_id)
5966
5967    @TelephonyBaseTest.tel_test_wrap
5968    @test_tracker_info(uuid="3ebf7526-57f9-47f5-9196-b483384d6759")
5969    def test_volte_mt_mt_add_wcdma_swap_once_merge_drop_first_call_from_participant_cep(
5970            self):
5971        """ Test swap and merge features in VoLTE call. CEP enabled.
5972
5973        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5974        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5975        3. Swap active call on PhoneA.
5976        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
5977        5. End call on PhoneB, verify call continues.
5978        6. End call on PhoneC, verify call end on PhoneA.
5979
5980        Returns:
5981            True if pass; False if fail.
5982        """
5983        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(1)
5984        if call_ab_id is None or call_ac_id is None:
5985            return False
5986
5987        return self._test_ims_conference_merge_drop_first_call_from_participant(
5988            call_ab_id, call_ac_id)
5989
5990    @TelephonyBaseTest.tel_test_wrap
5991    @test_tracker_info(uuid="8b8e664d-e872-493f-bff9-34a9500b2c25")
5992    def test_volte_mt_mt_add_wcdma_swap_once_merge_drop_first_call_from_host_cep(
5993            self):
5994        """ Test swap and merge features in VoLTE call. CEP enabled.
5995
5996        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5997        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
5998        3. Swap active call on PhoneA.
5999        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6000        5. On PhoneA disconnect call between A-B, verify call continues.
6001        6. On PhoneA disconnect call between A-C, verify call continues.
6002
6003        Returns:
6004            True if pass; False if fail.
6005        """
6006        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(1)
6007        if call_ab_id is None or call_ac_id is None:
6008            return False
6009
6010        return self._test_ims_conference_merge_drop_first_call_from_host(
6011            call_ab_id, call_ac_id)
6012
6013    @TelephonyBaseTest.tel_test_wrap
6014    @test_tracker_info(uuid="aa4079dd-b5c6-41a3-ae0f-99f17fd0bae0")
6015    def test_volte_mt_mt_add_wcdma_swap_twice_merge_drop_second_call_from_participant_no_cep(
6016            self):
6017        """ Test VoLTE Conference Call among three phones. No CEP.
6018
6019        PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6020        PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6021        Swap active call on PhoneA.
6022        Swap active call on PhoneA.
6023        On PhoneA, merge to conference call (No CEP).
6024        End call on PhoneC, verify call continues.
6025        End call on PhoneB, verify call end on PhoneA.
6026
6027        Returns:
6028            True if pass; False if fail.
6029        """
6030        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(2)
6031        if call_ab_id is None or call_ac_id is None:
6032            return False
6033
6034        return self._test_ims_conference_merge_drop_second_call_from_participant(
6035            call_ab_id, call_ac_id)
6036
6037    @TelephonyBaseTest.tel_test_wrap
6038    @test_tracker_info(uuid="d9f32013-529c-46c3-9963-405ebbdbc537")
6039    def test_volte_mt_mt_add_wcdma_swap_twice_merge_drop_second_call_from_participant_cep(
6040            self):
6041        """ Test swap and merge features in VoLTE call. CEP enabled.
6042
6043        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6044        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6045        3. Swap active call on PhoneA.
6046        4. Swap active call on PhoneA.
6047        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6048        6. End call on PhoneC, verify call continues.
6049        7. End call on PhoneB, verify call end on PhoneA.
6050
6051        Returns:
6052            True if pass; False if fail.
6053        """
6054        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(2)
6055        if call_ab_id is None or call_ac_id is None:
6056            return False
6057
6058        return self._test_ims_conference_merge_drop_second_call_from_participant(
6059            call_ab_id, call_ac_id)
6060
6061    @TelephonyBaseTest.tel_test_wrap
6062    @test_tracker_info(uuid="93331954-4403-47ec-8af3-1a791ea2fc8b")
6063    def test_volte_mt_mt_add_wcdma_swap_twice_merge_drop_second_call_from_host_cep(
6064            self):
6065        """ Test swap and merge features in VoLTE call. CEP enabled.
6066
6067        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6068        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6069        3. Swap active call on PhoneA.
6070        4. Swap active call on PhoneA.
6071        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6072        6. On PhoneA disconnect call between A-C, verify call continues.
6073        7. On PhoneA disconnect call between A-B, verify call continues.
6074
6075        Returns:
6076            True if pass; False if fail.
6077        """
6078        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(2)
6079        if call_ab_id is None or call_ac_id is None:
6080            return False
6081
6082        return self._test_ims_conference_merge_drop_second_call_from_host(
6083            call_ab_id, call_ac_id)
6084
6085    @TelephonyBaseTest.tel_test_wrap
6086    @test_tracker_info(uuid="c5a47e45-166b-46db-8b12-734d5d062509")
6087    def test_volte_mt_mt_add_wcdma_swap_twice_merge_drop_first_call_from_participant_cep(
6088            self):
6089        """ Test swap and merge features in VoLTE call. CEP enabled.
6090
6091        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6092        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6093        3. Swap active call on PhoneA.
6094        4. Swap active call on PhoneA.
6095        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6096        6. End call on PhoneB, verify call continues.
6097        7. End call on PhoneC, verify call end on PhoneA.
6098
6099        Returns:
6100            True if pass; False if fail.
6101        """
6102        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(2)
6103        if call_ab_id is None or call_ac_id is None:
6104            return False
6105
6106        return self._test_ims_conference_merge_drop_first_call_from_participant(
6107            call_ab_id, call_ac_id)
6108
6109    @TelephonyBaseTest.tel_test_wrap
6110    @test_tracker_info(uuid="05bff9cf-492d-4511-ac0e-b54f1d5fa454")
6111    def test_volte_mt_mt_add_wcdma_swap_twice_merge_drop_first_call_from_host_cep(
6112            self):
6113        """ Test swap and merge features in VoLTE call. CEP enabled.
6114
6115        1. PhoneB (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6116        2. PhoneC (WCDMA) call PhoneA (VoLTE), accept on PhoneA.
6117        3. Swap active call on PhoneA.
6118        4. Swap active call on PhoneA.
6119        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6120        6. On PhoneA disconnect call between A-B, verify call continues.
6121        7. On PhoneA disconnect call between A-C, verify call continues.
6122
6123        Returns:
6124            True if pass; False if fail.
6125        """
6126        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_wcdma_swap_x(2)
6127        if call_ab_id is None or call_ac_id is None:
6128            return False
6129
6130        return self._test_ims_conference_merge_drop_first_call_from_host(
6131            call_ab_id, call_ac_id)
6132
6133    @TelephonyBaseTest.tel_test_wrap
6134    @test_tracker_info(uuid="f02add29-d61a-42f4-a1f0-271815e03c45")
6135    def test_volte_mo_mo_add_1x_swap_once_merge_drop_second_call_from_participant_no_cep(
6136            self):
6137        """ Test swap and merge features in VoLTE call. No CEP.
6138
6139        PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6140        PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6141        Swap active call on PhoneA.
6142        On PhoneA, merge to conference call (No CEP).
6143        End call on PhoneC, verify call continues.
6144        End call on PhoneB, verify call end on PhoneA.
6145
6146        Returns:
6147            True if pass; False if fail.
6148        """
6149        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(1)
6150        if call_ab_id is None or call_ac_id is None:
6151            return False
6152
6153        return self._test_ims_conference_merge_drop_second_call_from_participant(
6154            call_ab_id, call_ac_id)
6155
6156    @TelephonyBaseTest.tel_test_wrap
6157    @test_tracker_info(uuid="776821e8-259b-441e-a126-45a990e6e14d")
6158    def test_volte_mo_mo_add_1x_swap_once_merge_drop_second_call_from_participant_cep(
6159            self):
6160        """ Test swap and merge features in VoLTE call. CEP enabled.
6161
6162        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6163        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6164        3. Swap active call on PhoneA.
6165        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6166        5. End call on PhoneC, verify call continues.
6167        6. End call on PhoneB, verify call end on PhoneA.
6168
6169        Returns:
6170            True if pass; False if fail.
6171        """
6172        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(1)
6173        if call_ab_id is None or call_ac_id is None:
6174            return False
6175
6176        return self._test_ims_conference_merge_drop_second_call_from_participant(
6177            call_ab_id, call_ac_id)
6178
6179    @TelephonyBaseTest.tel_test_wrap
6180    @test_tracker_info(uuid="c542c999-d1c7-47f9-ba5c-50a582afa9e5")
6181    def test_volte_mo_mo_add_1x_swap_once_merge_drop_second_call_from_host_cep(
6182            self):
6183        """ Test swap and merge features in VoLTE call. CEP enabled.
6184
6185        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6186        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6187        3. Swap active call on PhoneA.
6188        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6189        5. On PhoneA disconnect call between A-C, verify call continues.
6190        6. On PhoneA disconnect call between A-B, verify call continues.
6191
6192        Returns:
6193            True if pass; False if fail.
6194        """
6195        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(1)
6196        if call_ab_id is None or call_ac_id is None:
6197            return False
6198
6199        return self._test_ims_conference_merge_drop_second_call_from_host(
6200            call_ab_id, call_ac_id)
6201
6202    @TelephonyBaseTest.tel_test_wrap
6203    @test_tracker_info(uuid="d40c681a-1bce-4012-a30c-774e6698ba3a")
6204    def test_volte_mo_mo_add_1x_swap_once_merge_drop_first_call_from_participant_cep(
6205            self):
6206        """ Test swap and merge features in VoLTE call. CEP enabled.
6207
6208        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6209        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6210        3. Swap active call on PhoneA.
6211        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6212        5. End call on PhoneB, verify call continues.
6213        6. End call on PhoneC, verify call end on PhoneA.
6214
6215        Returns:
6216            True if pass; False if fail.
6217        """
6218        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(1)
6219        if call_ab_id is None or call_ac_id is None:
6220            return False
6221
6222        return self._test_ims_conference_merge_drop_first_call_from_participant(
6223            call_ab_id, call_ac_id)
6224
6225    @TelephonyBaseTest.tel_test_wrap
6226    @test_tracker_info(uuid="2805f272-5ada-4dd4-916a-36070905aec4")
6227    def test_volte_mo_mo_add_1x_swap_once_merge_drop_first_call_from_host_cep(
6228            self):
6229        """ Test swap and merge features in VoLTE call. CEP enabled.
6230
6231        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6232        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6233        3. Swap active call on PhoneA.
6234        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6235        5. On PhoneA disconnect call between A-B, verify call continues.
6236        6. On PhoneA disconnect call between A-C, verify call continues.
6237
6238        Returns:
6239            True if pass; False if fail.
6240        """
6241        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(1)
6242        if call_ab_id is None or call_ac_id is None:
6243            return False
6244
6245        return self._test_ims_conference_merge_drop_first_call_from_host(
6246            call_ab_id, call_ac_id)
6247
6248    @TelephonyBaseTest.tel_test_wrap
6249    @test_tracker_info(uuid="eb2d010c-ec32-409b-8272-5b950e0076f9")
6250    def test_volte_mo_mo_add_1x_swap_twice_merge_drop_second_call_from_participant_no_cep(
6251            self):
6252        """ Test swap and merge features in VoLTE call. No CEP.
6253
6254        PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6255        PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6256        Swap active call on PhoneA.
6257        Swap active call on PhoneA.
6258        On PhoneA, merge to conference call (No CEP).
6259        End call on PhoneC, verify call continues.
6260        End call on PhoneB, verify call end on PhoneA.
6261
6262        Returns:
6263            True if pass; False if fail.
6264        """
6265        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(2)
6266        if call_ab_id is None or call_ac_id is None:
6267            return False
6268
6269        return self._test_ims_conference_merge_drop_second_call_from_participant(
6270            call_ab_id, call_ac_id)
6271
6272    @TelephonyBaseTest.tel_test_wrap
6273    @test_tracker_info(uuid="03bb2fa3-8596-4c66-8adb-a3f9c9085420")
6274    def test_volte_mo_mo_add_1x_swap_twice_merge_drop_second_call_from_participant_cep(
6275            self):
6276        """ Test swap and merge features in VoLTE call. CEP enabled.
6277
6278        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6279        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6280        3. Swap active call on PhoneA.
6281        4. Swap active call on PhoneA.
6282        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6283        6. End call on PhoneC, verify call continues.
6284        7. End call on PhoneB, verify call end on PhoneA.
6285
6286        Returns:
6287            True if pass; False if fail.
6288        """
6289        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(2)
6290        if call_ab_id is None or call_ac_id is None:
6291            return False
6292
6293        return self._test_ims_conference_merge_drop_second_call_from_participant(
6294            call_ab_id, call_ac_id)
6295
6296    @TelephonyBaseTest.tel_test_wrap
6297    @test_tracker_info(uuid="df3bb0e7-7d72-487a-8cb8-fa75b86662ef")
6298    def test_volte_mo_mo_add_1x_swap_twice_merge_drop_second_call_from_host_cep(
6299            self):
6300        """ Test swap and merge features in VoLTE call. CEP enabled.
6301
6302        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6303        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6304        3. Swap active call on PhoneA.
6305        4. Swap active call on PhoneA.
6306        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6307        6. On PhoneA disconnect call between A-C, verify call continues.
6308        7. On PhoneA disconnect call between A-B, verify call continues.
6309
6310        Returns:
6311            True if pass; False if fail.
6312        """
6313        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(2)
6314        if call_ab_id is None or call_ac_id is None:
6315            return False
6316
6317        return self._test_ims_conference_merge_drop_second_call_from_host(
6318            call_ab_id, call_ac_id)
6319
6320    @TelephonyBaseTest.tel_test_wrap
6321    @test_tracker_info(uuid="3893ce25-0fad-4eb8-af35-f9ebf47c0615")
6322    def test_volte_mo_mo_add_1x_swap_twice_merge_drop_first_call_from_participant_cep(
6323            self):
6324        """ Test swap and merge features in VoLTE call. CEP enabled.
6325
6326        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6327        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6328        3. Swap active call on PhoneA.
6329        4. Swap active call on PhoneA.
6330        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6331        6. End call on PhoneB, verify call continues.
6332        7. End call on PhoneC, verify call end on PhoneA.
6333
6334        Returns:
6335            True if pass; False if fail.
6336        """
6337        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(2)
6338        if call_ab_id is None or call_ac_id is None:
6339            return False
6340
6341        return self._test_ims_conference_merge_drop_first_call_from_participant(
6342            call_ab_id, call_ac_id)
6343
6344    @TelephonyBaseTest.tel_test_wrap
6345    @test_tracker_info(uuid="fcd0e656-4e98-40f2-b0ce-5ed90c7c4a81")
6346    def test_volte_mo_mo_add_1x_swap_twice_merge_drop_first_call_from_host_cep(
6347            self):
6348        """ Test swap and merge features in VoLTE call. CEP enabled.
6349
6350        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6351        2. PhoneA (VoLTE) call PhoneC (1x), accept on PhoneC.
6352        3. Swap active call on PhoneA.
6353        4. Swap active call on PhoneA.
6354        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6355        6. On PhoneA disconnect call between A-B, verify call continues.
6356        7. On PhoneA disconnect call between A-C, verify call continues.
6357
6358        Returns:
6359            True if pass; False if fail.
6360        """
6361        call_ab_id, call_ac_id = self._test_volte_mo_mo_add_1x_swap_x(2)
6362        if call_ab_id is None or call_ac_id is None:
6363            return False
6364
6365        return self._test_ims_conference_merge_drop_first_call_from_host(
6366            call_ab_id, call_ac_id)
6367
6368    @TelephonyBaseTest.tel_test_wrap
6369    @test_tracker_info(uuid="009b5b45-d863-4891-8403-06656b542f3d")
6370    def test_volte_mo_mt_add_1x_swap_once_merge_drop_second_call_from_participant_no_cep(
6371            self):
6372        """ Test swap and merge features in VoLTE call. No CEP.
6373
6374        PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6375        PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6376        Swap active call on PhoneA.
6377        On PhoneA, merge to conference call (No CEP).
6378        End call on PhoneC, verify call continues.
6379        End call on PhoneB, verify call end on PhoneA.
6380
6381        Returns:
6382            True if pass; False if fail.
6383        """
6384        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(1)
6385        if call_ab_id is None or call_ac_id is None:
6386            return False
6387
6388        return self._test_ims_conference_merge_drop_second_call_from_participant(
6389            call_ab_id, call_ac_id)
6390
6391    @TelephonyBaseTest.tel_test_wrap
6392    @test_tracker_info(uuid="8cfe9354-70db-4dbb-8950-b02e65f9d6ba")
6393    def test_volte_mo_mt_add_1x_swap_once_merge_drop_second_call_from_participant_cep(
6394            self):
6395        """ Test swap and merge features in VoLTE call. CEP enabled.
6396
6397        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6398        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6399        3. Swap active call on PhoneA.
6400        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6401        5. End call on PhoneC, verify call continues.
6402        6. End call on PhoneB, verify call end on PhoneA.
6403
6404        Returns:
6405            True if pass; False if fail.
6406        """
6407        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(1)
6408        if call_ab_id is None or call_ac_id is None:
6409            return False
6410
6411        return self._test_ims_conference_merge_drop_second_call_from_participant(
6412            call_ab_id, call_ac_id)
6413
6414    @TelephonyBaseTest.tel_test_wrap
6415    @test_tracker_info(uuid="d2502a9f-b35a-4390-b664-300b8310b55a")
6416    def test_volte_mo_mt_add_1x_swap_once_merge_drop_second_call_from_host_cep(
6417            self):
6418        """ Test swap and merge features in VoLTE call. CEP enabled.
6419
6420        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6421        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6422        3. Swap active call on PhoneA.
6423        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6424        5. On PhoneA disconnect call between A-C, verify call continues.
6425        6. On PhoneA disconnect call between A-B, verify call continues.
6426
6427        Returns:
6428            True if pass; False if fail.
6429        """
6430        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(1)
6431        if call_ab_id is None or call_ac_id is None:
6432            return False
6433
6434        return self._test_ims_conference_merge_drop_second_call_from_host(
6435            call_ab_id, call_ac_id)
6436
6437    @TelephonyBaseTest.tel_test_wrap
6438    @test_tracker_info(uuid="1fbddcd1-2268-4c2c-a737-c0bcbdc842cb")
6439    def test_volte_mo_mt_add_1x_swap_once_merge_drop_first_call_from_participant_cep(
6440            self):
6441        """ Test swap and merge features in VoLTE call. CEP enabled.
6442
6443        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6444        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6445        3. Swap active call on PhoneA.
6446        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6447        5. End call on PhoneB, verify call continues.
6448        6. End call on PhoneC, verify call end on PhoneA.
6449
6450        Returns:
6451            True if pass; False if fail.
6452        """
6453        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(1)
6454        if call_ab_id is None or call_ac_id is None:
6455            return False
6456
6457        return self._test_ims_conference_merge_drop_first_call_from_participant(
6458            call_ab_id, call_ac_id)
6459
6460    @TelephonyBaseTest.tel_test_wrap
6461    @test_tracker_info(uuid="91a33ca8-508b-457e-a72f-6fabd00b2453")
6462    def test_volte_mo_mt_add_1x_swap_once_merge_drop_first_call_from_host_cep(
6463            self):
6464        """ Test swap and merge features in VoLTE call. CEP enabled.
6465
6466        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6467        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6468        3. Swap active call on PhoneA.
6469        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6470        5. On PhoneA disconnect call between A-B, verify call continues.
6471        6. On PhoneA disconnect call between A-C, verify call continues.
6472
6473        Returns:
6474            True if pass; False if fail.
6475        """
6476        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(1)
6477        if call_ab_id is None or call_ac_id is None:
6478            return False
6479
6480        return self._test_ims_conference_merge_drop_first_call_from_host(
6481            call_ab_id, call_ac_id)
6482
6483    @TelephonyBaseTest.tel_test_wrap
6484    @test_tracker_info(uuid="3642995f-4de0-4327-86d6-c9e37416c7e7")
6485    def test_volte_mo_mt_add_1x_swap_twice_merge_drop_second_call_from_participant_no_cep(
6486            self):
6487        """ Test swap and merge features in VoLTE call. No CEP.
6488
6489        PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6490        PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6491        Swap active call on PhoneA.
6492        Swap active call on PhoneA.
6493        On PhoneA, merge to conference call (No CEP).
6494        End call on PhoneC, verify call continues.
6495        End call on PhoneB, verify call end on PhoneA.
6496
6497        Returns:
6498            True if pass; False if fail.
6499        """
6500        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(2)
6501        if call_ab_id is None or call_ac_id is None:
6502            return False
6503
6504        return self._test_ims_conference_merge_drop_second_call_from_participant(
6505            call_ab_id, call_ac_id)
6506
6507    @TelephonyBaseTest.tel_test_wrap
6508    @test_tracker_info(uuid="dd11f3af-09af-4fa3-9c90-8497bbd8687e")
6509    def test_volte_mo_mt_add_1x_swap_twice_merge_drop_second_call_from_participant_cep(
6510            self):
6511        """ Test swap and merge features in VoLTE call. CEP enabled.
6512
6513        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6514        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6515        3. Swap active call on PhoneA.
6516        4. Swap active call on PhoneA.
6517        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6518        6. End call on PhoneC, verify call continues.
6519        7. End call on PhoneB, verify call end on PhoneA.
6520
6521        Returns:
6522            True if pass; False if fail.
6523        """
6524        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(2)
6525        if call_ab_id is None or call_ac_id is None:
6526            return False
6527
6528        return self._test_ims_conference_merge_drop_second_call_from_participant(
6529            call_ab_id, call_ac_id)
6530
6531    @TelephonyBaseTest.tel_test_wrap
6532    @test_tracker_info(uuid="172360a1-47b2-430a-8a9c-cae6d29813b6")
6533    def test_volte_mo_mt_add_1x_swap_twice_merge_drop_second_call_from_host_cep(
6534            self):
6535        """ Test swap and merge features in VoLTE call. CEP enabled.
6536
6537        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6538        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6539        3. Swap active call on PhoneA.
6540        4. Swap active call on PhoneA.
6541        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6542        6. On PhoneA disconnect call between A-C, verify call continues.
6543        7. On PhoneA disconnect call between A-B, verify call continues.
6544
6545        Returns:
6546            True if pass; False if fail.
6547        """
6548        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(2)
6549        if call_ab_id is None or call_ac_id is None:
6550            return False
6551
6552        return self._test_ims_conference_merge_drop_second_call_from_host(
6553            call_ab_id, call_ac_id)
6554
6555    @TelephonyBaseTest.tel_test_wrap
6556    @test_tracker_info(uuid="05d63cef-45b6-47df-8999-aac2e6ecfc9f")
6557    def test_volte_mo_mt_add_1x_swap_twice_merge_drop_first_call_from_participant_cep(
6558            self):
6559        """ Test swap and merge features in VoLTE call. CEP enabled.
6560
6561        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6562        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6563        3. Swap active call on PhoneA.
6564        4. Swap active call on PhoneA.
6565        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6566        6. End call on PhoneB, verify call continues.
6567        7. End call on PhoneC, verify call end on PhoneA.
6568
6569        Returns:
6570            True if pass; False if fail.
6571        """
6572        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(2)
6573        if call_ab_id is None or call_ac_id is None:
6574            return False
6575
6576        return self._test_ims_conference_merge_drop_first_call_from_participant(
6577            call_ab_id, call_ac_id)
6578
6579    @TelephonyBaseTest.tel_test_wrap
6580    @test_tracker_info(uuid="e02dfbc5-ffa3-4bff-a45e-1b3f4147005e")
6581    def test_volte_mo_mt_add_1x_swap_twice_merge_drop_first_call_from_host_cep(
6582            self):
6583        """ Test swap and merge features in VoLTE call. CEP enabled.
6584
6585        1. PhoneA (VoLTE) call PhoneB (1x), accept on PhoneB.
6586        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6587        3. Swap active call on PhoneA.
6588        4. Swap active call on PhoneA.
6589        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6590        6. On PhoneA disconnect call between A-B, verify call continues.
6591        7. On PhoneA disconnect call between A-C, verify call continues.
6592
6593        Returns:
6594            True if pass; False if fail.
6595        """
6596        call_ab_id, call_ac_id = self._test_volte_mo_mt_add_1x_swap_x(2)
6597        if call_ab_id is None or call_ac_id is None:
6598            return False
6599
6600        return self._test_ims_conference_merge_drop_first_call_from_host(
6601            call_ab_id, call_ac_id)
6602
6603    @TelephonyBaseTest.tel_test_wrap
6604    @test_tracker_info(uuid="55bb85a0-bfbd-4b97-bd94-871e82276875")
6605    def test_volte_mt_mt_add_1x_swap_once_merge_drop_second_call_from_participant_no_cep(
6606            self):
6607        """ Test swap and merge features in VoLTE call. No CEP.
6608
6609        PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6610        PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6611        Swap active call on PhoneA.
6612        On PhoneA, merge to conference call (No CEP).
6613        End call on PhoneC, verify call continues.
6614        End call on PhoneB, verify call end on PhoneA.
6615
6616        Returns:
6617            True if pass; False if fail.
6618        """
6619        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(1)
6620        if call_ab_id is None or call_ac_id is None:
6621            return False
6622
6623        return self._test_ims_conference_merge_drop_second_call_from_participant(
6624            call_ab_id, call_ac_id)
6625
6626    @TelephonyBaseTest.tel_test_wrap
6627    @test_tracker_info(uuid="31e71818-3522-4e04-8f26-ad26683f16d1")
6628    def test_volte_mt_mt_add_1x_swap_once_merge_drop_second_call_from_participant_cep(
6629            self):
6630        """ Test swap and merge features in VoLTE call. CEP enabled.
6631
6632        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6633        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6634        3. Swap active call on PhoneA.
6635        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6636        5. End call on PhoneC, verify call continues.
6637        6. End call on PhoneB, verify call end on PhoneA.
6638
6639        Returns:
6640            True if pass; False if fail.
6641        """
6642        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(1)
6643        if call_ab_id is None or call_ac_id is None:
6644            return False
6645
6646        return self._test_ims_conference_merge_drop_second_call_from_participant(
6647            call_ab_id, call_ac_id)
6648
6649    @TelephonyBaseTest.tel_test_wrap
6650    @test_tracker_info(uuid="0b51183d-3f92-4fe8-9487-64a72696a838")
6651    def test_volte_mt_mt_add_1x_swap_once_merge_drop_second_call_from_host_cep(
6652            self):
6653        """ Test swap and merge features in VoLTE call. CEP enabled.
6654
6655        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6656        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6657        3. Swap active call on PhoneA.
6658        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6659        5. On PhoneA disconnect call between A-C, verify call continues.
6660        6. On PhoneA disconnect call between A-B, verify call continues.
6661
6662        Returns:
6663            True if pass; False if fail.
6664        """
6665        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(1)
6666        if call_ab_id is None or call_ac_id is None:
6667            return False
6668
6669        return self._test_ims_conference_merge_drop_second_call_from_host(
6670            call_ab_id, call_ac_id)
6671
6672    @TelephonyBaseTest.tel_test_wrap
6673    @test_tracker_info(uuid="2aee2db7-fcd0-4b0a-aaa0-b946a14e91bd")
6674    def test_volte_mt_mt_add_1x_swap_once_merge_drop_first_call_from_participant_cep(
6675            self):
6676        """ Test swap and merge features in VoLTE call. CEP enabled.
6677
6678        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6679        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6680        3. Swap active call on PhoneA.
6681        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6682        5. End call on PhoneB, verify call continues.
6683        6. End call on PhoneC, verify call end on PhoneA.
6684
6685        Returns:
6686            True if pass; False if fail.
6687        """
6688        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(1)
6689        if call_ab_id is None or call_ac_id is None:
6690            return False
6691
6692        return self._test_ims_conference_merge_drop_first_call_from_participant(
6693            call_ab_id, call_ac_id)
6694
6695    @TelephonyBaseTest.tel_test_wrap
6696    @test_tracker_info(uuid="d78bbe8e-6d39-4843-9eaa-47f06b6e9a95")
6697    def test_volte_mt_mt_add_1x_swap_once_merge_drop_first_call_from_host_cep(
6698            self):
6699        """ Test swap and merge features in VoLTE call. CEP enabled.
6700
6701        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6702        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6703        3. Swap active call on PhoneA.
6704        4. On PhoneA, merge to conference call (VoLTE CEP conference call).
6705        5. On PhoneA disconnect call between A-B, verify call continues.
6706        6. On PhoneA disconnect call between A-C, verify call continues.
6707
6708        Returns:
6709            True if pass; False if fail.
6710        """
6711        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(1)
6712        if call_ab_id is None or call_ac_id is None:
6713            return False
6714
6715        return self._test_ims_conference_merge_drop_first_call_from_host(
6716            call_ab_id, call_ac_id)
6717
6718    @TelephonyBaseTest.tel_test_wrap
6719    @test_tracker_info(uuid="bbf4dcd8-3e1d-4ad0-a4fd-bf875e409f15")
6720    def test_volte_mt_mt_add_1x_swap_twice_merge_drop_second_call_from_participant_no_cep(
6721            self):
6722        """ Test swap and merge features in VoLTE call. No CEP.
6723
6724        PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6725        PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6726        Swap active call on PhoneA.
6727        Swap active call on PhoneA.
6728        On PhoneA, merge to conference call (No CEP).
6729        End call on PhoneC, verify call continues.
6730        End call on PhoneB, verify call end on PhoneA.
6731
6732        Returns:
6733            True if pass; False if fail.
6734        """
6735        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(2)
6736        if call_ab_id is None or call_ac_id is None:
6737            return False
6738
6739        return self._test_ims_conference_merge_drop_second_call_from_participant(
6740            call_ab_id, call_ac_id)
6741
6742    @TelephonyBaseTest.tel_test_wrap
6743    @test_tracker_info(uuid="c222e199-497b-4c34-886d-b35592ccd3b2")
6744    def test_volte_mt_mt_add_1x_swap_twice_merge_drop_second_call_from_participant_cep(
6745            self):
6746        """ Test swap and merge features in VoLTE call. CEP enabled.
6747
6748        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6749        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6750        3. Swap active call on PhoneA.
6751        4. Swap active call on PhoneA.
6752        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6753        6. End call on PhoneC, verify call continues.
6754        7. End call on PhoneB, verify call end on PhoneA.
6755
6756        Returns:
6757            True if pass; False if fail.
6758        """
6759        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(2)
6760        if call_ab_id is None or call_ac_id is None:
6761            return False
6762
6763        return self._test_ims_conference_merge_drop_second_call_from_participant(
6764            call_ab_id, call_ac_id)
6765
6766    @TelephonyBaseTest.tel_test_wrap
6767    @test_tracker_info(uuid="d916eef5-b942-48fe-9c63-be7e283b197d")
6768    def test_volte_mt_mt_add_1x_swap_twice_merge_drop_second_call_from_host_cep(
6769            self):
6770        """ Test swap and merge features in VoLTE call. CEP enabled.
6771
6772        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6773        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6774        3. Swap active call on PhoneA.
6775        4. Swap active call on PhoneA.
6776        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6777        6. On PhoneA disconnect call between A-C, verify call continues.
6778        7. On PhoneA disconnect call between A-B, verify call continues.
6779
6780        Returns:
6781            True if pass; False if fail.
6782        """
6783        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(2)
6784        if call_ab_id is None or call_ac_id is None:
6785            return False
6786
6787        return self._test_ims_conference_merge_drop_second_call_from_host(
6788            call_ab_id, call_ac_id)
6789
6790    @TelephonyBaseTest.tel_test_wrap
6791    @test_tracker_info(uuid="e34acc9d-4389-4bc3-b34d-6b7e8173cadf")
6792    def test_volte_mt_mt_add_1x_swap_twice_merge_drop_first_call_from_participant_cep(
6793            self):
6794        """ Test swap and merge features in VoLTE call. CEP enabled.
6795
6796        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6797        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6798        3. Swap active call on PhoneA.
6799        4. Swap active call on PhoneA.
6800        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6801        6. End call on PhoneB, verify call continues.
6802        7. End call on PhoneC, verify call end on PhoneA.
6803
6804        Returns:
6805            True if pass; False if fail.
6806        """
6807        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(2)
6808        if call_ab_id is None or call_ac_id is None:
6809            return False
6810
6811        return self._test_ims_conference_merge_drop_first_call_from_participant(
6812            call_ab_id, call_ac_id)
6813
6814    @TelephonyBaseTest.tel_test_wrap
6815    @test_tracker_info(uuid="31ddc496-03a5-407f-b925-8cea04dbdae0")
6816    def test_volte_mt_mt_add_1x_swap_twice_merge_drop_first_call_from_host_cep(
6817            self):
6818        """ Test swap and merge features in VoLTE call. CEP enabled.
6819
6820        1. PhoneB (1x) call PhoneA (VoLTE), accept on PhoneA.
6821        2. PhoneC (1x) call PhoneA (VoLTE), accept on PhoneA.
6822        3. Swap active call on PhoneA.
6823        4. Swap active call on PhoneA.
6824        5. On PhoneA, merge to conference call (VoLTE CEP conference call).
6825        6. On PhoneA disconnect call between A-B, verify call continues.
6826        7. On PhoneA disconnect call between A-C, verify call continues.
6827
6828        Returns:
6829            True if pass; False if fail.
6830        """
6831        call_ab_id, call_ac_id = self._test_volte_mt_mt_add_1x_swap_x(2)
6832        if call_ab_id is None or call_ac_id is None:
6833            return False
6834
6835        return self._test_ims_conference_merge_drop_first_call_from_host(
6836            call_ab_id, call_ac_id)
6837
6838    @TelephonyBaseTest.tel_test_wrap
6839    @test_tracker_info(uuid="35b6fa0f-780f-4436-93a0-70f9b79bc71a")
6840    def test_csfb_wcdma_mo_mo_add_swap_once_merge_drop(self):
6841        """Test swap and merge feature in CSFB WCDMA call.
6842
6843        PhoneA (CSFB_WCDMA) call PhoneB, accept on PhoneB.
6844        PhoneA (CSFB_WCDMA) call PhoneC, accept on PhoneC.
6845        Swap active call on PhoneA.
6846        Merge calls to conference on PhoneA.
6847        Hangup on PhoneC, check call continues between AB.
6848        Hangup on PhoneB, check A ends.
6849
6850        """
6851        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mo_add_swap_x(1)
6852        if call_ab_id is None or call_ac_id is None:
6853            return False
6854
6855        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6856
6857    @TelephonyBaseTest.tel_test_wrap
6858    @test_tracker_info(uuid="9102ce81-0c17-4c7a-93df-f240245a07c5")
6859    def test_csfb_wcdma_mo_mo_add_swap_twice_merge_drop(self):
6860        """Test swap and merge feature in CSFB WCDMA call.
6861
6862        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
6863        PhoneA (CSFB WCDMA) call PhoneC, accept on PhoneC.
6864        Swap active call on PhoneA.
6865        Swap active call on PhoneA.
6866        Merge calls to conference on PhoneA.
6867        Hangup on PhoneC, check call continues between AB.
6868        Hangup on PhoneB, check A ends.
6869
6870        """
6871        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mo_add_swap_x(2)
6872        if call_ab_id is None or call_ac_id is None:
6873            return False
6874
6875        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6876
6877    @TelephonyBaseTest.tel_test_wrap
6878    @test_tracker_info(uuid="b85ff5a7-f512-4585-a6b1-d92c9e7c25de")
6879    def test_csfb_wcdma_mo_mt_add_swap_once_merge_drop(self):
6880        """Test swap and merge feature in CSFB WCDMA call.
6881
6882        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
6883        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
6884        Swap active call on PhoneA.
6885        Merge calls to conference on PhoneA.
6886        Hangup on PhoneC, check call continues between AB.
6887        Hangup on PhoneB, check A ends.
6888
6889        """
6890        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mt_add_swap_x(1)
6891        if call_ab_id is None or call_ac_id is None:
6892            return False
6893
6894        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6895
6896    @TelephonyBaseTest.tel_test_wrap
6897    @test_tracker_info(uuid="83a74ce1-9028-4e67-a417-599616ab0b2c")
6898    def test_csfb_wcdma_mo_mt_add_swap_twice_merge_drop(self):
6899        """Test swap and merge feature in CSFB WCDMA call.
6900
6901        PhoneA (CSFB WCDMA) call PhoneB, accept on PhoneB.
6902        PhoneC call PhoneA (CSFB WCDMA), accept on PhoneA.
6903        Swap active call on PhoneA.
6904        Swap active call on PhoneA.
6905        Merge calls to conference on PhoneA.
6906        Hangup on PhoneC, check call continues between AB.
6907        Hangup on PhoneB, check A ends.
6908
6909        """
6910        call_ab_id, call_ac_id = self._test_csfb_wcdma_mo_mt_add_swap_x(2)
6911        if call_ab_id is None or call_ac_id is None:
6912            return False
6913
6914        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6915
6916    @TelephonyBaseTest.tel_test_wrap
6917    @test_tracker_info(uuid="835fe3d6-4e44-451c-9c5f-277b8842bf10")
6918    def test_wcdma_mo_mo_add_swap_once_merge_drop(self):
6919        """Test swap and merge feature in WCDMA call.
6920
6921        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
6922        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
6923        Swap active call on PhoneA.
6924        Merge calls to conference on PhoneA.
6925        Hangup on PhoneC, check call continues between AB.
6926        Hangup on PhoneB, check A ends.
6927
6928        """
6929        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(1)
6930        if call_ab_id is None or call_ac_id is None:
6931            return False
6932
6933        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6934
6935    @TelephonyBaseTest.tel_test_wrap
6936    @test_tracker_info(uuid="627eb239-c6f6-47dc-b4cf-8d1796599417")
6937    def test_wcdma_mo_mo_add_swap_twice_merge_drop(self):
6938        """Test swap and merge feature in WCDMA call.
6939
6940        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
6941        PhoneA (WCDMA) call PhoneC, accept on PhoneC.
6942        Swap active call on PhoneA.
6943        Swap active call on PhoneA.
6944        Merge calls to conference on PhoneA.
6945        Hangup on PhoneC, check call continues between AB.
6946        Hangup on PhoneB, check A ends.
6947
6948        """
6949        call_ab_id, call_ac_id = self._test_wcdma_mo_mo_add_swap_x(2)
6950        if call_ab_id is None or call_ac_id is None:
6951            return False
6952
6953        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6954
6955    @TelephonyBaseTest.tel_test_wrap
6956    @test_tracker_info(uuid="571efb21-0ed5-4871-a7d8-f86d94e0ef25")
6957    def test_wcdma_mo_mt_add_swap_once_merge_drop(self):
6958        """Test swap and merge feature in WCDMA call.
6959
6960        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
6961        PhoneC call PhoneA (WCDMA), accept on PhoneA.
6962        Swap active call on PhoneA.
6963        Merge calls to conference on PhoneA.
6964        Hangup on PhoneC, check call continues between AB.
6965        Hangup on PhoneB, check A ends.
6966
6967        """
6968        call_ab_id, call_ac_id = self._test_wcdma_mo_mt_add_swap_x(1)
6969        if call_ab_id is None or call_ac_id is None:
6970            return False
6971
6972        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6973
6974    @TelephonyBaseTest.tel_test_wrap
6975    @test_tracker_info(uuid="c981a90a-19b8-4582-a07c-1e9447fbe9ae")
6976    def test_wcdma_mo_mt_add_swap_twice_merge_drop(self):
6977        """Test swap and merge feature in WCDMA call.
6978
6979        PhoneA (WCDMA) call PhoneB, accept on PhoneB.
6980        PhoneC call PhoneA (WCDMA), accept on PhoneA.
6981        Swap active call on PhoneA.
6982        Swap active call on PhoneA.
6983        Merge calls to conference on PhoneA.
6984        Hangup on PhoneC, check call continues between AB.
6985        Hangup on PhoneB, check A ends.
6986
6987        """
6988        call_ab_id, call_ac_id = self._test_wcdma_mo_mt_add_swap_x(2)
6989        if call_ab_id is None or call_ac_id is None:
6990            return False
6991
6992        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
6993
6994    @TelephonyBaseTest.tel_test_wrap
6995    @test_tracker_info(uuid="23843881-320b-4071-bbc8-93cd1ee08408")
6996    def test_wcdma_mt_mt_add_swap_once_merge_drop(self):
6997        """Test swap and merge feature in WCDMA call.
6998
6999        PhoneB call PhoneA (WCDMA), accept on PhoneA.
7000        PhoneC call PhoneA (WCDMA), accept on PhoneA.
7001        Swap active call on PhoneA.
7002        Merge calls to conference on PhoneA.
7003        Hangup on PhoneC, check call continues between AB.
7004        Hangup on PhoneB, check A ends.
7005
7006        """
7007        call_ab_id, call_ac_id = self._test_wcdma_mt_mt_add_swap_x(1)
7008        if call_ab_id is None or call_ac_id is None:
7009            return False
7010
7011        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
7012
7013    @TelephonyBaseTest.tel_test_wrap
7014    @test_tracker_info(uuid="e447ec45-016c-4723-a954-4bde2e342cb2")
7015    def test_wcdma_mt_mt_add_swap_twice_merge_drop(self):
7016        """Test swap and merge feature in WCDMA call.
7017
7018        PhoneB call PhoneA (WCDMA), accept on PhoneA.
7019        PhoneC call PhoneA (WCDMA), accept on PhoneA.
7020        Swap active call on PhoneA.
7021        Swap active call on PhoneA.
7022        Merge calls to conference on PhoneA.
7023        Hangup on PhoneC, check call continues between AB.
7024        Hangup on PhoneB, check A ends.
7025
7026        """
7027        call_ab_id, call_ac_id = self._test_wcdma_mt_mt_add_swap_x(2)
7028        if call_ab_id is None or call_ac_id is None:
7029            return False
7030
7031        return self._test_wcdma_conference_merge_drop(call_ab_id, call_ac_id)
7032
7033    @TelephonyBaseTest.tel_test_wrap
7034    @test_tracker_info(uuid="876dc6b2-75c2-4fb5-92a0-35d3d29fbd42")
7035    def test_wcdma_mt_mt_add_merge_unmerge_swap_drop(self):
7036        """Test Conference Call Unmerge operation.
7037
7038        Phones A, B, C are in WCDMA Conference call (MT-MT-Merge)
7039        Unmerge call with B on PhoneA
7040        Check the number of Call Ids to be 2 on PhoneA
7041        Check if call AB is active since 'B' was unmerged
7042        Swap call to C
7043        Check if call AC is active
7044        Tear down calls
7045        All Phones should be in Idle
7046
7047        """
7048        call_ab_id, call_ac_id = self._test_wcdma_mt_mt_add_swap_x(0)
7049        if call_ab_id is None or call_ac_id is None:
7050            self.log.error("Either of Call AB ID or Call AC ID is None.")
7051            return False
7052
7053        ads = self.android_devices
7054
7055        self.log.info("Step4: Merge to Conf Call and verify Conf Call.")
7056        ads[0].droid.telecomCallJoinCallsInConf(call_ab_id, call_ac_id)
7057        time.sleep(WAIT_TIME_IN_CALL)
7058        calls = ads[0].droid.telecomCallGetCallIds()
7059        ads[0].log.info("Calls in PhoneA %s", calls)
7060        if num_active_calls(self.log, ads[0]) != 3:
7061            ads[0].log.error("Total number of call ids is not 3.")
7062            return False
7063        call_conf_id = None
7064        for call_id in calls:
7065            if call_id != call_ab_id and call_id != call_ac_id:
7066                call_conf_id = call_id
7067        if not call_conf_id:
7068            self.log.error("Merge call fail, no new conference call id.")
7069            return False
7070        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
7071            return False
7072
7073        # Check if Conf Call currently active
7074        if ads[0].droid.telecomCallGetCallState(
7075                call_conf_id) != CALL_STATE_ACTIVE:
7076            ads[0].log.error(
7077                "Call_id: %s, state: %s, expected: STATE_ACTIVE", call_conf_id,
7078                ads[0].droid.telecomCallGetCallState(call_conf_id))
7079            return False
7080
7081        # Unmerge
7082        self.log.info("Step5: UnMerge Conf Call into individual participants.")
7083        ads[0].droid.telecomCallSplitFromConf(call_ab_id)
7084        time.sleep(WAIT_TIME_IN_CALL)
7085        calls = ads[0].droid.telecomCallGetCallIds()
7086        ads[0].log.info("Calls in PhoneA %s", calls)
7087
7088        # Are there 2 calls?
7089        if num_active_calls(self.log, ads[0]) != 2:
7090            ads[0].log.error("Total number of call ids is not 2")
7091            return False
7092
7093        # Unmerged calls not dropped?
7094        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
7095            self.log.error("Either Call_AB or Call_AC was dropped")
7096            return False
7097
7098        # Unmerged call in call state ACTIVE?
7099        if ads[0].droid.telecomCallGetCallState(
7100                call_ab_id) != CALL_STATE_ACTIVE:
7101            ads[0].log.error("Call_id: %s, state:%s, expected: STATE_ACTIVE",
7102                             call_ab_id,
7103                             ads[0].droid.telecomCallGetCallState(call_ab_id))
7104            return False
7105
7106        # Swap call
7107        self.log.info("Step6: Swap call and see if Call_AC is ACTIVE.")
7108        num_swaps = 1
7109        if not swap_calls(self.log, ads, call_ac_id, call_ab_id, num_swaps):
7110            self.log.error("Failed to swap calls.")
7111            return False
7112
7113        # Other call in call state ACTIVE?
7114        if ads[0].droid.telecomCallGetCallState(
7115                call_ac_id) != CALL_STATE_ACTIVE:
7116            ads[0].log.error("Call_id: %s, state: %s, expected: STATE_ACTIVE",
7117                             call_ac_id,
7118                             ads[0].droid.telecomCallGetCallState(call_ac_id))
7119            return False
7120
7121        # All calls still CONNECTED?
7122        return self._three_phone_hangup_call_verify_call_state(
7123            ad_hangup=ads[2],
7124            ad_verify=ads[0],
7125            call_id=call_ab_id,
7126            call_state=self._get_expected_call_state(ads[0]),
7127            ads_active=[ads[0], ads[1]])
7128
7129    @TelephonyBaseTest.tel_test_wrap
7130    @test_tracker_info(uuid="63da439e-23f3-4c3c-9e7e-3af6500342c5")
7131    def test_epdg_mo_mo_add_epdg_merge_drop_wfc_wifi_only(self):
7132        """ Test Conf Call among three phones.
7133
7134        Call from PhoneA (epdg) to PhoneB (epdg), accept on PhoneB.
7135        Call from PhoneA (epdg) to PhoneC (epdg), accept on PhoneC.
7136        On PhoneA, merge to conference call.
7137        End call on PhoneC, verify call continues.
7138        End call on PhoneB, verify call end on PhoneA.
7139
7140        Returns:
7141            True if pass; False if fail.
7142        """
7143        ads = self.android_devices
7144
7145        tasks = [(phone_setup_iwlan,
7146                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7147                   self.wifi_network_ssid, self.wifi_network_pass)),
7148                 (phone_setup_iwlan,
7149                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7150                   self.wifi_network_ssid, self.wifi_network_pass)),
7151                 (phone_setup_iwlan,
7152                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7153                   self.wifi_network_ssid, self.wifi_network_pass))]
7154        if not multithread_func(self.log, tasks):
7155            self.log.error("Phone Failed to Set Up Properly.")
7156            return False
7157
7158        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
7159        if call_ab_id is None or call_ac_id is None:
7160            return False
7161
7162        return self._test_ims_conference_merge_drop_second_call_from_participant(call_ab_id, call_ac_id)
7163
7164    @TelephonyBaseTest.tel_test_wrap
7165    @test_tracker_info(uuid="89b9f228-97a6-4e5c-96b9-a7f87d847c22")
7166    def test_epdg_mo_mo_add_epdg_merge_drop_wfc_wifi_preferred(self):
7167        """ Test Conf Call among three phones.
7168
7169        Call from PhoneA (epdg) to PhoneB (epdg), accept on PhoneB.
7170        Call from PhoneA (epdg) to PhoneC (epdg), accept on PhoneC.
7171        On PhoneA, merge to conference call.
7172        End call on PhoneC, verify call continues.
7173        End call on PhoneB, verify call end on PhoneA.
7174
7175        Returns:
7176            True if pass; False if fail.
7177        """
7178        ads = self.android_devices
7179
7180        tasks = [(phone_setup_iwlan,
7181                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7182                   self.wifi_network_ssid, self.wifi_network_pass)),
7183                 (phone_setup_iwlan,
7184                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7185                   self.wifi_network_ssid, self.wifi_network_pass)),
7186                 (phone_setup_iwlan,
7187                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
7188                   self.wifi_network_ssid, self.wifi_network_pass))]
7189        if not multithread_func(self.log, tasks):
7190            self.log.error("Phone Failed to Set Up Properly.")
7191            return False
7192
7193        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
7194        if call_ab_id is None or call_ac_id is None:
7195            return False
7196
7197        return self._test_ims_conference_merge_drop_second_call_from_participant(
7198            call_ab_id, call_ac_id)
7199
7200    @TelephonyBaseTest.tel_test_wrap
7201    @test_tracker_info(uuid="2c6dc281-59b0-4ea4-b811-e4c3a4d654ab")
7202    def test_epdg_mo_mt_add_epdg_merge_drop_wfc_wifi_only(self):
7203        """ Test Conf Call among three phones.
7204
7205        Call from PhoneA (epdg) to PhoneB (epdg), accept on PhoneB.
7206        Call from PhoneC (epdg) to PhoneA (epdg), accept on PhoneA.
7207        On PhoneA, merge to conference call.
7208        End call on PhoneC, verify call continues.
7209        End call on PhoneB, verify call end on PhoneA.
7210
7211        Returns:
7212            True if pass; False if fail.
7213        """
7214        ads = self.android_devices
7215
7216        tasks = [(phone_setup_iwlan,
7217                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7218                   self.wifi_network_ssid, self.wifi_network_pass)),
7219                 (phone_setup_iwlan,
7220                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7221                   self.wifi_network_ssid, self.wifi_network_pass)),
7222                 (phone_setup_iwlan,
7223                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7224                   self.wifi_network_ssid, self.wifi_network_pass))]
7225        if not multithread_func(self.log, tasks):
7226            self.log.error("Phone Failed to Set Up Properly.")
7227            return False
7228
7229        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
7230        if call_ab_id is None or call_ac_id is None:
7231            return False
7232
7233        return self._test_ims_conference_merge_drop_second_call_from_participant(
7234            call_ab_id, call_ac_id)
7235
7236    @TelephonyBaseTest.tel_test_wrap
7237    @test_tracker_info(uuid="f6727241-b727-4eb8-8c0d-f61d3a14a635")
7238    def test_epdg_mo_mt_add_epdg_merge_drop_wfc_wifi_preferred(self):
7239        """ Test Conf Call among three phones.
7240
7241        Call from PhoneA (epdg) to PhoneB (epdg), accept on PhoneB.
7242        Call from PhoneC (epdg) to PhoneA (epdg), accept on PhoneA.
7243        On PhoneA, merge to conference call.
7244        End call on PhoneC, verify call continues.
7245        End call on PhoneB, verify call end on PhoneA.
7246
7247        Returns:
7248            True if pass; False if fail.
7249        """
7250        ads = self.android_devices
7251
7252        tasks = [(phone_setup_iwlan,
7253                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7254                   self.wifi_network_ssid, self.wifi_network_pass)),
7255                 (phone_setup_iwlan,
7256                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7257                   self.wifi_network_ssid, self.wifi_network_pass)),
7258                 (phone_setup_iwlan,
7259                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
7260                   self.wifi_network_ssid, self.wifi_network_pass))]
7261        if not multithread_func(self.log, tasks):
7262            self.log.error("Phone Failed to Set Up Properly.")
7263            return False
7264
7265        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
7266        if call_ab_id is None or call_ac_id is None:
7267            return False
7268
7269        return self._test_ims_conference_merge_drop_second_call_from_participant(
7270            call_ab_id, call_ac_id)
7271
7272    @TelephonyBaseTest.tel_test_wrap
7273    @test_tracker_info(uuid="c9e54db0-2b0b-428b-ba63-619ad0b8637b")
7274    def test_epdg_mt_mt_add_epdg_merge_drop_wfc_wifi_only(self):
7275        """ Test Conf Call among three phones.
7276
7277        Call from PhoneB (epdg) to PhoneA (epdg), accept on PhoneA.
7278        Call from PhoneC (epdg) to PhoneA (epdg), accept on PhoneA.
7279        On PhoneA, merge to conference call.
7280        End call on PhoneC, verify call continues.
7281        End call on PhoneB, verify call end on PhoneA.
7282
7283        Returns:
7284            True if pass; False if fail.
7285        """
7286        ads = self.android_devices
7287
7288        tasks = [(phone_setup_iwlan,
7289                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7290                   self.wifi_network_ssid, self.wifi_network_pass)),
7291                 (phone_setup_iwlan,
7292                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7293                   self.wifi_network_ssid, self.wifi_network_pass)),
7294                 (phone_setup_iwlan,
7295                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7296                   self.wifi_network_ssid, self.wifi_network_pass))]
7297        if not multithread_func(self.log, tasks):
7298            self.log.error("Phone Failed to Set Up Properly.")
7299            return False
7300
7301        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
7302        if call_ab_id is None or call_ac_id is None:
7303            return False
7304
7305        return self._test_ims_conference_merge_drop_second_call_from_participant(
7306            call_ab_id, call_ac_id)
7307
7308    @TelephonyBaseTest.tel_test_wrap
7309    @test_tracker_info(uuid="a478cc82-d95c-43fc-9735-d8333b8937e2")
7310    def test_epdg_mt_mt_add_epdg_merge_drop_wfc_wifi_preferred(self):
7311        """ Test Conf Call among three phones.
7312
7313        Call from PhoneB (epdg) to PhoneA (epdg), accept on PhoneA.
7314        Call from PhoneC (epdg) to PhoneA (epdg), accept on PhoneA.
7315        On PhoneA, merge to conference call.
7316        End call on PhoneC, verify call continues.
7317        End call on PhoneB, verify call end on PhoneA.
7318
7319        Returns:
7320            True if pass; False if fail.
7321        """
7322        ads = self.android_devices
7323
7324        tasks = [(phone_setup_iwlan,
7325                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7326                   self.wifi_network_ssid, self.wifi_network_pass)),
7327                 (phone_setup_iwlan,
7328                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7329                   self.wifi_network_ssid, self.wifi_network_pass)),
7330                 (phone_setup_iwlan,
7331                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
7332                   self.wifi_network_ssid, self.wifi_network_pass))]
7333        if not multithread_func(self.log, tasks):
7334            self.log.error("Phone Failed to Set Up Properly.")
7335            return False
7336
7337        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
7338        if call_ab_id is None or call_ac_id is None:
7339            return False
7340
7341        return self._test_ims_conference_merge_drop_second_call_from_participant(
7342            call_ab_id, call_ac_id)
7343
7344    @TelephonyBaseTest.tel_test_wrap
7345    @test_tracker_info(uuid="b1acb263-1481-44a5-b18e-58bdeff7bc1e")
7346    def test_epdg_mo_mo_add_volte_merge_drop_wfc_wifi_only(self):
7347        """ Test Conf Call among three phones.
7348
7349        Call from PhoneA (epdg) to PhoneB (VoLTE), accept on PhoneB.
7350        Call from PhoneA (epdg) to PhoneC (VoLTE), accept on PhoneC.
7351        On PhoneA, merge to conference call.
7352        End call on PhoneC, verify call continues.
7353        End call on PhoneB, verify call end on PhoneA.
7354
7355        Returns:
7356            True if pass; False if fail.
7357        """
7358        ads = self.android_devices
7359
7360        tasks = [(phone_setup_iwlan,
7361                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7362                   self.wifi_network_ssid, self.wifi_network_pass)),
7363                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
7364                                                           (self.log, ads[2]))]
7365        if not multithread_func(self.log, tasks):
7366            self.log.error("Phone Failed to Set Up Properly.")
7367            return False
7368
7369        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_volte_swap_x(0)
7370        if call_ab_id is None or call_ac_id is None:
7371            return False
7372
7373        return self._test_ims_conference_merge_drop_second_call_from_participant(
7374            call_ab_id, call_ac_id)
7375
7376    @TelephonyBaseTest.tel_test_wrap
7377    @test_tracker_info(uuid="03b8a0d2-80dd-465a-ad14-5db94cdbcc53")
7378    def test_epdg_mo_mo_add_volte_merge_drop_wfc_wifi_preferred(self):
7379        """ Test Conf Call among three phones.
7380
7381        Call from PhoneA (epdg) to PhoneB (VoLTE), accept on PhoneB.
7382        Call from PhoneA (epdg) to PhoneC (VoLTE), accept on PhoneC.
7383        On PhoneA, merge to conference call.
7384        End call on PhoneC, verify call continues.
7385        End call on PhoneB, verify call end on PhoneA.
7386
7387        Returns:
7388            True if pass; False if fail.
7389        """
7390        ads = self.android_devices
7391
7392        tasks = [(phone_setup_iwlan,
7393                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7394                   self.wifi_network_ssid, self.wifi_network_pass)),
7395                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
7396                                                           (self.log, ads[2]))]
7397        if not multithread_func(self.log, tasks):
7398            self.log.error("Phone Failed to Set Up Properly.")
7399            return False
7400
7401        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_volte_swap_x(0)
7402        if call_ab_id is None or call_ac_id is None:
7403            return False
7404
7405        return self._test_ims_conference_merge_drop_second_call_from_participant(
7406            call_ab_id, call_ac_id)
7407
7408    @TelephonyBaseTest.tel_test_wrap
7409    @test_tracker_info(uuid="9eb1a816-1e2c-41da-b083-2026163a3893")
7410    def test_epdg_mo_mt_add_volte_merge_drop_wfc_wifi_only(self):
7411        """ Test Conf Call among three phones.
7412
7413        Call from PhoneA (epdg) to PhoneB (VoLTE), accept on PhoneB.
7414        Call from PhoneC (VoLTE) to PhoneA (epdg), accept on PhoneA.
7415        On PhoneA, merge to conference call.
7416        End call on PhoneC, verify call continues.
7417        End call on PhoneB, verify call end on PhoneA.
7418
7419        Returns:
7420            True if pass; False if fail.
7421        """
7422        ads = self.android_devices
7423
7424        tasks = [(phone_setup_iwlan,
7425                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7426                   self.wifi_network_ssid, self.wifi_network_pass)),
7427                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
7428                                                           (self.log, ads[2]))]
7429        if not multithread_func(self.log, tasks):
7430            self.log.error("Phone Failed to Set Up Properly.")
7431            return False
7432
7433        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_volte_swap_x(0)
7434        if call_ab_id is None or call_ac_id is None:
7435            return False
7436
7437        return self._test_ims_conference_merge_drop_second_call_from_participant(
7438            call_ab_id, call_ac_id)
7439
7440    @TelephonyBaseTest.tel_test_wrap
7441    @test_tracker_info(uuid="3d66a1b6-916f-4221-bd99-21ff4d40ebb8")
7442    def test_epdg_mo_mt_add_volte_merge_drop_wfc_wifi_preferred(self):
7443        """ Test Conf Call among three phones.
7444
7445        Call from PhoneA (epdg) to PhoneB (VoLTE), accept on PhoneB.
7446        Call from PhoneC (VoLTE) to PhoneA (epdg), accept on PhoneA.
7447        On PhoneA, merge to conference call.
7448        End call on PhoneC, verify call continues.
7449        End call on PhoneB, verify call end on PhoneA.
7450
7451        Returns:
7452            True if pass; False if fail.
7453        """
7454        ads = self.android_devices
7455
7456        tasks = [(phone_setup_iwlan,
7457                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7458                   self.wifi_network_ssid, self.wifi_network_pass)),
7459                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
7460                                                           (self.log, ads[2]))]
7461        if not multithread_func(self.log, tasks):
7462            self.log.error("Phone Failed to Set Up Properly.")
7463            return False
7464
7465        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_volte_swap_x(0)
7466        if call_ab_id is None or call_ac_id is None:
7467            return False
7468
7469        return self._test_ims_conference_merge_drop_second_call_from_participant(
7470            call_ab_id, call_ac_id)
7471
7472    @TelephonyBaseTest.tel_test_wrap
7473    @test_tracker_info(uuid="9d8e8b2f-e2b9-4607-8c54-6233b3096123")
7474    def test_epdg_mo_mo_add_wcdma_merge_drop_wfc_wifi_only(self):
7475        """ Test Conf Call among three phones.
7476
7477        Call from PhoneA (epdg) to PhoneB (WCDMA), accept on PhoneB.
7478        Call from PhoneA (epdg) to PhoneC (WCDMA), accept on PhoneC.
7479        On PhoneA, merge to conference call.
7480        End call on PhoneC, verify call continues.
7481        End call on PhoneB, verify call end on PhoneA.
7482
7483        Returns:
7484            True if pass; False if fail.
7485        """
7486        ads = self.android_devices
7487
7488        tasks = [(phone_setup_iwlan,
7489                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7490                   self.wifi_network_ssid, self.wifi_network_pass)),
7491                 (phone_setup_voice_3g, (self.log, ads[1])),
7492                 (phone_setup_voice_3g, (self.log, ads[2]))]
7493        if not multithread_func(self.log, tasks):
7494            self.log.error("Phone Failed to Set Up Properly.")
7495            return False
7496
7497        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_wcdma_swap_x(0)
7498        if call_ab_id is None or call_ac_id is None:
7499            return False
7500
7501        return self._test_ims_conference_merge_drop_second_call_from_participant(
7502            call_ab_id, call_ac_id)
7503
7504    @TelephonyBaseTest.tel_test_wrap
7505    @test_tracker_info(uuid="0884206b-2471-4a7e-95aa-228379416ff8")
7506    def test_epdg_mo_mo_add_wcdma_merge_drop_wfc_wifi_preferred(self):
7507        """ Test Conf Call among three phones.
7508
7509        Call from PhoneA (epdg) to PhoneB (WCDMA), accept on PhoneB.
7510        Call from PhoneA (epdg) to PhoneC (WCDMA), accept on PhoneC.
7511        On PhoneA, merge to conference call.
7512        End call on PhoneC, verify call continues.
7513        End call on PhoneB, verify call end on PhoneA.
7514
7515        Returns:
7516            True if pass; False if fail.
7517        """
7518        ads = self.android_devices
7519
7520        tasks = [(phone_setup_iwlan,
7521                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7522                   self.wifi_network_ssid, self.wifi_network_pass)),
7523                 (phone_setup_voice_3g, (self.log, ads[1])),
7524                 (phone_setup_voice_3g, (self.log, ads[2]))]
7525        if not multithread_func(self.log, tasks):
7526            self.log.error("Phone Failed to Set Up Properly.")
7527            return False
7528
7529        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_wcdma_swap_x(0)
7530        if call_ab_id is None or call_ac_id is None:
7531            return False
7532
7533        return self._test_ims_conference_merge_drop_second_call_from_participant(
7534            call_ab_id, call_ac_id)
7535
7536    @TelephonyBaseTest.tel_test_wrap
7537    @test_tracker_info(uuid="c7706af6-dc77-4002-b295-66c60aeace6b")
7538    def test_epdg_mo_mt_add_wcdma_merge_drop_wfc_wifi_only(self):
7539        """ Test Conf Call among three phones.
7540
7541        Call from PhoneA (epdg) to PhoneB (WCDMA), accept on PhoneB.
7542        Call from PhoneC (WCDMA) to PhoneA (epdg), accept on PhoneA.
7543        On PhoneA, merge to conference call.
7544        End call on PhoneC, verify call continues.
7545        End call on PhoneB, verify call end on PhoneA.
7546
7547        Returns:
7548            True if pass; False if fail.
7549        """
7550        ads = self.android_devices
7551
7552        tasks = [(phone_setup_iwlan,
7553                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7554                   self.wifi_network_ssid, self.wifi_network_pass)),
7555                 (phone_setup_voice_3g, (self.log, ads[1])),
7556                 (phone_setup_voice_3g, (self.log, ads[2]))]
7557        if not multithread_func(self.log, tasks):
7558            self.log.error("Phone Failed to Set Up Properly.")
7559            return False
7560
7561        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_wcdma_swap_x(0)
7562        if call_ab_id is None or call_ac_id is None:
7563            return False
7564
7565        return self._test_ims_conference_merge_drop_second_call_from_participant(
7566            call_ab_id, call_ac_id)
7567
7568    @TelephonyBaseTest.tel_test_wrap
7569    @test_tracker_info(uuid="b079618f-e32b-4ba0-9009-06e013805c39")
7570    def test_epdg_mo_mt_add_wcdma_merge_drop_wfc_wifi_preferred(self):
7571        """ Test Conf Call among three phones.
7572
7573        Call from PhoneA (epdg) to PhoneB (WCDMA), accept on PhoneB.
7574        Call from PhoneC (WCDMA) to PhoneA (epdg), accept on PhoneA.
7575        On PhoneA, merge to conference call.
7576        End call on PhoneC, verify call continues.
7577        End call on PhoneB, verify call end on PhoneA.
7578
7579        Returns:
7580            True if pass; False if fail.
7581        """
7582        ads = self.android_devices
7583
7584        tasks = [(phone_setup_iwlan,
7585                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7586                   self.wifi_network_ssid, self.wifi_network_pass)),
7587                 (phone_setup_voice_3g, (self.log, ads[1])),
7588                 (phone_setup_voice_3g, (self.log, ads[2]))]
7589        if not multithread_func(self.log, tasks):
7590            self.log.error("Phone Failed to Set Up Properly.")
7591            return False
7592
7593        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_wcdma_swap_x(0)
7594        if call_ab_id is None or call_ac_id is None:
7595            return False
7596
7597        return self._test_ims_conference_merge_drop_second_call_from_participant(
7598            call_ab_id, call_ac_id)
7599
7600    @TelephonyBaseTest.tel_test_wrap
7601    @test_tracker_info(uuid="571fe98b-354f-4038-8441-0e4b1840eb7a")
7602    def test_epdg_mo_mo_add_1x_merge_drop_wfc_wifi_only(self):
7603        """ Test Conf Call among three phones.
7604
7605        Call from PhoneA (epdg) to PhoneB (1x), accept on PhoneB.
7606        Call from PhoneA (epdg) to PhoneC (1x), accept on PhoneC.
7607        On PhoneA, merge to conference call.
7608        End call on PhoneC, verify call continues.
7609        End call on PhoneB, verify call end on PhoneA.
7610
7611        Returns:
7612            True if pass; False if fail.
7613        """
7614        ads = self.android_devices
7615
7616        tasks = [(phone_setup_iwlan,
7617                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7618                   self.wifi_network_ssid, self.wifi_network_pass)),
7619                 (phone_setup_voice_3g, (self.log, ads[1])),
7620                 (phone_setup_voice_3g, (self.log, ads[2]))]
7621        if not multithread_func(self.log, tasks):
7622            self.log.error("Phone Failed to Set Up Properly.")
7623            return False
7624
7625        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_1x_swap_x(0)
7626        if call_ab_id is None or call_ac_id is None:
7627            return False
7628
7629        return self._test_ims_conference_merge_drop_second_call_from_participant(
7630            call_ab_id, call_ac_id)
7631
7632    @TelephonyBaseTest.tel_test_wrap
7633    @test_tracker_info(uuid="8f531f3c-493e-43d6-9d6d-f4990b5feba4")
7634    def test_epdg_mo_mo_add_1x_merge_drop_wfc_wifi_preferred(self):
7635        """ Test Conf Call among three phones.
7636
7637        Call from PhoneA (epdg) to PhoneB (1x), accept on PhoneB.
7638        Call from PhoneA (epdg) to PhoneC (1x), accept on PhoneC.
7639        On PhoneA, merge to conference call.
7640        End call on PhoneC, verify call continues.
7641        End call on PhoneB, verify call end on PhoneA.
7642
7643        Returns:
7644            True if pass; False if fail.
7645        """
7646        ads = self.android_devices
7647
7648        tasks = [(phone_setup_iwlan,
7649                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7650                   self.wifi_network_ssid, self.wifi_network_pass)),
7651                 (phone_setup_voice_3g, (self.log, ads[1])),
7652                 (phone_setup_voice_3g, (self.log, ads[2]))]
7653        if not multithread_func(self.log, tasks):
7654            self.log.error("Phone Failed to Set Up Properly.")
7655            return False
7656
7657        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_1x_swap_x(0)
7658        if call_ab_id is None or call_ac_id is None:
7659            return False
7660
7661        return self._test_ims_conference_merge_drop_second_call_from_participant(
7662            call_ab_id, call_ac_id)
7663
7664    @TelephonyBaseTest.tel_test_wrap
7665    @test_tracker_info(uuid="00e1194b-3c06-46c4-8764-0339c0aa9f9e")
7666    def test_epdg_mo_mt_add_1x_merge_drop_wfc_wifi_only(self):
7667        """ Test Conf Call among three phones.
7668
7669        Call from PhoneA (epdg) to PhoneB (1x), accept on PhoneB.
7670        Call from PhoneC (1x) to PhoneA (epdg), accept on PhoneA.
7671        On PhoneA, merge to conference call.
7672        End call on PhoneC, verify call continues.
7673        End call on PhoneB, verify call end on PhoneA.
7674
7675        Returns:
7676            True if pass; False if fail.
7677        """
7678        ads = self.android_devices
7679
7680        tasks = [(phone_setup_iwlan,
7681                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7682                   self.wifi_network_ssid, self.wifi_network_pass)),
7683                 (phone_setup_voice_3g, (self.log, ads[1])),
7684                 (phone_setup_voice_3g, (self.log, ads[2]))]
7685        if not multithread_func(self.log, tasks):
7686            self.log.error("Phone Failed to Set Up Properly.")
7687            return False
7688
7689        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_1x_swap_x(0)
7690        if call_ab_id is None or call_ac_id is None:
7691            return False
7692
7693        return self._test_ims_conference_merge_drop_second_call_from_participant(
7694            call_ab_id, call_ac_id)
7695
7696    @TelephonyBaseTest.tel_test_wrap
7697    @test_tracker_info(uuid="c94f6444-d265-4277-9555-57041e3c4ff4")
7698    def test_epdg_mo_mt_add_1x_merge_drop_wfc_wifi_preferred(self):
7699        """ Test Conf Call among three phones.
7700
7701        Call from PhoneA (epdg) to PhoneB (1x), accept on PhoneB.
7702        Call from PhoneC (1x) to PhoneA (epdg), accept on PhoneA.
7703        On PhoneA, merge to conference call.
7704        End call on PhoneC, verify call continues.
7705        End call on PhoneB, verify call end on PhoneA.
7706
7707        Returns:
7708            True if pass; False if fail.
7709        """
7710        ads = self.android_devices
7711
7712        tasks = [(phone_setup_iwlan,
7713                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7714                   self.wifi_network_ssid, self.wifi_network_pass)),
7715                 (phone_setup_voice_3g, (self.log, ads[1])),
7716                 (phone_setup_voice_3g, (self.log, ads[2]))]
7717        if not multithread_func(self.log, tasks):
7718            self.log.error("Phone Failed to Set Up Properly.")
7719            return False
7720
7721        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_1x_swap_x(0)
7722        if call_ab_id is None or call_ac_id is None:
7723            return False
7724
7725        return self._test_ims_conference_merge_drop_second_call_from_participant(
7726            call_ab_id, call_ac_id)
7727
7728    @TelephonyBaseTest.tel_test_wrap
7729    @test_tracker_info(uuid="0980745e-dcdc-4c56-84e3-e2ee076059ee")
7730    def test_epdg_mo_mo_add_epdg_swap_once_merge_drop_wfc_wifi_only(self):
7731        """Test swap and merge feature in epdg call.
7732
7733        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7734        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
7735        Swap active call on PhoneA.
7736        Merge calls to conference on PhoneA.
7737        Hangup on PhoneC, check call continues between AB.
7738        Hangup on PhoneB, check A ends.
7739
7740        """
7741        ads = self.android_devices
7742
7743        tasks = [(phone_setup_iwlan,
7744                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7745                   self.wifi_network_ssid, self.wifi_network_pass)),
7746                 (phone_setup_iwlan,
7747                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7748                   self.wifi_network_ssid, self.wifi_network_pass)),
7749                 (phone_setup_iwlan,
7750                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7751                   self.wifi_network_ssid, self.wifi_network_pass))]
7752        if not multithread_func(self.log, tasks):
7753            self.log.error("Phone Failed to Set Up Properly.")
7754            return False
7755
7756        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
7757        if call_ab_id is None or call_ac_id is None:
7758            return False
7759
7760        return self._test_ims_conference_merge_drop_second_call_from_participant(
7761            call_ab_id, call_ac_id)
7762
7763    @TelephonyBaseTest.tel_test_wrap
7764    @test_tracker_info(uuid="6bf0b152-fb1c-4edc-9525-b39e8640b967")
7765    def test_epdg_mo_mo_add_epdg_swap_once_merge_drop_wfc_wifi_preferred(self):
7766        """Test swap and merge feature in epdg call.
7767
7768        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7769        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
7770        Swap active call on PhoneA.
7771        Merge calls to conference on PhoneA.
7772        Hangup on PhoneC, check call continues between AB.
7773        Hangup on PhoneB, check A ends.
7774
7775        """
7776        ads = self.android_devices
7777
7778        tasks = [(phone_setup_iwlan,
7779                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7780                   self.wifi_network_ssid, self.wifi_network_pass)),
7781                 (phone_setup_iwlan,
7782                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7783                   self.wifi_network_ssid, self.wifi_network_pass)),
7784                 (phone_setup_iwlan,
7785                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
7786                   self.wifi_network_ssid, self.wifi_network_pass))]
7787        if not multithread_func(self.log, tasks):
7788            self.log.error("Phone Failed to Set Up Properly.")
7789            return False
7790
7791        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
7792        if call_ab_id is None or call_ac_id is None:
7793            return False
7794
7795        return self._test_ims_conference_merge_drop_second_call_from_participant(
7796            call_ab_id, call_ac_id)
7797
7798    @TelephonyBaseTest.tel_test_wrap
7799    @test_tracker_info(uuid="e3013df6-98ca-4318-85ba-04011ba0a24f")
7800    def test_epdg_mo_mo_add_epdg_swap_twice_merge_drop_wfc_wifi_only(self):
7801        """Test swap and merge feature in epdg call.
7802
7803        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7804        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
7805        Swap active call on PhoneA.
7806        Swap active call on PhoneA.
7807        Merge calls to conference on PhoneA.
7808        Hangup on PhoneC, check call continues between AB.
7809        Hangup on PhoneB, check A ends.
7810
7811        """
7812        ads = self.android_devices
7813
7814        tasks = [(phone_setup_iwlan,
7815                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7816                   self.wifi_network_ssid, self.wifi_network_pass)),
7817                 (phone_setup_iwlan,
7818                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7819                   self.wifi_network_ssid, self.wifi_network_pass)),
7820                 (phone_setup_iwlan,
7821                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7822                   self.wifi_network_ssid, self.wifi_network_pass))]
7823        if not multithread_func(self.log, tasks):
7824            self.log.error("Phone Failed to Set Up Properly.")
7825            return False
7826
7827        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
7828        if call_ab_id is None or call_ac_id is None:
7829            return False
7830
7831        return self._test_ims_conference_merge_drop_second_call_from_participant(
7832            call_ab_id, call_ac_id)
7833
7834    @TelephonyBaseTest.tel_test_wrap
7835    @test_tracker_info(uuid="e88bf042-8799-44c7-bc50-66ac1e1fb2ac")
7836    def test_epdg_mo_mo_add_epdg_swap_twice_merge_drop_wfc_wifi_preferred(
7837            self):
7838        """Test swap and merge feature in epdg call.
7839
7840        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7841        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
7842        Swap active call on PhoneA.
7843        Swap active call on PhoneA.
7844        Merge calls to conference on PhoneA.
7845        Hangup on PhoneC, check call continues between AB.
7846        Hangup on PhoneB, check A ends.
7847
7848        """
7849        ads = self.android_devices
7850
7851        tasks = [(phone_setup_iwlan,
7852                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7853                   self.wifi_network_ssid, self.wifi_network_pass)),
7854                 (phone_setup_iwlan,
7855                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7856                   self.wifi_network_ssid, self.wifi_network_pass)),
7857                 (phone_setup_iwlan,
7858                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
7859                   self.wifi_network_ssid, self.wifi_network_pass))]
7860        if not multithread_func(self.log, tasks):
7861            self.log.error("Phone Failed to Set Up Properly.")
7862            return False
7863
7864        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
7865        if call_ab_id is None or call_ac_id is None:
7866            return False
7867
7868        return self._test_ims_conference_merge_drop_second_call_from_participant(
7869            call_ab_id, call_ac_id)
7870
7871    @TelephonyBaseTest.tel_test_wrap
7872    @test_tracker_info(uuid="a8302e73-82a4-4409-b038-5c604fb4c66c")
7873    def test_epdg_mo_mt_add_epdg_swap_once_merge_drop_wfc_wifi_only(self):
7874        """Test swap and merge feature in epdg call.
7875
7876        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7877        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
7878        Swap active call on PhoneA.
7879        Merge calls to conference on PhoneA.
7880        Hangup on PhoneC, check call continues between AB.
7881        Hangup on PhoneB, check A ends.
7882
7883        """
7884        ads = self.android_devices
7885
7886        tasks = [(phone_setup_iwlan,
7887                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7888                   self.wifi_network_ssid, self.wifi_network_pass)),
7889                 (phone_setup_iwlan,
7890                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7891                   self.wifi_network_ssid, self.wifi_network_pass)),
7892                 (phone_setup_iwlan,
7893                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7894                   self.wifi_network_ssid, self.wifi_network_pass))]
7895        if not multithread_func(self.log, tasks):
7896            self.log.error("Phone Failed to Set Up Properly.")
7897            return False
7898
7899        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
7900        if call_ab_id is None or call_ac_id is None:
7901            return False
7902
7903        return self._test_ims_conference_merge_drop_second_call_from_participant(
7904            call_ab_id, call_ac_id)
7905
7906    @TelephonyBaseTest.tel_test_wrap
7907    @test_tracker_info(uuid="80f69baf-1649-4858-b35c-b25baf79b42c")
7908    def test_epdg_mo_mt_add_epdg_swap_once_merge_drop_wfc_wifi_preferred(self):
7909        """Test swap and merge feature in epdg call.
7910
7911        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7912        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
7913        Swap active call on PhoneA.
7914        Merge calls to conference on PhoneA.
7915        Hangup on PhoneC, check call continues between AB.
7916        Hangup on PhoneB, check A ends.
7917
7918        """
7919        ads = self.android_devices
7920
7921        tasks = [(phone_setup_iwlan,
7922                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7923                   self.wifi_network_ssid, self.wifi_network_pass)),
7924                 (phone_setup_iwlan,
7925                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7926                   self.wifi_network_ssid, self.wifi_network_pass)),
7927                 (phone_setup_iwlan,
7928                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
7929                   self.wifi_network_ssid, self.wifi_network_pass))]
7930        if not multithread_func(self.log, tasks):
7931            self.log.error("Phone Failed to Set Up Properly.")
7932            return False
7933
7934        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
7935        if call_ab_id is None or call_ac_id is None:
7936            return False
7937
7938        return self._test_ims_conference_merge_drop_second_call_from_participant(
7939            call_ab_id, call_ac_id)
7940
7941    @TelephonyBaseTest.tel_test_wrap
7942    @test_tracker_info(uuid="1ac0c067-49fb-41d9-8649-cc709bdd8926")
7943    def test_epdg_mo_mt_add_epdg_swap_twice_merge_drop_wfc_wifi_only(self):
7944        """Test swap and merge feature in epdg call.
7945
7946        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7947        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
7948        Swap active call on PhoneA.
7949        Swap active call on PhoneA.
7950        Merge calls to conference on PhoneA.
7951        Hangup on PhoneC, check call continues between AB.
7952        Hangup on PhoneB, check A ends.
7953
7954        """
7955        ads = self.android_devices
7956
7957        tasks = [(phone_setup_iwlan,
7958                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
7959                   self.wifi_network_ssid, self.wifi_network_pass)),
7960                 (phone_setup_iwlan,
7961                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
7962                   self.wifi_network_ssid, self.wifi_network_pass)),
7963                 (phone_setup_iwlan,
7964                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
7965                   self.wifi_network_ssid, self.wifi_network_pass))]
7966        if not multithread_func(self.log, tasks):
7967            self.log.error("Phone Failed to Set Up Properly.")
7968            return False
7969
7970        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(2)
7971        if call_ab_id is None or call_ac_id is None:
7972            return False
7973
7974        return self._test_ims_conference_merge_drop_second_call_from_participant(
7975            call_ab_id, call_ac_id)
7976
7977    @TelephonyBaseTest.tel_test_wrap
7978    @test_tracker_info(uuid="b20b1a94-048c-4f10-9261-dde79e1edb00")
7979    def test_epdg_mo_mt_add_epdg_swap_twice_merge_drop_wfc_wifi_preferred(
7980            self):
7981        """Test swap and merge feature in epdg call.
7982
7983        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
7984        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
7985        Swap active call on PhoneA.
7986        Swap active call on PhoneA.
7987        Merge calls to conference on PhoneA.
7988        Hangup on PhoneC, check call continues between AB.
7989        Hangup on PhoneB, check A ends.
7990
7991        """
7992        ads = self.android_devices
7993
7994        tasks = [(phone_setup_iwlan,
7995                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
7996                   self.wifi_network_ssid, self.wifi_network_pass)),
7997                 (phone_setup_iwlan,
7998                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
7999                   self.wifi_network_ssid, self.wifi_network_pass)),
8000                 (phone_setup_iwlan,
8001                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
8002                   self.wifi_network_ssid, self.wifi_network_pass))]
8003        if not multithread_func(self.log, tasks):
8004            self.log.error("Phone Failed to Set Up Properly.")
8005            return False
8006
8007        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(2)
8008        if call_ab_id is None or call_ac_id is None:
8009            return False
8010
8011        return self._test_ims_conference_merge_drop_second_call_from_participant(
8012            call_ab_id, call_ac_id)
8013
8014    @TelephonyBaseTest.tel_test_wrap
8015    @test_tracker_info(uuid="402b175f-1510-4e2a-97c2-7c9ea5ce40f6")
8016    def test_epdg_mo_mo_add_volte_swap_once_merge_drop_wfc_wifi_only(self):
8017        """Test swap and merge feature in epdg call.
8018
8019        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8020        PhoneA (epdg) call PhoneC (VoLTE), accept on PhoneC.
8021        Swap active call on PhoneA.
8022        Merge calls to conference on PhoneA.
8023        Hangup on PhoneC, check call continues between AB.
8024        Hangup on PhoneB, check A ends.
8025
8026        """
8027        ads = self.android_devices
8028
8029        tasks = [(phone_setup_iwlan,
8030                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8031                   self.wifi_network_ssid, self.wifi_network_pass)),
8032                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8033                                                           (self.log, ads[2]))]
8034        if not multithread_func(self.log, tasks):
8035            self.log.error("Phone Failed to Set Up Properly.")
8036            return False
8037
8038        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_volte_swap_x(1)
8039        if call_ab_id is None or call_ac_id is None:
8040            return False
8041
8042        return self._test_ims_conference_merge_drop_second_call_from_participant(
8043            call_ab_id, call_ac_id)
8044
8045    @TelephonyBaseTest.tel_test_wrap
8046    @test_tracker_info(uuid="7c710fbf-4b77-4b46-9719-e17b3d047cfc")
8047    def test_epdg_mo_mo_add_volte_swap_once_merge_drop_wfc_wifi_preferred(
8048            self):
8049        """Test swap and merge feature in epdg call.
8050
8051        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8052        PhoneA (epdg) call PhoneC (VoLTE), accept on PhoneC.
8053        Swap active call on PhoneA.
8054        Merge calls to conference on PhoneA.
8055        Hangup on PhoneC, check call continues between AB.
8056        Hangup on PhoneB, check A ends.
8057
8058        """
8059        ads = self.android_devices
8060
8061        tasks = [(phone_setup_iwlan,
8062                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8063                   self.wifi_network_ssid, self.wifi_network_pass)),
8064                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8065                                                           (self.log, ads[2]))]
8066        if not multithread_func(self.log, tasks):
8067            self.log.error("Phone Failed to Set Up Properly.")
8068            return False
8069
8070        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_volte_swap_x(1)
8071        if call_ab_id is None or call_ac_id is None:
8072            return False
8073
8074        return self._test_ims_conference_merge_drop_second_call_from_participant(
8075            call_ab_id, call_ac_id)
8076
8077    @TelephonyBaseTest.tel_test_wrap
8078    @test_tracker_info(uuid="642afbac-30c1-4dbf-bf3e-758ab6c3a306")
8079    def test_epdg_mo_mo_add_volte_swap_twice_merge_drop_wfc_wifi_only(self):
8080        """Test swap and merge feature in epdg call.
8081
8082        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8083        PhoneA (epdg) call PhoneC (VoLTE), accept on PhoneC.
8084        Swap active call on PhoneA.
8085        Swap active call on PhoneA.
8086        Merge calls to conference on PhoneA.
8087        Hangup on PhoneC, check call continues between AB.
8088        Hangup on PhoneB, check A ends.
8089
8090        """
8091        ads = self.android_devices
8092
8093        tasks = [(phone_setup_iwlan,
8094                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8095                   self.wifi_network_ssid, self.wifi_network_pass)),
8096                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8097                                                           (self.log, ads[2]))]
8098        if not multithread_func(self.log, tasks):
8099            self.log.error("Phone Failed to Set Up Properly.")
8100            return False
8101
8102        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_volte_swap_x(2)
8103        if call_ab_id is None or call_ac_id is None:
8104            return False
8105
8106        return self._test_ims_conference_merge_drop_second_call_from_participant(
8107            call_ab_id, call_ac_id)
8108
8109    @TelephonyBaseTest.tel_test_wrap
8110    @test_tracker_info(uuid="a4ae1e39-ed6d-412e-b821-321c715a5d47")
8111    def test_epdg_mo_mo_add_volte_swap_twice_merge_drop_wfc_wifi_preferred(
8112            self):
8113        """Test swap and merge feature in epdg call.
8114
8115        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8116        PhoneA (epdg) call PhoneC (VoLTE), accept on PhoneC.
8117        Swap active call on PhoneA.
8118        Swap active call on PhoneA.
8119        Merge calls to conference on PhoneA.
8120        Hangup on PhoneC, check call continues between AB.
8121        Hangup on PhoneB, check A ends.
8122
8123        """
8124        ads = self.android_devices
8125
8126        tasks = [(phone_setup_iwlan,
8127                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8128                   self.wifi_network_ssid, self.wifi_network_pass)),
8129                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8130                                                           (self.log, ads[2]))]
8131        if not multithread_func(self.log, tasks):
8132            self.log.error("Phone Failed to Set Up Properly.")
8133            return False
8134
8135        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_volte_swap_x(2)
8136        if call_ab_id is None or call_ac_id is None:
8137            return False
8138
8139        return self._test_ims_conference_merge_drop_second_call_from_participant(
8140            call_ab_id, call_ac_id)
8141
8142    @TelephonyBaseTest.tel_test_wrap
8143    @test_tracker_info(uuid="7b8431f2-8a49-4aa9-b84d-77f16a6a2c30")
8144    def test_epdg_mo_mt_add_volte_swap_once_merge_drop_wfc_wifi_only(self):
8145        """Test swap and merge feature in epdg call.
8146
8147        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8148        PhoneC (VoLTE) call PhoneA (epdg), accept on PhoneA.
8149        Swap active call on PhoneA.
8150        Merge calls to conference on PhoneA.
8151        Hangup on PhoneC, check call continues between AB.
8152        Hangup on PhoneB, check A ends.
8153
8154        """
8155        ads = self.android_devices
8156
8157        tasks = [(phone_setup_iwlan,
8158                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8159                   self.wifi_network_ssid, self.wifi_network_pass)),
8160                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8161                                                           (self.log, ads[2]))]
8162        if not multithread_func(self.log, tasks):
8163            self.log.error("Phone Failed to Set Up Properly.")
8164            return False
8165
8166        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_volte_swap_x(1)
8167        if call_ab_id is None or call_ac_id is None:
8168            return False
8169
8170        return self._test_ims_conference_merge_drop_second_call_from_participant(
8171            call_ab_id, call_ac_id)
8172
8173    @TelephonyBaseTest.tel_test_wrap
8174    @test_tracker_info(uuid="5b4d7444-32a1-4e82-8847-1c4ae002edca")
8175    def test_epdg_mo_mt_add_volte_swap_once_merge_drop_wfc_wifi_preferred(
8176            self):
8177        """Test swap and merge feature in epdg call.
8178
8179        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8180        PhoneC (VoLTE) call PhoneA (epdg), accept on PhoneA.
8181        Swap active call on PhoneA.
8182        Merge calls to conference on PhoneA.
8183        Hangup on PhoneC, check call continues between AB.
8184        Hangup on PhoneB, check A ends.
8185
8186        """
8187        ads = self.android_devices
8188
8189        tasks = [(phone_setup_iwlan,
8190                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8191                   self.wifi_network_ssid, self.wifi_network_pass)),
8192                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8193                                                           (self.log, ads[2]))]
8194        if not multithread_func(self.log, tasks):
8195            self.log.error("Phone Failed to Set Up Properly.")
8196            return False
8197
8198        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_volte_swap_x(1)
8199        if call_ab_id is None or call_ac_id is None:
8200            return False
8201
8202        return self._test_ims_conference_merge_drop_second_call_from_participant(
8203            call_ab_id, call_ac_id)
8204
8205    @TelephonyBaseTest.tel_test_wrap
8206    @test_tracker_info(uuid="88c6c179-0b56-4d03-b5e4-76a147a40995")
8207    def test_epdg_mo_mt_add_volte_swap_twice_merge_drop_wfc_wifi_only(self):
8208        """Test swap and merge feature in epdg call.
8209
8210        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8211        PhoneC (VoLTE) call PhoneA (epdg), accept on PhoneA.
8212        Swap active call on PhoneA.
8213        Swap active call on PhoneA.
8214        Merge calls to conference on PhoneA.
8215        Hangup on PhoneC, check call continues between AB.
8216        Hangup on PhoneB, check A ends.
8217
8218        """
8219        ads = self.android_devices
8220
8221        tasks = [(phone_setup_iwlan,
8222                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8223                   self.wifi_network_ssid, self.wifi_network_pass)),
8224                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8225                                                           (self.log, ads[2]))]
8226        if not multithread_func(self.log, tasks):
8227            self.log.error("Phone Failed to Set Up Properly.")
8228            return False
8229
8230        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_volte_swap_x(2)
8231        if call_ab_id is None or call_ac_id is None:
8232            return False
8233
8234        return self._test_ims_conference_merge_drop_second_call_from_participant(
8235            call_ab_id, call_ac_id)
8236
8237    @TelephonyBaseTest.tel_test_wrap
8238    @test_tracker_info(uuid="7f744ab3-f919-4a7a-83ce-e38487d619cc")
8239    def test_epdg_mo_mt_add_volte_swap_twice_merge_drop_wfc_wifi_preferred(
8240            self):
8241        """Test swap and merge feature in epdg call.
8242
8243        PhoneA (epdg) call PhoneB (VoLTE), accept on PhoneB.
8244        PhoneC (VoLTE) call PhoneA (epdg), accept on PhoneA.
8245        Swap active call on PhoneA.
8246        Swap active call on PhoneA.
8247        Merge calls to conference on PhoneA.
8248        Hangup on PhoneC, check call continues between AB.
8249        Hangup on PhoneB, check A ends.
8250
8251        """
8252        ads = self.android_devices
8253
8254        tasks = [(phone_setup_iwlan,
8255                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8256                   self.wifi_network_ssid, self.wifi_network_pass)),
8257                 (phone_setup_volte, (self.log, ads[1])), (phone_setup_volte,
8258                                                           (self.log, ads[2]))]
8259        if not multithread_func(self.log, tasks):
8260            self.log.error("Phone Failed to Set Up Properly.")
8261            return False
8262
8263        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_volte_swap_x(2)
8264        if call_ab_id is None or call_ac_id is None:
8265            return False
8266
8267        return self._test_ims_conference_merge_drop_second_call_from_participant(
8268            call_ab_id, call_ac_id)
8269
8270    @TelephonyBaseTest.tel_test_wrap
8271    @test_tracker_info(uuid="5c861a99-a1b8-45fc-ba67-f8fde4575efc")
8272    def test_epdg_mo_mo_add_wcdma_swap_once_merge_drop_wfc_wifi_only(self):
8273        """Test swap and merge feature in epdg call.
8274
8275        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8276        PhoneA (epdg) call PhoneC (WCDMA), accept on PhoneC.
8277        Swap active call on PhoneA.
8278        Merge calls to conference on PhoneA.
8279        Hangup on PhoneC, check call continues between AB.
8280        Hangup on PhoneB, check A ends.
8281
8282        """
8283        ads = self.android_devices
8284
8285        tasks = [(phone_setup_iwlan,
8286                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8287                   self.wifi_network_ssid, self.wifi_network_pass)),
8288                 (phone_setup_voice_3g, (self.log, ads[1])),
8289                 (phone_setup_voice_3g, (self.log, ads[2]))]
8290        if not multithread_func(self.log, tasks):
8291            self.log.error("Phone Failed to Set Up Properly.")
8292            return False
8293
8294        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_wcdma_swap_x(1)
8295        if call_ab_id is None or call_ac_id is None:
8296            return False
8297
8298        return self._test_ims_conference_merge_drop_second_call_from_participant(
8299            call_ab_id, call_ac_id)
8300
8301    @TelephonyBaseTest.tel_test_wrap
8302    @test_tracker_info(uuid="fdb32a13-302c-4c1c-a77e-f78ed7e90911")
8303    def test_epdg_mo_mo_add_wcdma_swap_once_merge_drop_wfc_wifi_preferred(
8304            self):
8305        """Test swap and merge feature in epdg call.
8306
8307        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8308        PhoneA (epdg) call PhoneC (WCDMA), accept on PhoneC.
8309        Swap active call on PhoneA.
8310        Merge calls to conference on PhoneA.
8311        Hangup on PhoneC, check call continues between AB.
8312        Hangup on PhoneB, check A ends.
8313
8314        """
8315        ads = self.android_devices
8316
8317        tasks = [(phone_setup_iwlan,
8318                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8319                   self.wifi_network_ssid, self.wifi_network_pass)),
8320                 (phone_setup_voice_3g, (self.log, ads[1])),
8321                 (phone_setup_voice_3g, (self.log, ads[2]))]
8322        if not multithread_func(self.log, tasks):
8323            self.log.error("Phone Failed to Set Up Properly.")
8324            return False
8325
8326        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_wcdma_swap_x(1)
8327        if call_ab_id is None or call_ac_id is None:
8328            return False
8329
8330        return self._test_ims_conference_merge_drop_second_call_from_participant(
8331            call_ab_id, call_ac_id)
8332
8333    @TelephonyBaseTest.tel_test_wrap
8334    @test_tracker_info(uuid="a2cf3366-ae66-4e8f-a682-df506173f282")
8335    def test_epdg_mo_mo_add_wcdma_swap_twice_merge_drop_wfc_wifi_only(self):
8336        """Test swap and merge feature in epdg call.
8337
8338        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8339        PhoneA (epdg) call PhoneC (WCDMA), accept on PhoneC.
8340        Swap active call on PhoneA.
8341        Swap active call on PhoneA.
8342        Merge calls to conference on PhoneA.
8343        Hangup on PhoneC, check call continues between AB.
8344        Hangup on PhoneB, check A ends.
8345
8346        """
8347        ads = self.android_devices
8348
8349        tasks = [(phone_setup_iwlan,
8350                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8351                   self.wifi_network_ssid, self.wifi_network_pass)),
8352                 (phone_setup_voice_3g, (self.log, ads[1])),
8353                 (phone_setup_voice_3g, (self.log, ads[2]))]
8354        if not multithread_func(self.log, tasks):
8355            self.log.error("Phone Failed to Set Up Properly.")
8356            return False
8357
8358        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_wcdma_swap_x(2)
8359        if call_ab_id is None or call_ac_id is None:
8360            return False
8361
8362        return self._test_ims_conference_merge_drop_second_call_from_participant(
8363            call_ab_id, call_ac_id)
8364
8365    @TelephonyBaseTest.tel_test_wrap
8366    @test_tracker_info(uuid="fc5f0f1c-9610-4d0f-adce-9c8db351e7da")
8367    def test_epdg_mo_mo_add_wcdma_swap_twice_merge_drop_wfc_wifi_preferred(
8368            self):
8369        """Test swap and merge feature in epdg call.
8370
8371        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8372        PhoneA (epdg) call PhoneC (WCDMA), accept on PhoneC.
8373        Swap active call on PhoneA.
8374        Swap active call on PhoneA.
8375        Merge calls to conference on PhoneA.
8376        Hangup on PhoneC, check call continues between AB.
8377        Hangup on PhoneB, check A ends.
8378
8379        """
8380        ads = self.android_devices
8381
8382        tasks = [(phone_setup_iwlan,
8383                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8384                   self.wifi_network_ssid, self.wifi_network_pass)),
8385                 (phone_setup_voice_3g, (self.log, ads[1])),
8386                 (phone_setup_voice_3g, (self.log, ads[2]))]
8387        if not multithread_func(self.log, tasks):
8388            self.log.error("Phone Failed to Set Up Properly.")
8389            return False
8390
8391        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_wcdma_swap_x(2)
8392        if call_ab_id is None or call_ac_id is None:
8393            return False
8394
8395        return self._test_ims_conference_merge_drop_second_call_from_participant(
8396            call_ab_id, call_ac_id)
8397
8398    @TelephonyBaseTest.tel_test_wrap
8399    @test_tracker_info(uuid="05332b1e-c36b-4874-b13b-f8e49d0d9bca")
8400    def test_epdg_mo_mt_add_wcdma_swap_once_merge_drop_wfc_wifi_only(self):
8401        """Test swap and merge feature in epdg call.
8402
8403        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8404        PhoneC (WCDMA) call PhoneA (epdg), accept on PhoneA.
8405        Swap active call on PhoneA.
8406        Merge calls to conference on PhoneA.
8407        Hangup on PhoneC, check call continues between AB.
8408        Hangup on PhoneB, check A ends.
8409
8410        """
8411        ads = self.android_devices
8412
8413        tasks = [(phone_setup_iwlan,
8414                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8415                   self.wifi_network_ssid, self.wifi_network_pass)),
8416                 (phone_setup_voice_3g, (self.log, ads[1])),
8417                 (phone_setup_voice_3g, (self.log, ads[2]))]
8418        if not multithread_func(self.log, tasks):
8419            self.log.error("Phone Failed to Set Up Properly.")
8420            return False
8421
8422        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_wcdma_swap_x(1)
8423        if call_ab_id is None or call_ac_id is None:
8424            return False
8425
8426        return self._test_ims_conference_merge_drop_second_call_from_participant(
8427            call_ab_id, call_ac_id)
8428
8429    @TelephonyBaseTest.tel_test_wrap
8430    @test_tracker_info(uuid="2421d340-f9cb-47e7-ac3e-8581e141a6d0")
8431    def test_epdg_mo_mt_add_wcdma_swap_once_merge_drop_wfc_wifi_preferred(
8432            self):
8433        """Test swap and merge feature in epdg call.
8434
8435        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8436        PhoneC (WCDMA) call PhoneA (epdg), accept on PhoneA.
8437        Swap active call on PhoneA.
8438        Merge calls to conference on PhoneA.
8439        Hangup on PhoneC, check call continues between AB.
8440        Hangup on PhoneB, check A ends.
8441
8442        """
8443        ads = self.android_devices
8444
8445        tasks = [(phone_setup_iwlan,
8446                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8447                   self.wifi_network_ssid, self.wifi_network_pass)),
8448                 (phone_setup_voice_3g, (self.log, ads[1])),
8449                 (phone_setup_voice_3g, (self.log, ads[2]))]
8450        if not multithread_func(self.log, tasks):
8451            self.log.error("Phone Failed to Set Up Properly.")
8452            return False
8453
8454        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_wcdma_swap_x(1)
8455        if call_ab_id is None or call_ac_id is None:
8456            return False
8457
8458        return self._test_ims_conference_merge_drop_second_call_from_participant(
8459            call_ab_id, call_ac_id)
8460
8461    @TelephonyBaseTest.tel_test_wrap
8462    @test_tracker_info(uuid="7c1f6008-cf59-4e63-9285-3cf1c26bc0aa")
8463    def test_epdg_mo_mt_add_wcdma_swap_twice_merge_drop_wfc_wifi_only(self):
8464        """Test swap and merge feature in epdg call.
8465
8466        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8467        PhoneC (WCDMA) call PhoneA (epdg), accept on PhoneA.
8468        Swap active call on PhoneA.
8469        Swap active call on PhoneA.
8470        Merge calls to conference on PhoneA.
8471        Hangup on PhoneC, check call continues between AB.
8472        Hangup on PhoneB, check A ends.
8473
8474        """
8475        ads = self.android_devices
8476
8477        tasks = [(phone_setup_iwlan,
8478                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8479                   self.wifi_network_ssid, self.wifi_network_pass)),
8480                 (phone_setup_voice_3g, (self.log, ads[1])),
8481                 (phone_setup_voice_3g, (self.log, ads[2]))]
8482        if not multithread_func(self.log, tasks):
8483            self.log.error("Phone Failed to Set Up Properly.")
8484            return False
8485
8486        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_wcdma_swap_x(2)
8487        if call_ab_id is None or call_ac_id is None:
8488            return False
8489
8490        return self._test_ims_conference_merge_drop_second_call_from_participant(
8491            call_ab_id, call_ac_id)
8492
8493    @TelephonyBaseTest.tel_test_wrap
8494    @test_tracker_info(uuid="be153f3d-0707-45d0-9ddd-4aa696e0e536")
8495    def test_epdg_mo_mt_add_wcdma_swap_twice_merge_drop_wfc_wifi_preferred(
8496            self):
8497        """Test swap and merge feature in epdg call.
8498
8499        PhoneA (epdg) call PhoneB (WCDMA), accept on PhoneB.
8500        PhoneC (WCDMA) call PhoneA (epdg), accept on PhoneA.
8501        Swap active call on PhoneA.
8502        Swap active call on PhoneA.
8503        Merge calls to conference on PhoneA.
8504        Hangup on PhoneC, check call continues between AB.
8505        Hangup on PhoneB, check A ends.
8506
8507        """
8508        ads = self.android_devices
8509
8510        tasks = [(phone_setup_iwlan,
8511                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8512                   self.wifi_network_ssid, self.wifi_network_pass)),
8513                 (phone_setup_voice_3g, (self.log, ads[1])),
8514                 (phone_setup_voice_3g, (self.log, ads[2]))]
8515        if not multithread_func(self.log, tasks):
8516            self.log.error("Phone Failed to Set Up Properly.")
8517            return False
8518
8519        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_wcdma_swap_x(2)
8520        if call_ab_id is None or call_ac_id is None:
8521            return False
8522
8523        return self._test_ims_conference_merge_drop_second_call_from_participant(
8524            call_ab_id, call_ac_id)
8525
8526    @TelephonyBaseTest.tel_test_wrap
8527    @test_tracker_info(uuid="7235c917-a2d4-4561-bda5-630171053f8f")
8528    def test_epdg_mo_mo_add_1x_swap_once_merge_drop_wfc_wifi_only(self):
8529        """Test swap and merge feature in epdg call.
8530
8531        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8532        PhoneA (epdg) call PhoneC (1x), accept on PhoneC.
8533        Swap active call on PhoneA.
8534        Merge calls to conference on PhoneA.
8535        Hangup on PhoneC, check call continues between AB.
8536        Hangup on PhoneB, check A ends.
8537
8538        """
8539        ads = self.android_devices
8540
8541        tasks = [(phone_setup_iwlan,
8542                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8543                   self.wifi_network_ssid, self.wifi_network_pass)),
8544                 (phone_setup_voice_3g, (self.log, ads[1])),
8545                 (phone_setup_voice_3g, (self.log, ads[2]))]
8546        if not multithread_func(self.log, tasks):
8547            self.log.error("Phone Failed to Set Up Properly.")
8548            return False
8549
8550        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_1x_swap_x(1)
8551        if call_ab_id is None or call_ac_id is None:
8552            return False
8553
8554        return self._test_ims_conference_merge_drop_second_call_from_participant(
8555            call_ab_id, call_ac_id)
8556
8557    @TelephonyBaseTest.tel_test_wrap
8558    @test_tracker_info(uuid="8e52b9a4-c0d1-4dcd-9359-746354124763")
8559    def test_epdg_mo_mo_add_1x_swap_once_merge_drop_wfc_wifi_preferred(self):
8560        """Test swap and merge feature in epdg call.
8561
8562        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8563        PhoneA (epdg) call PhoneC (1x), accept on PhoneC.
8564        Swap active call on PhoneA.
8565        Merge calls to conference on PhoneA.
8566        Hangup on PhoneC, check call continues between AB.
8567        Hangup on PhoneB, check A ends.
8568
8569        """
8570        ads = self.android_devices
8571
8572        tasks = [(phone_setup_iwlan,
8573                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8574                   self.wifi_network_ssid, self.wifi_network_pass)),
8575                 (phone_setup_voice_3g, (self.log, ads[1])),
8576                 (phone_setup_voice_3g, (self.log, ads[2]))]
8577        if not multithread_func(self.log, tasks):
8578            self.log.error("Phone Failed to Set Up Properly.")
8579            return False
8580
8581        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_1x_swap_x(1)
8582        if call_ab_id is None or call_ac_id is None:
8583            return False
8584
8585        return self._test_ims_conference_merge_drop_second_call_from_participant(
8586            call_ab_id, call_ac_id)
8587
8588    @TelephonyBaseTest.tel_test_wrap
8589    @test_tracker_info(uuid="49a4440f-40a1-4518-810a-6ba9f1fbc243")
8590    def test_epdg_mo_mo_add_1x_swap_twice_merge_drop_wfc_wifi_only(self):
8591        """Test swap and merge feature in epdg call.
8592
8593        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8594        PhoneA (epdg) call PhoneC (1x), accept on PhoneC.
8595        Swap active call on PhoneA.
8596        Swap active call on PhoneA.
8597        Merge calls to conference on PhoneA.
8598        Hangup on PhoneC, check call continues between AB.
8599        Hangup on PhoneB, check A ends.
8600
8601        """
8602        ads = self.android_devices
8603
8604        tasks = [(phone_setup_iwlan,
8605                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8606                   self.wifi_network_ssid, self.wifi_network_pass)),
8607                 (phone_setup_voice_3g, (self.log, ads[1])),
8608                 (phone_setup_voice_3g, (self.log, ads[2]))]
8609        if not multithread_func(self.log, tasks):
8610            self.log.error("Phone Failed to Set Up Properly.")
8611            return False
8612
8613        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_1x_swap_x(2)
8614        if call_ab_id is None or call_ac_id is None:
8615            return False
8616
8617        return self._test_ims_conference_merge_drop_second_call_from_participant(
8618            call_ab_id, call_ac_id)
8619
8620    @TelephonyBaseTest.tel_test_wrap
8621    @test_tracker_info(uuid="9d05bde3-50ac-4a49-a0db-2181c9b5a10f")
8622    def test_epdg_mo_mo_add_1x_swap_twice_merge_drop_wfc_wifi_preferred(self):
8623        """Test swap and merge feature in epdg call.
8624
8625        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8626        PhoneA (epdg) call PhoneC (1x), accept on PhoneC.
8627        Swap active call on PhoneA.
8628        Swap active call on PhoneA.
8629        Merge calls to conference on PhoneA.
8630        Hangup on PhoneC, check call continues between AB.
8631        Hangup on PhoneB, check A ends.
8632
8633        """
8634        ads = self.android_devices
8635
8636        tasks = [(phone_setup_iwlan,
8637                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8638                   self.wifi_network_ssid, self.wifi_network_pass)),
8639                 (phone_setup_voice_3g, (self.log, ads[1])),
8640                 (phone_setup_voice_3g, (self.log, ads[2]))]
8641        if not multithread_func(self.log, tasks):
8642            self.log.error("Phone Failed to Set Up Properly.")
8643            return False
8644
8645        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_1x_swap_x(2)
8646        if call_ab_id is None or call_ac_id is None:
8647            return False
8648
8649        return self._test_ims_conference_merge_drop_second_call_from_participant(
8650            call_ab_id, call_ac_id)
8651
8652    @TelephonyBaseTest.tel_test_wrap
8653    @test_tracker_info(uuid="5c44eb64-b184-417a-97c9-8c22c48fb731")
8654    def test_epdg_mo_mt_add_1x_swap_once_merge_drop_wfc_wifi_only(self):
8655        """Test swap and merge feature in epdg call.
8656
8657        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8658        PhoneC (1x) call PhoneA (epdg), accept on PhoneA.
8659        Swap active call on PhoneA.
8660        Merge calls to conference on PhoneA.
8661        Hangup on PhoneC, check call continues between AB.
8662        Hangup on PhoneB, check A ends.
8663
8664        """
8665        ads = self.android_devices
8666
8667        tasks = [(phone_setup_iwlan,
8668                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8669                   self.wifi_network_ssid, self.wifi_network_pass)),
8670                 (phone_setup_voice_3g, (self.log, ads[1])),
8671                 (phone_setup_voice_3g, (self.log, ads[2]))]
8672        if not multithread_func(self.log, tasks):
8673            self.log.error("Phone Failed to Set Up Properly.")
8674            return False
8675
8676        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_1x_swap_x(1)
8677        if call_ab_id is None or call_ac_id is None:
8678            return False
8679
8680        return self._test_ims_conference_merge_drop_second_call_from_participant(
8681            call_ab_id, call_ac_id)
8682
8683    @TelephonyBaseTest.tel_test_wrap
8684    @test_tracker_info(uuid="e16e2e81-1b59-4b02-b601-bb27b62d6468")
8685    def test_epdg_mo_mt_add_1x_swap_once_merge_drop_wfc_wifi_preferred(self):
8686        """Test swap and merge feature in epdg call.
8687
8688        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8689        PhoneC (1x) call PhoneA (epdg), accept on PhoneA.
8690        Swap active call on PhoneA.
8691        Merge calls to conference on PhoneA.
8692        Hangup on PhoneC, check call continues between AB.
8693        Hangup on PhoneB, check A ends.
8694
8695        """
8696        ads = self.android_devices
8697
8698        tasks = [(phone_setup_iwlan,
8699                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8700                   self.wifi_network_ssid, self.wifi_network_pass)),
8701                 (phone_setup_voice_3g, (self.log, ads[1])),
8702                 (phone_setup_voice_3g, (self.log, ads[2]))]
8703        if not multithread_func(self.log, tasks):
8704            self.log.error("Phone Failed to Set Up Properly.")
8705            return False
8706
8707        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_1x_swap_x(1)
8708        if call_ab_id is None or call_ac_id is None:
8709            return False
8710
8711        return self._test_ims_conference_merge_drop_second_call_from_participant(
8712            call_ab_id, call_ac_id)
8713
8714    @TelephonyBaseTest.tel_test_wrap
8715    @test_tracker_info(uuid="fd4c3b72-ea2d-4cd4-af79-b93635eda8b8")
8716    def test_epdg_mo_mt_add_1x_swap_twice_merge_drop_wfc_wifi_only(self):
8717        """Test swap and merge feature in epdg call.
8718
8719        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8720        PhoneC (1x) call PhoneA (epdg), accept on PhoneA.
8721        Swap active call on PhoneA.
8722        Swap active call on PhoneA.
8723        Merge calls to conference on PhoneA.
8724        Hangup on PhoneC, check call continues between AB.
8725        Hangup on PhoneB, check A ends.
8726
8727        """
8728        ads = self.android_devices
8729
8730        tasks = [(phone_setup_iwlan,
8731                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8732                   self.wifi_network_ssid, self.wifi_network_pass)),
8733                 (phone_setup_voice_3g, (self.log, ads[1])),
8734                 (phone_setup_voice_3g, (self.log, ads[2]))]
8735        if not multithread_func(self.log, tasks):
8736            self.log.error("Phone Failed to Set Up Properly.")
8737            return False
8738
8739        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_1x_swap_x(2)
8740        if call_ab_id is None or call_ac_id is None:
8741            return False
8742
8743        return self._test_ims_conference_merge_drop_second_call_from_participant(
8744            call_ab_id, call_ac_id)
8745
8746    @TelephonyBaseTest.tel_test_wrap
8747    @test_tracker_info(uuid="a33d7b2b-cc22-40c3-9689-a2a14642396d")
8748    def test_epdg_mo_mt_add_1x_swap_twice_merge_drop_wfc_wifi_preferred(self):
8749        """Test swap and merge feature in epdg call.
8750
8751        PhoneA (epdg) call PhoneB (1x), accept on PhoneB.
8752        PhoneC (1x) call PhoneA (epdg), accept on PhoneA.
8753        Swap active call on PhoneA.
8754        Swap active call on PhoneA.
8755        Merge calls to conference on PhoneA.
8756        Hangup on PhoneC, check call continues between AB.
8757        Hangup on PhoneB, check A ends.
8758
8759        """
8760        ads = self.android_devices
8761
8762        tasks = [(phone_setup_iwlan,
8763                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8764                   self.wifi_network_ssid, self.wifi_network_pass)),
8765                 (phone_setup_voice_3g, (self.log, ads[1])),
8766                 (phone_setup_voice_3g, (self.log, ads[2]))]
8767        if not multithread_func(self.log, tasks):
8768            self.log.error("Phone Failed to Set Up Properly.")
8769            return False
8770
8771        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_1x_swap_x(2)
8772        if call_ab_id is None or call_ac_id is None:
8773            return False
8774
8775        return self._test_ims_conference_merge_drop_second_call_from_participant(
8776            call_ab_id, call_ac_id)
8777
8778    @TelephonyBaseTest.tel_test_wrap
8779    @test_tracker_info(uuid="7839c6a3-6797-4cd0-a918-c7d317881e3d")
8780    def test_epdg_mo_mo_add_epdg_swap_twice_drop_held_wfc_wifi_only(self):
8781        """Test swap feature in epdg call.
8782
8783        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
8784        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
8785        Swap active call on PhoneA.
8786        Swap active call on PhoneA.
8787        Hangup call from PhoneB, check if call continues between AC.
8788
8789        """
8790        ads = self.android_devices
8791
8792        tasks = [(phone_setup_iwlan,
8793                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8794                   self.wifi_network_ssid, self.wifi_network_pass)),
8795                 (phone_setup_iwlan,
8796                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
8797                   self.wifi_network_ssid, self.wifi_network_pass)),
8798                 (phone_setup_iwlan,
8799                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
8800                   self.wifi_network_ssid, self.wifi_network_pass))]
8801        if not multithread_func(self.log, tasks):
8802            self.log.error("Phone Failed to Set Up Properly.")
8803            return False
8804
8805        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
8806        if call_ab_id is None or call_ac_id is None:
8807            return False
8808
8809        return self._three_phone_hangup_call_verify_call_state(
8810            ad_hangup=ads[1],
8811            ad_verify=ads[0],
8812            call_id=call_ac_id,
8813            call_state=CALL_STATE_ACTIVE,
8814            ads_active=[ads[0], ads[2]])
8815
8816    @TelephonyBaseTest.tel_test_wrap
8817    @test_tracker_info(uuid="3f4e761e-8fa2-4b85-bc11-8150532b7686")
8818    def test_epdg_mo_mo_add_epdg_swap_twice_drop_held_wfc_wifi_preferred(self):
8819        """Test swap feature in epdg call.
8820
8821        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
8822        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
8823        Swap active call on PhoneA.
8824        Swap active call on PhoneA.
8825        Hangup call from PhoneB, check if call continues between AC.
8826
8827        """
8828        ads = self.android_devices
8829
8830        tasks = [(phone_setup_iwlan,
8831                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8832                   self.wifi_network_ssid, self.wifi_network_pass)),
8833                 (phone_setup_iwlan,
8834                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
8835                   self.wifi_network_ssid, self.wifi_network_pass)),
8836                 (phone_setup_iwlan,
8837                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
8838                   self.wifi_network_ssid, self.wifi_network_pass))]
8839        if not multithread_func(self.log, tasks):
8840            self.log.error("Phone Failed to Set Up Properly.")
8841            return False
8842
8843        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
8844        if call_ab_id is None or call_ac_id is None:
8845            return False
8846
8847        return self._three_phone_hangup_call_verify_call_state(
8848            ad_hangup=ads[1],
8849            ad_verify=ads[0],
8850            call_id=call_ac_id,
8851            call_state=CALL_STATE_ACTIVE,
8852            ads_active=[ads[0], ads[2]])
8853
8854    @TelephonyBaseTest.tel_test_wrap
8855    @test_tracker_info(uuid="9fd4f171-9eea-4fc7-91f1-d3c7f08a5fad")
8856    def test_epdg_mo_mo_add_epdg_swap_twice_drop_active_wfc_wifi_only(self):
8857        """Test swap feature in epdg call.
8858
8859        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
8860        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
8861        Swap active call on PhoneA.
8862        Swap active call on PhoneA.
8863        Hangup call from PhoneC, check if call continues between AB.
8864
8865        """
8866        ads = self.android_devices
8867
8868        tasks = [(phone_setup_iwlan,
8869                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8870                   self.wifi_network_ssid, self.wifi_network_pass)),
8871                 (phone_setup_iwlan,
8872                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
8873                   self.wifi_network_ssid, self.wifi_network_pass)),
8874                 (phone_setup_iwlan,
8875                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
8876                   self.wifi_network_ssid, self.wifi_network_pass))]
8877        if not multithread_func(self.log, tasks):
8878            self.log.error("Phone Failed to Set Up Properly.")
8879            return False
8880
8881        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
8882        if call_ab_id is None or call_ac_id is None:
8883            return False
8884
8885        return self._three_phone_hangup_call_verify_call_state(
8886            ad_hangup=ads[2],
8887            ad_verify=ads[0],
8888            call_id=call_ab_id,
8889            call_state=self._get_expected_call_state(ads[0]),
8890            ads_active=[ads[0], ads[1]])
8891
8892    @TelephonyBaseTest.tel_test_wrap
8893    @test_tracker_info(uuid="8b97d6b9-253a-4ab7-8afb-126df71fee41")
8894    def test_epdg_mo_mo_add_epdg_swap_twice_drop_active_wfc_wifi_preferred(
8895            self):
8896        """Test swap feature in epdg call.
8897
8898        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
8899        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
8900        Swap active call on PhoneA.
8901        Swap active call on PhoneA.
8902        Hangup call from PhoneC, check if call continues between AB.
8903
8904        """
8905        ads = self.android_devices
8906
8907        tasks = [(phone_setup_iwlan,
8908                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
8909                   self.wifi_network_ssid, self.wifi_network_pass)),
8910                 (phone_setup_iwlan,
8911                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
8912                   self.wifi_network_ssid, self.wifi_network_pass)),
8913                 (phone_setup_iwlan,
8914                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
8915                   self.wifi_network_ssid, self.wifi_network_pass))]
8916        if not multithread_func(self.log, tasks):
8917            self.log.error("Phone Failed to Set Up Properly.")
8918            return False
8919
8920        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
8921        if call_ab_id is None or call_ac_id is None:
8922            return False
8923
8924        return self._three_phone_hangup_call_verify_call_state(
8925            ad_hangup=ads[2],
8926            ad_verify=ads[0],
8927            call_id=call_ab_id,
8928            call_state=self._get_expected_call_state(ads[0]),
8929            ads_active=[ads[0], ads[1]])
8930
8931    @TelephonyBaseTest.tel_test_wrap
8932    @test_tracker_info(uuid="6617e779-c987-41dd-acda-ff132662ccf0")
8933    def test_epdg_mo_mo_add_epdg_swap_twice_drop_active_apm_wifi_preferred(
8934            self):
8935        """Test swap feature in epdg call.
8936
8937        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
8938        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
8939        Swap active call on PhoneA.
8940        Swap active call on PhoneA.
8941        Hangup call from PhoneC, check if call continues between AB.
8942
8943        """
8944        ads = self.android_devices
8945
8946        tasks = [(phone_setup_iwlan,
8947                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
8948                   self.wifi_network_ssid, self.wifi_network_pass)),
8949                 (phone_setup_iwlan,
8950                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
8951                   self.wifi_network_ssid, self.wifi_network_pass)),
8952                 (phone_setup_iwlan,
8953                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
8954                   self.wifi_network_ssid, self.wifi_network_pass))]
8955        if not multithread_func(self.log, tasks):
8956            self.log.error("Phone Failed to Set Up Properly.")
8957            return False
8958
8959        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(2)
8960        if call_ab_id is None or call_ac_id is None:
8961            return False
8962
8963        return self._three_phone_hangup_call_verify_call_state(
8964            ad_hangup=ads[2],
8965            ad_verify=ads[0],
8966            call_id=call_ab_id,
8967            call_state=self._get_expected_call_state(ads[0]),
8968            ads_active=[ads[0], ads[1]])
8969
8970    @TelephonyBaseTest.tel_test_wrap
8971    @test_tracker_info(uuid="f8b61289-ccc5-4adf-b291-94c73925edb3")
8972    def test_epdg_mo_mt_add_epdg_swap_twice_drop_held_wfc_wifi_only(self):
8973        """Test swap feature in epdg call.
8974
8975        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
8976        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
8977        Swap active call on PhoneA.
8978        Swap active call on PhoneA.
8979        Hangup call from PhoneB, check if call continues between AC.
8980
8981        """
8982        ads = self.android_devices
8983
8984        tasks = [(phone_setup_iwlan,
8985                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
8986                   self.wifi_network_ssid, self.wifi_network_pass)),
8987                 (phone_setup_iwlan,
8988                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
8989                   self.wifi_network_ssid, self.wifi_network_pass)),
8990                 (phone_setup_iwlan,
8991                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
8992                   self.wifi_network_ssid, self.wifi_network_pass))]
8993        if not multithread_func(self.log, tasks):
8994            self.log.error("Phone Failed to Set Up Properly.")
8995            return False
8996
8997        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(2)
8998        if call_ab_id is None or call_ac_id is None:
8999            return False
9000
9001        return self._three_phone_hangup_call_verify_call_state(
9002            ad_hangup=ads[1],
9003            ad_verify=ads[0],
9004            call_id=call_ac_id,
9005            call_state=CALL_STATE_ACTIVE,
9006            ads_active=[ads[0], ads[2]])
9007
9008    @TelephonyBaseTest.tel_test_wrap
9009    @test_tracker_info(uuid="bb975203-7cee-4fbc-ad4a-da473413e410")
9010    def test_epdg_mo_mt_add_epdg_swap_twice_drop_held_wfc_wifi_preferred(self):
9011        """Test swap feature in epdg call.
9012
9013        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9014        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9015        Swap active call on PhoneA.
9016        Swap active call on PhoneA.
9017        Hangup call from PhoneB, check if call continues between AC.
9018
9019        """
9020        ads = self.android_devices
9021
9022        tasks = [(phone_setup_iwlan,
9023                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
9024                   self.wifi_network_ssid, self.wifi_network_pass)),
9025                 (phone_setup_iwlan,
9026                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
9027                   self.wifi_network_ssid, self.wifi_network_pass)),
9028                 (phone_setup_iwlan,
9029                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
9030                   self.wifi_network_ssid, self.wifi_network_pass))]
9031        if not multithread_func(self.log, tasks):
9032            self.log.error("Phone Failed to Set Up Properly.")
9033            return False
9034
9035        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(2)
9036        if call_ab_id is None or call_ac_id is None:
9037            return False
9038
9039        return self._three_phone_hangup_call_verify_call_state(
9040            ad_hangup=ads[1],
9041            ad_verify=ads[0],
9042            call_id=call_ac_id,
9043            call_state=CALL_STATE_ACTIVE,
9044            ads_active=[ads[0], ads[2]])
9045
9046    @TelephonyBaseTest.tel_test_wrap
9047    @test_tracker_info(uuid="593f6034-fd15-4b1d-a9fe-c4331e6a7f72")
9048    def test_epdg_mo_mt_add_epdg_swap_twice_drop_active_wfc_wifi_only(self):
9049        """Test swap feature in epdg call.
9050
9051        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9052        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9053        Swap active call on PhoneA.
9054        Swap active call on PhoneA.
9055        Hangup call from PhoneC, check if call continues between AB.
9056
9057        """
9058        ads = self.android_devices
9059
9060        tasks = [(phone_setup_iwlan,
9061                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
9062                   self.wifi_network_ssid, self.wifi_network_pass)),
9063                 (phone_setup_iwlan,
9064                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
9065                   self.wifi_network_ssid, self.wifi_network_pass)),
9066                 (phone_setup_iwlan,
9067                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
9068                   self.wifi_network_ssid, self.wifi_network_pass))]
9069        if not multithread_func(self.log, tasks):
9070            self.log.error("Phone Failed to Set Up Properly.")
9071            return False
9072
9073        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(2)
9074        if call_ab_id is None or call_ac_id is None:
9075            return False
9076
9077        return self._three_phone_hangup_call_verify_call_state(
9078            ad_hangup=ads[2],
9079            ad_verify=ads[0],
9080            call_id=call_ab_id,
9081            call_state=self._get_expected_call_state(ads[0]),
9082            ads_active=[ads[0], ads[1]])
9083
9084    @TelephonyBaseTest.tel_test_wrap
9085    @test_tracker_info(uuid="adc3fb00-543e-44ec-905b-0eea52790896")
9086    def test_epdg_mo_mt_add_epdg_swap_twice_drop_active_wfc_wifi_preferred(
9087            self):
9088        """Test swap feature in epdg call.
9089
9090        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9091        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9092        Swap active call on PhoneA.
9093        Swap active call on PhoneA.
9094        Hangup call from PhoneC, check if call continues between AB.
9095
9096        """
9097        ads = self.android_devices
9098
9099        tasks = [(phone_setup_iwlan,
9100                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
9101                   self.wifi_network_ssid, self.wifi_network_pass)),
9102                 (phone_setup_iwlan,
9103                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
9104                   self.wifi_network_ssid, self.wifi_network_pass)),
9105                 (phone_setup_iwlan,
9106                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
9107                   self.wifi_network_ssid, self.wifi_network_pass))]
9108        if not multithread_func(self.log, tasks):
9109            self.log.error("Phone Failed to Set Up Properly.")
9110            return False
9111
9112        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(2)
9113        if call_ab_id is None or call_ac_id is None:
9114            return False
9115
9116        return self._three_phone_hangup_call_verify_call_state(
9117            ad_hangup=ads[2],
9118            ad_verify=ads[0],
9119            call_id=call_ab_id,
9120            call_state=self._get_expected_call_state(ads[0]),
9121            ads_active=[ads[0], ads[1]])
9122
9123    @TelephonyBaseTest.tel_test_wrap
9124    @test_tracker_info(uuid="e96aac52-c536-4a08-9e6a-8bf598db9267")
9125    def test_epdg_mo_mo_add_epdg_swap_once_drop_held_wfc_wifi_only(self):
9126        """Test swap feature in epdg call.
9127
9128        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9129        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
9130        Swap active call on PhoneA.
9131        Hangup call from PhoneC, check if call continues between AB.
9132
9133        """
9134        ads = self.android_devices
9135
9136        tasks = [(phone_setup_iwlan,
9137                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
9138                   self.wifi_network_ssid, self.wifi_network_pass)),
9139                 (phone_setup_iwlan,
9140                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
9141                   self.wifi_network_ssid, self.wifi_network_pass)),
9142                 (phone_setup_iwlan,
9143                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
9144                   self.wifi_network_ssid, self.wifi_network_pass))]
9145        if not multithread_func(self.log, tasks):
9146            self.log.error("Phone Failed to Set Up Properly.")
9147            return False
9148
9149        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
9150        if call_ab_id is None or call_ac_id is None:
9151            return False
9152
9153        return self._three_phone_hangup_call_verify_call_state(
9154            ad_hangup=ads[2],
9155            ad_verify=ads[0],
9156            call_id=call_ab_id,
9157            call_state=CALL_STATE_ACTIVE,
9158            ads_active=[ads[0], ads[1]])
9159
9160    @TelephonyBaseTest.tel_test_wrap
9161    @test_tracker_info(uuid="74efa176-1ff2-4b06-9739-06f67009cb5d")
9162    def test_epdg_mo_mo_add_epdg_swap_once_drop_held_wfc_wifi_preferred(self):
9163        """Test swap feature in epdg call.
9164
9165        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9166        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
9167        Swap active call on PhoneA.
9168        Hangup call from PhoneC, check if call continues between AB.
9169
9170        """
9171        ads = self.android_devices
9172
9173        tasks = [(phone_setup_iwlan,
9174                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
9175                   self.wifi_network_ssid, self.wifi_network_pass)),
9176                 (phone_setup_iwlan,
9177                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
9178                   self.wifi_network_ssid, self.wifi_network_pass)),
9179                 (phone_setup_iwlan,
9180                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
9181                   self.wifi_network_ssid, self.wifi_network_pass))]
9182        if not multithread_func(self.log, tasks):
9183            self.log.error("Phone Failed to Set Up Properly.")
9184            return False
9185
9186        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
9187        if call_ab_id is None or call_ac_id is None:
9188            return False
9189
9190        return self._three_phone_hangup_call_verify_call_state(
9191            ad_hangup=ads[2],
9192            ad_verify=ads[0],
9193            call_id=call_ab_id,
9194            call_state=CALL_STATE_ACTIVE,
9195            ads_active=[ads[0], ads[1]])
9196
9197    @TelephonyBaseTest.tel_test_wrap
9198    @test_tracker_info(uuid="dfcdeebe-dada-4722-8880-5b3877d0809b")
9199    def test_epdg_mo_mo_add_epdg_swap_once_drop_active_wfc_wifi_only(self):
9200        """Test swap feature in epdg call.
9201
9202        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9203        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
9204        Swap active call on PhoneA.
9205        Hangup call from PhoneB, check if call continues between AC.
9206
9207        """
9208        ads = self.android_devices
9209
9210        tasks = [(phone_setup_iwlan,
9211                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
9212                   self.wifi_network_ssid, self.wifi_network_pass)),
9213                 (phone_setup_iwlan,
9214                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
9215                   self.wifi_network_ssid, self.wifi_network_pass)),
9216                 (phone_setup_iwlan,
9217                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
9218                   self.wifi_network_ssid, self.wifi_network_pass))]
9219        if not multithread_func(self.log, tasks):
9220            self.log.error("Phone Failed to Set Up Properly.")
9221            return False
9222
9223        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
9224        if call_ab_id is None or call_ac_id is None:
9225            return False
9226
9227        return self._three_phone_hangup_call_verify_call_state(
9228            ad_hangup=ads[1],
9229            ad_verify=ads[0],
9230            call_id=call_ac_id,
9231            call_state=self._get_expected_call_state(ads[0]),
9232            ads_active=[ads[0], ads[2]])
9233
9234    @TelephonyBaseTest.tel_test_wrap
9235    @test_tracker_info(uuid="b9658029-90da-4df8-bbb2-9c08eb3a3a8c")
9236    def test_epdg_mo_mo_add_epdg_swap_once_drop_active_wfc_wifi_preferred(
9237            self):
9238        """Test swap feature in epdg call.
9239
9240        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9241        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
9242        Swap active call on PhoneA.
9243        Hangup call from PhoneB, check if call continues between AC.
9244
9245        """
9246        ads = self.android_devices
9247
9248        tasks = [(phone_setup_iwlan,
9249                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
9250                   self.wifi_network_ssid, self.wifi_network_pass)),
9251                 (phone_setup_iwlan,
9252                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
9253                   self.wifi_network_ssid, self.wifi_network_pass)),
9254                 (phone_setup_iwlan,
9255                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
9256                   self.wifi_network_ssid, self.wifi_network_pass))]
9257        if not multithread_func(self.log, tasks):
9258            self.log.error("Phone Failed to Set Up Properly.")
9259            return False
9260
9261        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
9262        if call_ab_id is None or call_ac_id is None:
9263            return False
9264
9265        return self._three_phone_hangup_call_verify_call_state(
9266            ad_hangup=ads[1],
9267            ad_verify=ads[0],
9268            call_id=call_ac_id,
9269            call_state=self._get_expected_call_state(ads[0]),
9270            ads_active=[ads[0], ads[2]])
9271
9272    @TelephonyBaseTest.tel_test_wrap
9273    @test_tracker_info(uuid="3381c8e0-cdf1-47d1-8a17-58592f3cd6e6")
9274    def test_epdg_mo_mo_add_epdg_swap_once_drop_active_apm_wfc_wifi_preferred(
9275            self):
9276        """Test swap feature in epdg call.
9277
9278        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9279        PhoneA (epdg) call PhoneC (epdg), accept on PhoneC.
9280        Swap active call on PhoneA.
9281        Hangup call from PhoneB, check if call continues between AC.
9282
9283        """
9284        ads = self.android_devices
9285
9286        tasks = [(phone_setup_iwlan,
9287                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9288                   self.wifi_network_ssid, self.wifi_network_pass)),
9289                 (phone_setup_iwlan,
9290                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9291                   self.wifi_network_ssid, self.wifi_network_pass)),
9292                 (phone_setup_iwlan,
9293                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9294                   self.wifi_network_ssid, self.wifi_network_pass))]
9295        if not multithread_func(self.log, tasks):
9296            self.log.error("Phone Failed to Set Up Properly.")
9297            return False
9298
9299        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(1)
9300        if call_ab_id is None or call_ac_id is None:
9301            return False
9302
9303        return self._three_phone_hangup_call_verify_call_state(
9304            ad_hangup=ads[1],
9305            ad_verify=ads[0],
9306            call_id=call_ac_id,
9307            call_state=self._get_expected_call_state(ads[0]),
9308            ads_active=[ads[0], ads[2]])
9309
9310    @TelephonyBaseTest.tel_test_wrap
9311    @test_tracker_info(uuid="fb655f12-aabe-45bf-8020-61c21ada9440")
9312    def test_epdg_mo_mt_add_epdg_swap_once_drop_held_wfc_wifi_only(self):
9313        """Test swap feature in epdg call.
9314
9315        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9316        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9317        Swap active call on PhoneA.
9318        Hangup call from PhoneC, check if call continues between AB.
9319
9320        """
9321        ads = self.android_devices
9322
9323        tasks = [(phone_setup_iwlan,
9324                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
9325                   self.wifi_network_ssid, self.wifi_network_pass)),
9326                 (phone_setup_iwlan,
9327                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
9328                   self.wifi_network_ssid, self.wifi_network_pass)),
9329                 (phone_setup_iwlan,
9330                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
9331                   self.wifi_network_ssid, self.wifi_network_pass))]
9332        if not multithread_func(self.log, tasks):
9333            self.log.error("Phone Failed to Set Up Properly.")
9334            return False
9335
9336        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
9337        if call_ab_id is None or call_ac_id is None:
9338            return False
9339        return self._three_phone_hangup_call_verify_call_state(
9340            ad_hangup=ads[2],
9341            ad_verify=ads[0],
9342            call_id=call_ab_id,
9343            call_state=CALL_STATE_ACTIVE,
9344            ads_active=[ads[0], ads[1]])
9345
9346    @TelephonyBaseTest.tel_test_wrap
9347    @test_tracker_info(uuid="35e7b36d-e2d5-42bd-99d9-dbc7986ef93a")
9348    def test_epdg_mo_mt_add_epdg_swap_once_drop_held_wfc_wifi_preferred(self):
9349        """Test swap feature in epdg call.
9350
9351        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9352        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9353        Swap active call on PhoneA.
9354        Hangup call from PhoneC, check if call continues between AB.
9355
9356        """
9357        ads = self.android_devices
9358
9359        tasks = [(phone_setup_iwlan,
9360                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
9361                   self.wifi_network_ssid, self.wifi_network_pass)),
9362                 (phone_setup_iwlan,
9363                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
9364                   self.wifi_network_ssid, self.wifi_network_pass)),
9365                 (phone_setup_iwlan,
9366                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
9367                   self.wifi_network_ssid, self.wifi_network_pass))]
9368        if not multithread_func(self.log, tasks):
9369            self.log.error("Phone Failed to Set Up Properly.")
9370            return False
9371
9372        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
9373        if call_ab_id is None or call_ac_id is None:
9374            return False
9375        return self._three_phone_hangup_call_verify_call_state(
9376            ad_hangup=ads[2],
9377            ad_verify=ads[0],
9378            call_id=call_ab_id,
9379            call_state=CALL_STATE_ACTIVE,
9380            ads_active=[ads[0], ads[1]])
9381
9382    @TelephonyBaseTest.tel_test_wrap
9383    @test_tracker_info(uuid="e959e668-8150-46c1-bf49-a1ab2a9f45a5")
9384    def test_epdg_mo_mt_add_epdg_swap_once_drop_held_apm_wifi_preferred(self):
9385        """Test swap feature in epdg call.
9386
9387        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9388        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9389        Swap active call on PhoneA.
9390        Hangup call from PhoneC, check if call continues between AB.
9391
9392        """
9393        ads = self.android_devices
9394
9395        tasks = [(phone_setup_iwlan,
9396                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9397                   self.wifi_network_ssid, self.wifi_network_pass)),
9398                 (phone_setup_iwlan,
9399                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9400                   self.wifi_network_ssid, self.wifi_network_pass)),
9401                 (phone_setup_iwlan,
9402                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9403                   self.wifi_network_ssid, self.wifi_network_pass))]
9404        if not multithread_func(self.log, tasks):
9405            self.log.error("Phone Failed to Set Up Properly.")
9406            return False
9407
9408        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
9409        if call_ab_id is None or call_ac_id is None:
9410            return False
9411        return self._three_phone_hangup_call_verify_call_state(
9412            ad_hangup=ads[2],
9413            ad_verify=ads[0],
9414            call_id=call_ab_id,
9415            call_state=CALL_STATE_ACTIVE,
9416            ads_active=[ads[0], ads[1]])
9417
9418    @TelephonyBaseTest.tel_test_wrap
9419    @test_tracker_info(uuid="b9c47ccd-cc84-42cc-83f4-0a98c22c1d7a")
9420    def test_epdg_mo_mt_add_epdg_swap_once_drop_active_wfc_wifi_only(self):
9421        """Test swap feature in epdg call.
9422
9423        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9424        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9425        Swap active call on PhoneA.
9426        Hangup call from PhoneB, check if call continues between AC.
9427
9428        """
9429        ads = self.android_devices
9430
9431        tasks = [(phone_setup_iwlan,
9432                  (self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
9433                   self.wifi_network_ssid, self.wifi_network_pass)),
9434                 (phone_setup_iwlan,
9435                  (self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
9436                   self.wifi_network_ssid, self.wifi_network_pass)),
9437                 (phone_setup_iwlan,
9438                  (self.log, ads[2], False, WFC_MODE_WIFI_ONLY,
9439                   self.wifi_network_ssid, self.wifi_network_pass))]
9440        if not multithread_func(self.log, tasks):
9441            self.log.error("Phone Failed to Set Up Properly.")
9442            return False
9443
9444        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
9445        if call_ab_id is None or call_ac_id is None:
9446            return False
9447
9448        return self._three_phone_hangup_call_verify_call_state(
9449            ad_hangup=ads[1],
9450            ad_verify=ads[0],
9451            call_id=call_ac_id,
9452            call_state=self._get_expected_call_state(ads[0]),
9453            ads_active=[ads[0], ads[2]])
9454
9455    @TelephonyBaseTest.tel_test_wrap
9456    @test_tracker_info(uuid="273d521f-d11c-4956-ae51-33f69de87663")
9457    def test_epdg_mo_mt_add_epdg_swap_once_drop_active_wfc_wifi_preferred(
9458            self):
9459        """Test swap feature in epdg call.
9460
9461        PhoneA (epdg) call PhoneB (epdg), accept on PhoneB.
9462        PhoneC (epdg) call PhoneA (epdg), accept on PhoneA.
9463        Swap active call on PhoneA.
9464        Hangup call from PhoneB, check if call continues between AC.
9465
9466        """
9467        ads = self.android_devices
9468
9469        tasks = [(phone_setup_iwlan,
9470                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
9471                   self.wifi_network_ssid, self.wifi_network_pass)),
9472                 (phone_setup_iwlan,
9473                  (self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
9474                   self.wifi_network_ssid, self.wifi_network_pass)),
9475                 (phone_setup_iwlan,
9476                  (self.log, ads[2], False, WFC_MODE_WIFI_PREFERRED,
9477                   self.wifi_network_ssid, self.wifi_network_pass))]
9478        if not multithread_func(self.log, tasks):
9479            self.log.error("Phone Failed to Set Up Properly.")
9480            return False
9481
9482        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
9483        if call_ab_id is None or call_ac_id is None:
9484            return False
9485
9486        return self._three_phone_hangup_call_verify_call_state(
9487            ad_hangup=ads[1],
9488            ad_verify=ads[0],
9489            call_id=call_ac_id,
9490            call_state=self._get_expected_call_state(ads[0]),
9491            ads_active=[ads[0], ads[2]])
9492
9493    def _test_gsm_mo_mo_add_swap_x(self, num_swaps):
9494        """Test swap feature in GSM call.
9495
9496        PhoneA (GSM) call PhoneB, accept on PhoneB.
9497        PhoneA (GSM) call PhoneC, accept on PhoneC.
9498        Swap active call on PhoneA. (N times)
9499
9500        Args:
9501            num_swaps: do swap for 'num_swaps' times.
9502                This value can be 0 (no swap operation).
9503
9504        Returns:
9505            call_ab_id, call_ac_id if succeed;
9506            None, None if failed.
9507
9508        """
9509        ads = self.android_devices
9510
9511        # make sure PhoneA is GSM phone before proceed.
9512        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
9513            ads[0].log.error("not GSM phone, abort wcdma swap test.")
9514            return None, None
9515
9516        call_ab_id = self._three_phone_call_mo_add_mo(
9517            [ads[0], ads[1], ads[2]], [
9518                phone_setup_voice_2g, phone_setup_voice_general,
9519                phone_setup_voice_general
9520            ], [is_phone_in_call_2g, None, None])
9521        if call_ab_id is None:
9522            self.log.error("Failed to get call_ab_id")
9523            return None, None
9524
9525        calls = ads[0].droid.telecomCallGetCallIds()
9526        ads[0].log.info("Calls in PhoneA %s", calls)
9527        if num_active_calls(self.log, ads[0]) != 2:
9528            return None, None
9529        if calls[0] == call_ab_id:
9530            call_ac_id = calls[1]
9531        else:
9532            call_ac_id = calls[0]
9533
9534        if num_swaps > 0:
9535            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
9536            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
9537                              num_swaps):
9538                self.log.error("Swap test failed.")
9539                return None, None
9540
9541        return call_ab_id, call_ac_id
9542
9543    def _test_gsm_mt_mt_add_swap_x(self, num_swaps):
9544        """Test swap feature in GSM call.
9545
9546        PhoneB call PhoneA (GSM), accept on PhoneA.
9547        PhoneC call PhoneA (GSM), accept on PhoneA.
9548        Swap active call on PhoneA. (N times)
9549
9550        Args:
9551            num_swaps: do swap for 'num_swaps' times.
9552                This value can be 0 (no swap operation).
9553
9554        Returns:
9555            call_ab_id, call_ac_id if succeed;
9556            None, None if failed.
9557
9558        """
9559        ads = self.android_devices
9560
9561        # make sure PhoneA is GSM phone before proceed.
9562        if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
9563            ads[0].log.error("not GSM phone, abort wcdma swap test.")
9564            return None, None
9565
9566        call_ab_id = self._three_phone_call_mt_add_mt(
9567            [ads[0], ads[1], ads[2]], [
9568                phone_setup_voice_2g, phone_setup_voice_general,
9569                phone_setup_voice_general
9570            ], [is_phone_in_call_2g, None, None])
9571        if call_ab_id is None:
9572            self.log.error("Failed to get call_ab_id")
9573            return None, None
9574
9575        calls = ads[0].droid.telecomCallGetCallIds()
9576        ads[0].log.info("Calls in PhoneA %s", calls)
9577        if num_active_calls(self.log, ads[0]) != 2:
9578            return None, None
9579        if calls[0] == call_ab_id:
9580            call_ac_id = calls[1]
9581        else:
9582            call_ac_id = calls[0]
9583
9584        if num_swaps > 0:
9585            self.log.info("Step3: Begin Swap x%s test.", num_swaps)
9586            if not swap_calls(self.log, ads, call_ab_id, call_ac_id,
9587                              num_swaps):
9588                self.log.error("Swap test failed.")
9589                return None, None
9590
9591        return call_ab_id, call_ac_id
9592
9593    def _test_gsm_conference_merge_drop(self, call_ab_id, call_ac_id):
9594        """Test conference merge and drop in GSM call.
9595
9596        PhoneA in GSM call with PhoneB.
9597        PhoneA in GSM call with PhoneC.
9598        Merge calls to conference on PhoneA.
9599        Hangup on PhoneC, check call continues between AB.
9600        Hangup on PhoneB, check A ends.
9601
9602        Args:
9603            call_ab_id: call id for call_AB on PhoneA.
9604            call_ac_id: call id for call_AC on PhoneA.
9605
9606        Returns:
9607            True if succeed;
9608            False if failed.
9609        """
9610        ads = self.android_devices
9611
9612        self.log.info("Step4: Merge to Conf Call and verify Conf Call.")
9613        ads[0].droid.telecomCallJoinCallsInConf(call_ab_id, call_ac_id)
9614        time.sleep(WAIT_TIME_IN_CALL)
9615        calls = ads[0].droid.telecomCallGetCallIds()
9616        ads[0].log.info("Calls in PhoneA %s", calls)
9617        if num_active_calls(self.log, ads[0]) != 3:
9618            ads[0].log.error("Total number of call ids is not 3.")
9619            return False
9620        call_conf_id = None
9621        for call_id in calls:
9622            if call_id != call_ab_id and call_id != call_ac_id:
9623                call_conf_id = call_id
9624        if not call_conf_id:
9625            self.log.error("Merge call fail, no new conference call id.")
9626            return False
9627        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], True):
9628            return False
9629
9630        # Check if Conf Call is currently active
9631        if ads[0].droid.telecomCallGetCallState(
9632                call_conf_id) != CALL_STATE_ACTIVE:
9633            ads[0].log.error(
9634                "Call_id: %s, state: %s, expected: STATE_ACTIVE", call_conf_id,
9635                ads[0].droid.telecomCallGetCallState(call_conf_id))
9636            return False
9637
9638        self.log.info("Step5: End call on PhoneC and verify call continues.")
9639        if not self._hangup_call(ads[2], "PhoneC"):
9640            return False
9641        time.sleep(WAIT_TIME_IN_CALL)
9642        calls = ads[0].droid.telecomCallGetCallIds()
9643        ads[0].log.info("Calls in PhoneA %s", calls)
9644        if num_active_calls(self.log, ads[0]) != 1:
9645            return False
9646        if not verify_incall_state(self.log, [ads[0], ads[1]], True):
9647            return False
9648        if not verify_incall_state(self.log, [ads[2]], False):
9649            return False
9650
9651        self.log.info("Step6: End call on PhoneB and verify PhoneA end.")
9652        if not self._hangup_call(ads[1], "PhoneB"):
9653            return False
9654        time.sleep(WAIT_TIME_IN_CALL)
9655        if not verify_incall_state(self.log, [ads[0], ads[1], ads[2]], False):
9656            return False
9657        return True
9658
9659    @TelephonyBaseTest.tel_test_wrap
9660    @test_tracker_info(uuid="03eb38b1-bd7f-457e-8b80-d58651d82741")
9661    def test_gsm_mo_mo_add_merge_drop(self):
9662        """ Test Conf Call among three phones.
9663
9664        Call from PhoneA to PhoneB, accept on PhoneB.
9665        Call from PhoneA to PhoneC, accept on PhoneC.
9666        On PhoneA, merge to conference call.
9667        End call on PhoneC, verify call continues.
9668        End call on PhoneB, verify call end on PhoneA.
9669
9670        Returns:
9671            True if pass; False if fail.
9672        """
9673        call_ab_id, call_ac_id = self._test_gsm_mo_mo_add_swap_x(0)
9674        if call_ab_id is None or call_ac_id is None:
9675            return False
9676
9677        return self._test_gsm_conference_merge_drop(call_ab_id, call_ac_id)
9678
9679    @TelephonyBaseTest.tel_test_wrap
9680    @test_tracker_info(uuid="3286306f-4d66-48c4-9303-f691c53bcfe0")
9681    def test_gsm_mo_mo_add_swap_once_drop_held(self):
9682        """ Test Conf Call among three phones.
9683
9684        Call from PhoneA to PhoneB, accept on PhoneB.
9685        Call from PhoneA to PhoneC, accept on PhoneC.
9686        On PhoneA, swap active call.
9687        End call on PhoneB, verify call continues.
9688        End call on PhoneC, verify call end on PhoneA.
9689
9690        Returns:
9691            True if pass; False if fail.
9692        """
9693        ads = self.android_devices
9694        call_ab_id, call_ac_id = self._test_gsm_mo_mo_add_swap_x(1)
9695        if call_ab_id is None or call_ac_id is None:
9696            return False
9697
9698        return self._three_phone_hangup_call_verify_call_state(
9699            ad_hangup=ads[2],
9700            ad_verify=ads[0],
9701            call_id=call_ab_id,
9702            call_state=CALL_STATE_ACTIVE,
9703            ads_active=[ads[0], ads[1]])
9704
9705    @TelephonyBaseTest.tel_test_wrap
9706    @test_tracker_info(uuid="af4ff690-be2a-42d8-930a-8258fe81c77e")
9707    def test_gsm_mt_mt_add_merge_drop(self):
9708        """ Test Conf Call among three phones.
9709
9710        Call from PhoneB to PhoneA, accept on PhoneA.
9711        Call from PhoneC to PhoneA, accept on PhoneA.
9712        On PhoneA, merge to conference call.
9713        End call on PhoneC, verify call continues.
9714        End call on PhoneB, verify call end on PhoneA.
9715
9716        Returns:
9717            True if pass; False if fail.
9718        """
9719        call_ab_id, call_ac_id = self._test_gsm_mt_mt_add_swap_x(0)
9720        if call_ab_id is None or call_ac_id is None:
9721            return False
9722
9723        return self._test_gsm_conference_merge_drop(call_ab_id, call_ac_id)
9724
9725    @TelephonyBaseTest.tel_test_wrap
9726    @test_tracker_info(uuid="6b70902e-ca59-4d92-9bfe-2116dcc91213")
9727    def test_gsm_mo_mo_add_swap_twice_drop_active(self):
9728        """Test swap feature in GSM call.
9729
9730        PhoneA (GSM) call PhoneB, accept on PhoneB.
9731        PhoneA (GSM) call PhoneC, accept on PhoneC.
9732        Swap active call on PhoneA.
9733        Swap active call on PhoneA.
9734        Hangup call from PhoneC, check if call continues between AB.
9735
9736        """
9737        ads = self.android_devices
9738
9739        call_ab_id, call_ac_id = self._test_gsm_mo_mo_add_swap_x(1)
9740        if call_ab_id is None or call_ac_id is None:
9741            return False
9742
9743        return self._three_phone_hangup_call_verify_call_state(
9744            ad_hangup=ads[2],
9745            ad_verify=ads[0],
9746            call_id=call_ab_id,
9747            call_state=self._get_expected_call_state(ads[0]),
9748            ads_active=[ads[0], ads[1]])
9749
9750    @TelephonyBaseTest.tel_test_wrap
9751    @test_tracker_info(uuid="a9ddf5a7-8399-4a8c-abc9-b9235b0153b0")
9752    def test_epdg_mo_mo_add_epdg_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_no_cep(
9753            self):
9754        """ Test WFC Conference Call among three phones. No CEP.
9755
9756        Steps:
9757        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
9758        2. PhoneA (WFC APM WiFi Preferred) call PhoneC (WFC APM WiFi Preferred), accept on PhoneC.
9759        3. On PhoneA, merge to conference call (No CEP).
9760        4. End call on PhoneC, verify call continues.
9761        5. End call on PhoneB, verify call end on PhoneA.
9762
9763        Expected Results:
9764        3. Conference merged successfully.
9765        4. Drop calls succeeded. Call between A-B continues.
9766        5. Drop calls succeeded, all call participants drop.
9767
9768        Returns:
9769            True if pass; False if fail.
9770
9771        TAGS: Telephony, WFC, Conference, No_CEP
9772        Priority: 1
9773        """
9774        ads = self.android_devices
9775
9776        tasks = [(phone_setup_iwlan,
9777                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9778                   self.wifi_network_ssid, self.wifi_network_pass)),
9779                 (phone_setup_iwlan,
9780                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9781                   self.wifi_network_ssid, self.wifi_network_pass)),
9782                 (phone_setup_iwlan,
9783                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9784                   self.wifi_network_ssid, self.wifi_network_pass))]
9785        if not multithread_func(self.log, tasks):
9786            self.log.error("Phone Failed to Set Up Properly.")
9787            return False
9788
9789        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
9790        if call_ab_id is None or call_ac_id is None:
9791            return False
9792
9793        return self._test_ims_conference_merge_drop_second_call_from_participant(
9794            call_ab_id, call_ac_id)
9795
9796    @TelephonyBaseTest.tel_test_wrap
9797    @test_tracker_info(uuid="5aaff055-3329-4077-91e8-5707a0f6a309")
9798    def test_epdg_mo_mo_add_epdg_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_cep(
9799            self):
9800        """ Test WFC Conference Call among three phones. CEP enabled.
9801
9802        Steps
9803        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
9804        2. PhoneA (WFC APM WiFi Preferred) call PhoneC (WFC APM WiFi Preferred), accept on PhoneC.
9805        3. On PhoneA, merge to conference call (WFC CEP conference call).
9806        4. End call on PhoneC, verify call continues.
9807        5. End call on PhoneB, verify call end on PhoneA.
9808
9809        Expected Results:
9810        3. Conference merged successfully.
9811        4. Drop calls succeeded. Call between A-B continues.
9812        5. Drop calls succeeded, all call participants drop.
9813
9814        Returns:
9815            True if pass; False if fail.
9816
9817        TAGS: Telephony, WFC, Conference, CEP
9818        Priority: 1
9819        """
9820        ads = self.android_devices
9821
9822        tasks = [(phone_setup_iwlan,
9823                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9824                   self.wifi_network_ssid, self.wifi_network_pass)),
9825                 (phone_setup_iwlan,
9826                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9827                   self.wifi_network_ssid, self.wifi_network_pass)),
9828                 (phone_setup_iwlan,
9829                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9830                   self.wifi_network_ssid, self.wifi_network_pass))]
9831        if not multithread_func(self.log, tasks):
9832            self.log.error("Phone Failed to Set Up Properly.")
9833            return False
9834
9835        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
9836        if call_ab_id is None or call_ac_id is None:
9837            return False
9838
9839        return self._test_ims_conference_merge_drop_second_call_from_participant(
9840            call_ab_id, call_ac_id)
9841
9842    @TelephonyBaseTest.tel_test_wrap
9843    @test_tracker_info(uuid="d3624dd8-20bd-4f6b-8a81-0c8671987b84")
9844    def test_epdg_mo_mo_add_epdg_merge_drop_second_call_from_host_wfc_apm_wifi_preferred_cep(
9845            self):
9846        """ Test WFC Conference Call among three phones. CEP enabled.
9847
9848        Steps:
9849        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
9850        2. PhoneA (WFC APM WiFi Preferred) call PhoneC (WFC APM WiFi Preferred), accept on PhoneC.
9851        3. On PhoneA, merge to conference call (WFC CEP conference call).
9852        4. On PhoneA disconnect call between A-C, verify call continues.
9853        5. On PhoneA disconnect call between A-B, verify call continues.
9854
9855        Expected Results:
9856        3. Conference merged successfully.
9857        4. Drop calls succeeded. Call between A-B continues.
9858        5. Drop calls succeeded, all call participants drop.
9859
9860        Returns:
9861            True if pass; False if fail.
9862
9863        TAGS: Telephony, WFC, Conference, CEP
9864        Priority: 1
9865        """
9866        ads = self.android_devices
9867
9868        tasks = [(phone_setup_iwlan,
9869                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9870                   self.wifi_network_ssid, self.wifi_network_pass)),
9871                 (phone_setup_iwlan,
9872                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9873                   self.wifi_network_ssid, self.wifi_network_pass)),
9874                 (phone_setup_iwlan,
9875                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9876                   self.wifi_network_ssid, self.wifi_network_pass))]
9877        if not multithread_func(self.log, tasks):
9878            self.log.error("Phone Failed to Set Up Properly.")
9879            return False
9880
9881        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
9882        if call_ab_id is None or call_ac_id is None:
9883            return False
9884
9885        return self._test_ims_conference_merge_drop_second_call_from_host(
9886            call_ab_id, call_ac_id)
9887
9888    @TelephonyBaseTest.tel_test_wrap
9889    @test_tracker_info(uuid="ba43d88c-1347-4570-92d0-ebfa6404788f")
9890    def test_epdg_mo_mo_add_epdg_merge_drop_first_call_from_participant_wfc_apm_wifi_preferred_cep(
9891            self):
9892        """ Test WFC Conference Call among three phones. CEP enabled.
9893
9894        Steps:
9895        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
9896        2. PhoneA (WFC APM WiFi Preferred) call PhoneC (WFC APM WiFi Preferred), accept on PhoneC.
9897        3. On PhoneA, merge to conference call (WFC CEP conference call).
9898        4. End call on PhoneB, verify call continues.
9899        5. End call on PhoneC, verify call end on PhoneA.
9900
9901        Expected Results:
9902        3. Conference merged successfully.
9903        4. Drop calls succeeded. Call between A-C continues.
9904        5. Drop calls succeeded, all call participants drop.
9905
9906        Returns:
9907            True if pass; False if fail.
9908
9909        TAGS: Telephony, WFC, Conference, CEP
9910        Priority: 1
9911        """
9912        ads = self.android_devices
9913
9914        tasks = [(phone_setup_iwlan,
9915                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9916                   self.wifi_network_ssid, self.wifi_network_pass)),
9917                 (phone_setup_iwlan,
9918                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9919                   self.wifi_network_ssid, self.wifi_network_pass)),
9920                 (phone_setup_iwlan,
9921                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9922                   self.wifi_network_ssid, self.wifi_network_pass))]
9923        if not multithread_func(self.log, tasks):
9924            self.log.error("Phone Failed to Set Up Properly.")
9925            return False
9926
9927        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
9928        if call_ab_id is None or call_ac_id is None:
9929            return False
9930
9931        return self._test_ims_conference_merge_drop_first_call_from_participant(
9932            call_ab_id, call_ac_id)
9933
9934    @TelephonyBaseTest.tel_test_wrap
9935    @test_tracker_info(uuid="fbcd20ec-ebac-45c2-b228-30fdec42752f")
9936    def test_epdg_mo_mo_add_epdg_merge_drop_first_call_from_host_wfc_apm_wifi_preferred_cep(
9937            self):
9938        """ Test WFC Conference Call among three phones. CEP enabled.
9939
9940        Steps:
9941        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
9942        2. PhoneA (WFC APM WiFi Preferred) call PhoneC (WFC APM WiFi Preferred), accept on PhoneC.
9943        3. On PhoneA, merge to conference call (WFC CEP conference call).
9944        4. On PhoneA disconnect call between A-B, verify call continues.
9945        5. On PhoneA disconnect call between A-C, verify call continues.
9946
9947        Expected Results:
9948        3. Conference merged successfully.
9949        4. Drop calls succeeded. Call between A-C continues.
9950        5. Drop calls succeeded, all call participants drop.
9951
9952        Returns:
9953            True if pass; False if fail.
9954
9955        TAGS: Telephony, WFC, Conference, CEP
9956        Priority: 1
9957        """
9958        ads = self.android_devices
9959
9960        tasks = [(phone_setup_iwlan,
9961                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
9962                   self.wifi_network_ssid, self.wifi_network_pass)),
9963                 (phone_setup_iwlan,
9964                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
9965                   self.wifi_network_ssid, self.wifi_network_pass)),
9966                 (phone_setup_iwlan,
9967                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
9968                   self.wifi_network_ssid, self.wifi_network_pass))]
9969        if not multithread_func(self.log, tasks):
9970            self.log.error("Phone Failed to Set Up Properly.")
9971            return False
9972
9973        call_ab_id, call_ac_id = self._test_epdg_mo_mo_add_epdg_swap_x(0)
9974        if call_ab_id is None or call_ac_id is None:
9975            return False
9976
9977        return self._test_ims_conference_merge_drop_first_call_from_host(
9978            call_ab_id, call_ac_id)
9979
9980    @TelephonyBaseTest.tel_test_wrap
9981    @test_tracker_info(uuid="fc54b329-4ec6-45b2-8f91-0a5789542596")
9982    def test_epdg_mo_mt_add_epdg_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_no_cep(
9983            self):
9984        """ Test WFC Conference Call among three phones. No CEP.
9985
9986        Steps:
9987        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
9988        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
9989        3. On PhoneA, merge to conference call (No CEP).
9990        4. End call on PhoneC, verify call continues.
9991        5. End call on PhoneB, verify call end on PhoneA.
9992
9993        Expected Results:
9994        3. Conference merged successfully.
9995        4. Drop calls succeeded. Call between A-B continues.
9996        5. Drop calls succeeded, all call participants drop.
9997
9998        Returns:
9999            True if pass; False if fail.
10000
10001        TAGS: Telephony, WFC, Conference, No_CEP
10002        Priority: 1
10003        """
10004        ads = self.android_devices
10005
10006        tasks = [(phone_setup_iwlan,
10007                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10008                   self.wifi_network_ssid, self.wifi_network_pass)),
10009                 (phone_setup_iwlan,
10010                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10011                   self.wifi_network_ssid, self.wifi_network_pass)),
10012                 (phone_setup_iwlan,
10013                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10014                   self.wifi_network_ssid, self.wifi_network_pass))]
10015        if not multithread_func(self.log, tasks):
10016            self.log.error("Phone Failed to Set Up Properly.")
10017            return False
10018
10019        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
10020        if call_ab_id is None or call_ac_id is None:
10021            return False
10022
10023        return self._test_ims_conference_merge_drop_second_call_from_participant(
10024            call_ab_id, call_ac_id)
10025
10026    @TelephonyBaseTest.tel_test_wrap
10027    @test_tracker_info(uuid="64096e42-1fb2-4eb4-9f60-3e22c7ad5c83")
10028    def test_epdg_mo_mt_add_epdg_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_cep(
10029            self):
10030        """ Test WFC Conference Call among three phones. CEP enabled.
10031
10032        Steps
10033        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10034        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10035        3. On PhoneA, merge to conference call (WFC CEP conference call).
10036        4. End call on PhoneC, verify call continues.
10037        5. End call on PhoneB, verify call end on PhoneA.
10038
10039        Expected Results:
10040        3. Conference merged successfully.
10041        4. Drop calls succeeded. Call between A-B continues.
10042        5. Drop calls succeeded, all call participants drop.
10043
10044        Returns:
10045            True if pass; False if fail.
10046
10047        TAGS: Telephony, WFC, Conference, CEP
10048        Priority: 1
10049        """
10050        ads = self.android_devices
10051
10052        tasks = [(phone_setup_iwlan,
10053                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10054                   self.wifi_network_ssid, self.wifi_network_pass)),
10055                 (phone_setup_iwlan,
10056                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10057                   self.wifi_network_ssid, self.wifi_network_pass)),
10058                 (phone_setup_iwlan,
10059                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10060                   self.wifi_network_ssid, self.wifi_network_pass))]
10061        if not multithread_func(self.log, tasks):
10062            self.log.error("Phone Failed to Set Up Properly.")
10063            return False
10064
10065        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
10066        if call_ab_id is None or call_ac_id is None:
10067            return False
10068
10069        return self._test_ims_conference_merge_drop_second_call_from_participant(
10070            call_ab_id, call_ac_id)
10071
10072    @TelephonyBaseTest.tel_test_wrap
10073    @test_tracker_info(uuid="24b6abb4-03c8-464c-a584-ca597bd67b46")
10074    def test_epdg_mo_mt_add_epdg_merge_drop_second_call_from_host_wfc_apm_wifi_preferred_cep(
10075            self):
10076        """ Test WFC Conference Call among three phones. CEP enabled.
10077
10078        Steps:
10079        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10080        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10081        3. On PhoneA, merge to conference call (WFC CEP conference call).
10082        4. On PhoneA disconnect call between A-C, verify call continues.
10083        5. On PhoneA disconnect call between A-B, verify call continues.
10084
10085        Expected Results:
10086        3. Conference merged successfully.
10087        4. Drop calls succeeded. Call between A-B continues.
10088        5. Drop calls succeeded, all call participants drop.
10089
10090        Returns:
10091            True if pass; False if fail.
10092
10093        TAGS: Telephony, WFC, Conference, CEP
10094        Priority: 1
10095        """
10096        ads = self.android_devices
10097
10098        tasks = [(phone_setup_iwlan,
10099                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10100                   self.wifi_network_ssid, self.wifi_network_pass)),
10101                 (phone_setup_iwlan,
10102                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10103                   self.wifi_network_ssid, self.wifi_network_pass)),
10104                 (phone_setup_iwlan,
10105                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10106                   self.wifi_network_ssid, self.wifi_network_pass))]
10107        if not multithread_func(self.log, tasks):
10108            self.log.error("Phone Failed to Set Up Properly.")
10109            return False
10110
10111        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
10112        if call_ab_id is None or call_ac_id is None:
10113            return False
10114
10115        return self._test_ims_conference_merge_drop_second_call_from_host(
10116            call_ab_id, call_ac_id)
10117
10118    @TelephonyBaseTest.tel_test_wrap
10119    @test_tracker_info(uuid="f54776e4-84c0-43db-8724-f012ef551ebd")
10120    def test_epdg_mo_mt_add_epdg_merge_drop_first_call_from_participant_wfc_apm_wifi_preferred_cep(
10121            self):
10122        """ Test WFC Conference Call among three phones. CEP enabled.
10123
10124        Steps:
10125        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10126        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10127        3. On PhoneA, merge to conference call (WFC CEP conference call).
10128        4. End call on PhoneB, verify call continues.
10129        5. End call on PhoneC, verify call end on PhoneA.
10130
10131        Expected Results:
10132        3. Conference merged successfully.
10133        4. Drop calls succeeded. Call between A-C continues.
10134        5. Drop calls succeeded, all call participants drop.
10135
10136        Returns:
10137            True if pass; False if fail.
10138
10139        TAGS: Telephony, WFC, Conference, CEP
10140        Priority: 1
10141        """
10142        ads = self.android_devices
10143
10144        tasks = [(phone_setup_iwlan,
10145                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10146                   self.wifi_network_ssid, self.wifi_network_pass)),
10147                 (phone_setup_iwlan,
10148                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10149                   self.wifi_network_ssid, self.wifi_network_pass)),
10150                 (phone_setup_iwlan,
10151                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10152                   self.wifi_network_ssid, self.wifi_network_pass))]
10153        if not multithread_func(self.log, tasks):
10154            self.log.error("Phone Failed to Set Up Properly.")
10155            return False
10156
10157        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
10158        if call_ab_id is None or call_ac_id is None:
10159            return False
10160
10161        return self._test_ims_conference_merge_drop_first_call_from_participant(
10162            call_ab_id, call_ac_id)
10163
10164    @TelephonyBaseTest.tel_test_wrap
10165    @test_tracker_info(uuid="6635aeff-f10a-4fb0-b658-4f1e7f2d9a68")
10166    def test_epdg_mo_mt_add_epdg_merge_drop_first_call_from_host_wfc_apm_wifi_preferred_cep(
10167            self):
10168        """ Test WFC Conference Call among three phones. CEP enabled.
10169
10170        Steps:
10171        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10172        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10173        3. On PhoneA, merge to conference call (WFC CEP conference call).
10174        4. On PhoneA disconnect call between A-B, verify call continues.
10175        5. On PhoneA disconnect call between A-C, verify call continues.
10176
10177        Expected Results:
10178        3. Conference merged successfully.
10179        4. Drop calls succeeded. Call between A-C continues.
10180        5. Drop calls succeeded, all call participants drop.
10181
10182        Returns:
10183            True if pass; False if fail.
10184
10185        TAGS: Telephony, WFC, Conference, CEP
10186        Priority: 1
10187        """
10188        ads = self.android_devices
10189
10190        tasks = [(phone_setup_iwlan,
10191                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10192                   self.wifi_network_ssid, self.wifi_network_pass)),
10193                 (phone_setup_iwlan,
10194                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10195                   self.wifi_network_ssid, self.wifi_network_pass)),
10196                 (phone_setup_iwlan,
10197                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10198                   self.wifi_network_ssid, self.wifi_network_pass))]
10199        if not multithread_func(self.log, tasks):
10200            self.log.error("Phone Failed to Set Up Properly.")
10201            return False
10202
10203        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(0)
10204        if call_ab_id is None or call_ac_id is None:
10205            return False
10206
10207        return self._test_ims_conference_merge_drop_first_call_from_host(
10208            call_ab_id, call_ac_id)
10209
10210    @TelephonyBaseTest.tel_test_wrap
10211    @test_tracker_info(uuid="c2534477-74ff-43ca-920a-48238928f344")
10212    def test_epdg_mt_mt_add_epdg_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_no_cep(
10213            self):
10214        """ Test WFC Conference Call among three phones. No CEP.
10215
10216        Steps:
10217        1. PhoneB (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10218        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10219        3. On PhoneA, merge to conference call (No CEP).
10220        4. End call on PhoneC, verify call continues.
10221        5. End call on PhoneB, verify call end on PhoneA.
10222
10223        Expected Results:
10224        3. Conference merged successfully.
10225        4. Drop calls succeeded. Call between A-B continues.
10226        5. Drop calls succeeded, all call participants drop.
10227
10228        Returns:
10229            True if pass; False if fail.
10230
10231        TAGS: Telephony, WFC, Conference, No_CEP
10232        Priority: 1
10233        """
10234        ads = self.android_devices
10235
10236        tasks = [(phone_setup_iwlan,
10237                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10238                   self.wifi_network_ssid, self.wifi_network_pass)),
10239                 (phone_setup_iwlan,
10240                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10241                   self.wifi_network_ssid, self.wifi_network_pass)),
10242                 (phone_setup_iwlan,
10243                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10244                   self.wifi_network_ssid, self.wifi_network_pass))]
10245        if not multithread_func(self.log, tasks):
10246            self.log.error("Phone Failed to Set Up Properly.")
10247            return False
10248
10249        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
10250        if call_ab_id is None or call_ac_id is None:
10251            return False
10252
10253        return self._test_ims_conference_merge_drop_second_call_from_participant(
10254            call_ab_id, call_ac_id)
10255
10256    @TelephonyBaseTest.tel_test_wrap
10257    @test_tracker_info(uuid="ef5ea03d-1c1b-4c9a-a72d-14b2ba7e87cb")
10258    def test_epdg_mt_mt_add_epdg_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_cep(
10259            self):
10260        """ Test WFC Conference Call among three phones. CEP enabled.
10261
10262        Steps
10263        1. PhoneB (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10264        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10265        3. On PhoneA, merge to conference call (WFC CEP conference call).
10266        4. End call on PhoneC, verify call continues.
10267        5. End call on PhoneB, verify call end on PhoneA.
10268
10269        Expected Results:
10270        3. Conference merged successfully.
10271        4. Drop calls succeeded. Call between A-B continues.
10272        5. Drop calls succeeded, all call participants drop.
10273
10274        Returns:
10275            True if pass; False if fail.
10276
10277        TAGS: Telephony, WFC, Conference, CEP
10278        Priority: 1
10279        """
10280        ads = self.android_devices
10281
10282        tasks = [(phone_setup_iwlan,
10283                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10284                   self.wifi_network_ssid, self.wifi_network_pass)),
10285                 (phone_setup_iwlan,
10286                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10287                   self.wifi_network_ssid, self.wifi_network_pass)),
10288                 (phone_setup_iwlan,
10289                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10290                   self.wifi_network_ssid, self.wifi_network_pass))]
10291        if not multithread_func(self.log, tasks):
10292            self.log.error("Phone Failed to Set Up Properly.")
10293            return False
10294
10295        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
10296        if call_ab_id is None or call_ac_id is None:
10297            return False
10298
10299        return self._test_ims_conference_merge_drop_second_call_from_participant(
10300            call_ab_id, call_ac_id)
10301
10302    @TelephonyBaseTest.tel_test_wrap
10303    @test_tracker_info(uuid="b0df507f-2adf-45fe-a174-44f62718296e")
10304    def test_epdg_mt_mt_add_epdg_merge_drop_second_call_from_host_wfc_apm_wifi_preferred_cep(
10305            self):
10306        """ Test WFC Conference Call among three phones. CEP enabled.
10307
10308        Steps:
10309        1. PhoneB (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10310        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10311        3. On PhoneA, merge to conference call (WFC CEP conference call).
10312        4. On PhoneA disconnect call between A-C, verify call continues.
10313        5. On PhoneA disconnect call between A-B, verify call continues.
10314
10315        Expected Results:
10316        3. Conference merged successfully.
10317        4. Drop calls succeeded. Call between A-B continues.
10318        5. Drop calls succeeded, all call participants drop.
10319
10320        Returns:
10321            True if pass; False if fail.
10322
10323        TAGS: Telephony, WFC, Conference, CEP
10324        Priority: 1
10325        """
10326        ads = self.android_devices
10327
10328        tasks = [(phone_setup_iwlan,
10329                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10330                   self.wifi_network_ssid, self.wifi_network_pass)),
10331                 (phone_setup_iwlan,
10332                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10333                   self.wifi_network_ssid, self.wifi_network_pass)),
10334                 (phone_setup_iwlan,
10335                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10336                   self.wifi_network_ssid, self.wifi_network_pass))]
10337        if not multithread_func(self.log, tasks):
10338            self.log.error("Phone Failed to Set Up Properly.")
10339            return False
10340
10341        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
10342        if call_ab_id is None or call_ac_id is None:
10343            return False
10344
10345        return self._test_ims_conference_merge_drop_second_call_from_host(
10346            call_ab_id, call_ac_id)
10347
10348    @TelephonyBaseTest.tel_test_wrap
10349    @test_tracker_info(uuid="278c6bec-7065-4f54-9834-33d8a6172f58")
10350    def test_epdg_mt_mt_add_epdg_merge_drop_first_call_from_participant_wfc_apm_wifi_preferred_cep(
10351            self):
10352        """ Test WFC Conference Call among three phones. CEP enabled.
10353
10354        Steps:
10355        1. PhoneB (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10356        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10357        3. On PhoneA, merge to conference call (WFC CEP conference call).
10358        4. End call on PhoneB, verify call continues.
10359        5. End call on PhoneC, verify call end on PhoneA.
10360
10361        Expected Results:
10362        3. Conference merged successfully.
10363        4. Drop calls succeeded. Call between A-C continues.
10364        5. Drop calls succeeded, all call participants drop.
10365
10366        Returns:
10367            True if pass; False if fail.
10368
10369        TAGS: Telephony, WFC, Conference, CEP
10370        Priority: 1
10371        """
10372        ads = self.android_devices
10373
10374        tasks = [(phone_setup_iwlan,
10375                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10376                   self.wifi_network_ssid, self.wifi_network_pass)),
10377                 (phone_setup_iwlan,
10378                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10379                   self.wifi_network_ssid, self.wifi_network_pass)),
10380                 (phone_setup_iwlan,
10381                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10382                   self.wifi_network_ssid, self.wifi_network_pass))]
10383        if not multithread_func(self.log, tasks):
10384            self.log.error("Phone Failed to Set Up Properly.")
10385            return False
10386
10387        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
10388        if call_ab_id is None or call_ac_id is None:
10389            return False
10390
10391        return self._test_ims_conference_merge_drop_first_call_from_participant(
10392            call_ab_id, call_ac_id)
10393
10394    @TelephonyBaseTest.tel_test_wrap
10395    @test_tracker_info(uuid="1ffceadc-8bd1-489d-bb66-4b3081df3a64")
10396    def test_epdg_mt_mt_add_epdg_merge_drop_first_call_from_host_wfc_apm_wifi_preferred_cep(
10397            self):
10398        """ Test WFC Conference Call among three phones. CEP enabled.
10399
10400        Steps:
10401        1. PhoneB (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10402        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10403        3. On PhoneA, merge to conference call (WFC CEP conference call).
10404        4. On PhoneA disconnect call between A-B, verify call continues.
10405        5. On PhoneA disconnect call between A-C, verify call continues.
10406
10407        Expected Results:
10408        3. Conference merged successfully.
10409        4. Drop calls succeeded. Call between A-C continues.
10410        5. Drop calls succeeded, all call participants drop.
10411
10412        Returns:
10413            True if pass; False if fail.
10414
10415        TAGS: Telephony, WFC, Conference, CEP
10416        Priority: 1
10417        """
10418        ads = self.android_devices
10419
10420        tasks = [(phone_setup_iwlan,
10421                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10422                   self.wifi_network_ssid, self.wifi_network_pass)),
10423                 (phone_setup_iwlan,
10424                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10425                   self.wifi_network_ssid, self.wifi_network_pass)),
10426                 (phone_setup_iwlan,
10427                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10428                   self.wifi_network_ssid, self.wifi_network_pass))]
10429        if not multithread_func(self.log, tasks):
10430            self.log.error("Phone Failed to Set Up Properly.")
10431            return False
10432
10433        call_ab_id, call_ac_id = self._test_epdg_mt_mt_add_epdg_swap_x(0)
10434        if call_ab_id is None or call_ac_id is None:
10435            return False
10436
10437        return self._test_ims_conference_merge_drop_first_call_from_host(
10438            call_ab_id, call_ac_id)
10439
10440    @TelephonyBaseTest.tel_test_wrap
10441    @test_tracker_info(uuid="b3dfaa38-8e9b-45b7-8e4e-6e6ca10887bd")
10442    def test_epdg_mo_mt_add_epdg_swap_once_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_no_cep(
10443            self):
10444        """ Test swap and merge features in WFC call. No CEP.
10445
10446        Steps:
10447        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10448        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10449        3. Swap active call on PhoneA.
10450        4. On PhoneA, merge to conference call (No CEP).
10451        5. End call on PhoneC, verify call continues.
10452        6. End call on PhoneB, verify call end on PhoneA.
10453
10454        Expected Results:
10455        3. Swap operation succeeded.
10456        4. Conference merged successfully.
10457        5. Drop calls succeeded. Call between A-B continues.
10458        6. Drop calls succeeded, all call participants drop.
10459
10460        Returns:
10461            True if pass; False if fail.
10462
10463        TAGS: Telephony, WFC, Conference, No_CEP
10464        Priority: 1
10465        """
10466        ads = self.android_devices
10467
10468        tasks = [(phone_setup_iwlan,
10469                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10470                   self.wifi_network_ssid, self.wifi_network_pass)),
10471                 (phone_setup_iwlan,
10472                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10473                   self.wifi_network_ssid, self.wifi_network_pass)),
10474                 (phone_setup_iwlan,
10475                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10476                   self.wifi_network_ssid, self.wifi_network_pass))]
10477        if not multithread_func(self.log, tasks):
10478            self.log.error("Phone Failed to Set Up Properly.")
10479            return False
10480
10481        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
10482        if call_ab_id is None or call_ac_id is None:
10483            return False
10484
10485        return self._test_ims_conference_merge_drop_second_call_from_participant(
10486            call_ab_id, call_ac_id)
10487
10488    @TelephonyBaseTest.tel_test_wrap
10489    @test_tracker_info(uuid="eb82f1ac-e5a3-42bc-b9d9-806442263f79")
10490    def test_epdg_mo_mt_add_epdg_swap_once_merge_drop_second_call_from_host_wfc_apm_wifi_preferred_cep(
10491            self):
10492        """ Test swap and merge features in WFC call. CEP enabled.
10493
10494        Steps:
10495        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10496        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10497        3. Swap active call on PhoneA.
10498        4. On PhoneA, merge to conference call (WFC CEP conference call).
10499        5. On PhoneA disconnect call between A-C, verify call continues.
10500        6. On PhoneA disconnect call between A-B, verify call continues.
10501
10502        Expected Results:
10503        3. Swap operation succeeded.
10504        4. Conference merged successfully.
10505        5. Drop calls succeeded. Call between A-B continues.
10506        6. Drop calls succeeded, all call participants drop.
10507
10508        Returns:
10509            True if pass; False if fail.
10510
10511        TAGS: Telephony, WFC, Conference, CEP
10512        Priority: 1
10513        """
10514        ads = self.android_devices
10515
10516        tasks = [(phone_setup_iwlan,
10517                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10518                   self.wifi_network_ssid, self.wifi_network_pass)),
10519                 (phone_setup_iwlan,
10520                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10521                   self.wifi_network_ssid, self.wifi_network_pass)),
10522                 (phone_setup_iwlan,
10523                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10524                   self.wifi_network_ssid, self.wifi_network_pass))]
10525        if not multithread_func(self.log, tasks):
10526            self.log.error("Phone Failed to Set Up Properly.")
10527            return False
10528
10529        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
10530        if call_ab_id is None or call_ac_id is None:
10531            return False
10532
10533        return self._test_ims_conference_merge_drop_second_call_from_host(
10534            call_ab_id, call_ac_id)
10535
10536    @TelephonyBaseTest.tel_test_wrap
10537    @test_tracker_info(uuid="53ba057d-5c5c-4236-9ff9-829177e6f51e")
10538    def test_epdg_mo_mt_add_epdg_swap_once_merge_drop_second_call_from_participant_wfc_apm_wifi_preferred_cep(
10539            self):
10540        """ Test swap and merge features in WFC call. CEP enabled.
10541
10542        Steps:
10543        1. PhoneA (WFC APM WiFi Preferred) call PhoneB (WFC APM WiFi Preferred), accept on PhoneB.
10544        2. PhoneC (WFC APM WiFi Preferred) call PhoneA (WFC APM WiFi Preferred), accept on PhoneA.
10545        3. Swap active call on PhoneA.
10546        4. On PhoneA, merge to conference call (WFC CEP conference call).
10547        5. End call on PhoneC, verify call continues.
10548        6. End call on PhoneB, verify call end on PhoneA.
10549
10550        Expected Results:
10551        3. Swap operation succeeded.
10552        4. Conference merged successfully.
10553        5. Drop calls succeeded. Call between A-B continues.
10554        6. Drop calls succeeded, all call participants drop.
10555
10556        Returns:
10557            True if pass; False if fail.
10558
10559        TAGS: Telephony, WFC, Conference, CEP
10560        Priority: 1
10561        """
10562        ads = self.android_devices
10563
10564        tasks = [(phone_setup_iwlan,
10565                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10566                   self.wifi_network_ssid, self.wifi_network_pass)),
10567                 (phone_setup_iwlan,
10568                  (self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
10569                   self.wifi_network_ssid, self.wifi_network_pass)),
10570                 (phone_setup_iwlan,
10571                  (self.log, ads[2], True, WFC_MODE_WIFI_PREFERRED,
10572                   self.wifi_network_ssid, self.wifi_network_pass))]
10573        if not multithread_func(self.log, tasks):
10574            self.log.error("Phone Failed to Set Up Properly.")
10575            return False
10576
10577        call_ab_id, call_ac_id = self._test_epdg_mo_mt_add_epdg_swap_x(1)
10578        if call_ab_id is None or call_ac_id is None:
10579            return False
10580
10581        return self._test_ims_conference_merge_drop_second_call_from_participant(
10582            call_ab_id, call_ac_id)
10583
10584    @TelephonyBaseTest.tel_test_wrap
10585    @test_tracker_info(uuid="a246cbd0-915d-4068-8d63-7e099d41fd43")
10586    def test_wcdma_add_mt_decline(self):
10587        ads = self.android_devices
10588
10589        tasks = [(phone_setup_3g, (self.log, ads[0])),
10590                 (phone_setup_voice_general, (self.log, ads[1])),
10591                 (phone_setup_voice_general, (self.log, ads[2]))]
10592        if not multithread_func(self.log, tasks):
10593            self.log.error("Phone Failed to Set Up Properly.")
10594            return False
10595
10596        if not self._three_phone_call_mo_add_mt_reject(
10597            [ads[0], ads[1], ads[2]], [is_phone_in_call_wcdma, None], True):
10598            return False
10599        return True
10600
10601    @TelephonyBaseTest.tel_test_wrap
10602    @test_tracker_info(uuid="2789388a-c67c-4c37-a4ea-98c9083abcf9")
10603    def test_wcdma_add_mt_ignore(self):
10604        ads = self.android_devices
10605
10606        tasks = [(phone_setup_3g, (self.log, ads[0])),
10607                 (phone_setup_voice_general, (self.log, ads[1])),
10608                 (phone_setup_voice_general, (self.log, ads[2]))]
10609        if not multithread_func(self.log, tasks):
10610            self.log.error("Phone Failed to Set Up Properly.")
10611            return False
10612
10613        if not self._three_phone_call_mo_add_mt_reject(
10614            [ads[0], ads[1], ads[2]], [is_phone_in_call_wcdma, None], False):
10615            return False
10616        return True
10617
10618    @TelephonyBaseTest.tel_test_wrap
10619    @test_tracker_info(uuid="8f5399b2-5075-45b2-b916-2d436d1c1c93")
10620    def test_1x_add_mt_decline(self):
10621        ads = self.android_devices
10622
10623        tasks = [(phone_setup_3g, (self.log, ads[0])),
10624                 (phone_setup_voice_general, (self.log, ads[1])),
10625                 (phone_setup_voice_general, (self.log, ads[2]))]
10626        if not multithread_func(self.log, tasks):
10627            self.log.error("Phone Failed to Set Up Properly.")
10628            return False
10629
10630        if not self._three_phone_call_mo_add_mt_reject(
10631            [ads[0], ads[1], ads[2]], [is_phone_in_call_1x, None], True):
10632            return False
10633        return True
10634
10635    @TelephonyBaseTest.tel_test_wrap
10636    @test_tracker_info(uuid="a7e6ea10-d4d4-4089-a012-31565314cf65")
10637    def test_1x_add_mt_ignore(self):
10638        ads = self.android_devices
10639
10640        tasks = [(phone_setup_3g, (self.log, ads[0])),
10641                 (phone_setup_voice_general, (self.log, ads[1])),
10642                 (phone_setup_voice_general, (self.log, ads[2]))]
10643        if not multithread_func(self.log, tasks):
10644            self.log.error("Phone Failed to Set Up Properly.")
10645            return False
10646
10647        if not self._three_phone_call_mo_add_mt_reject(
10648            [ads[0], ads[1], ads[2]], [is_phone_in_call_1x, None], False):
10649            return False
10650        return True
10651
10652    @TelephonyBaseTest.tel_test_wrap
10653    @test_tracker_info(uuid="c7d878f6-2f1c-4029-bcf9-2aecf2d202e7")
10654    def test_volte_add_mt_decline(self):
10655        ads = self.android_devices
10656
10657        tasks = [(phone_setup_volte, (self.log, ads[0])),
10658                 (phone_setup_voice_general, (self.log, ads[1])),
10659                 (phone_setup_voice_general, (self.log, ads[2]))]
10660        if not multithread_func(self.log, tasks):
10661            self.log.error("Phone Failed to Set Up Properly.")
10662            return False
10663
10664        if not self._three_phone_call_mo_add_mt_reject(
10665            [ads[0], ads[1], ads[2]], [is_phone_in_call_volte, None], True):
10666            return False
10667        return True
10668
10669    @TelephonyBaseTest.tel_test_wrap
10670    @test_tracker_info(uuid="4f03240f-88a7-4d39-9d90-6327e835d5e2")
10671    def test_volte_add_mt_ignore(self):
10672        ads = self.android_devices
10673
10674        tasks = [(phone_setup_volte, (self.log, ads[0])),
10675                 (phone_setup_voice_general, (self.log, ads[1])),
10676                 (phone_setup_voice_general, (self.log, ads[2]))]
10677        if not multithread_func(self.log, tasks):
10678            self.log.error("Phone Failed to Set Up Properly.")
10679            return False
10680
10681        if not self._three_phone_call_mo_add_mt_reject(
10682            [ads[0], ads[1], ads[2]], [is_phone_in_call_volte, None], False):
10683            return False
10684        return True
10685
10686    @TelephonyBaseTest.tel_test_wrap
10687    @test_tracker_info(uuid="ce51844a-4879-470e-9a22-4eafe25f8e2a")
10688    def test_wfc_lte_add_mt_decline(self):
10689        ads = self.android_devices
10690
10691        tasks = [(phone_setup_iwlan,
10692                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
10693                   self.wifi_network_ssid, self.wifi_network_pass)),
10694                 (phone_setup_voice_general, (self.log, ads[1])),
10695                 (phone_setup_voice_general, (self.log, ads[2]))]
10696        if not multithread_func(self.log, tasks):
10697            self.log.error("Phone Failed to Set Up Properly.")
10698            return False
10699
10700        if not self._three_phone_call_mo_add_mt_reject(
10701            [ads[0], ads[1], ads[2]], [is_phone_in_call_volte, None], True):
10702            return False
10703        return True
10704
10705    @TelephonyBaseTest.tel_test_wrap
10706    @test_tracker_info(uuid="b5058cd0-4073-4018-9683-335fd27ab529")
10707    def test_wfc_lte_add_mt_ignore(self):
10708        ads = self.android_devices
10709
10710        tasks = [(phone_setup_iwlan,
10711                  (self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
10712                   self.wifi_network_ssid, self.wifi_network_pass)),
10713                 (phone_setup_voice_general, (self.log, ads[1])),
10714                 (phone_setup_voice_general, (self.log, ads[2]))]
10715        if not multithread_func(self.log, tasks):
10716            self.log.error("Phone Failed to Set Up Properly.")
10717            return False
10718
10719        if not self._three_phone_call_mo_add_mt_reject(
10720            [ads[0], ads[1], ads[2]], [is_phone_in_call_volte, None], False):
10721            return False
10722        return True
10723
10724    @TelephonyBaseTest.tel_test_wrap
10725    @test_tracker_info(uuid="456e0a04-7d82-4387-89bb-80613732412e")
10726    def test_wfc_apm_add_mt_decline(self):
10727        ads = self.android_devices
10728
10729        tasks = [(phone_setup_iwlan,
10730                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10731                   self.wifi_network_ssid, self.wifi_network_pass)),
10732                 (phone_setup_voice_general, (self.log, ads[1])),
10733                 (phone_setup_voice_general, (self.log, ads[2]))]
10734        if not multithread_func(self.log, tasks):
10735            self.log.error("Phone Failed to Set Up Properly.")
10736            return False
10737
10738        if not self._three_phone_call_mo_add_mt_reject(
10739            [ads[0], ads[1], ads[2]], [is_phone_in_call_iwlan, None], True):
10740            return False
10741        return True
10742
10743    @TelephonyBaseTest.tel_test_wrap
10744    @test_tracker_info(uuid="ee71fc98-9e52-406f-8d8a-6d9c62cbe6f4")
10745    def test_wfc_apm_add_mt_ignore(self):
10746        ads = self.android_devices
10747
10748        tasks = [(phone_setup_iwlan,
10749                  (self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
10750                   self.wifi_network_ssid, self.wifi_network_pass)),
10751                 (phone_setup_voice_general, (self.log, ads[1])),
10752                 (phone_setup_voice_general, (self.log, ads[2]))]
10753        if not multithread_func(self.log, tasks):
10754            self.log.error("Phone Failed to Set Up Properly.")
10755            return False
10756
10757        if not self._three_phone_call_mo_add_mt_reject(
10758            [ads[0], ads[1], ads[2]], [is_phone_in_call_iwlan, None], False):
10759            return False
10760        return True
10761
10762    @TelephonyBaseTest.tel_test_wrap
10763    @test_tracker_info(uuid="f4990e20-4a40-4238-9a2a-a75d9be3d354")
10764    def test_call_forwarding_unconditional(self):
10765
10766        ads = self.android_devices
10767
10768        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10769                 (phone_setup_voice_general, (self.log, ads[1])),
10770                 (phone_setup_voice_general, (self.log, ads[2]))]
10771        if not multithread_func(self.log, tasks):
10772            self.log.error("Phone Failed to Set Up Properly.")
10773            return False
10774
10775        return three_phone_call_forwarding_short_seq(
10776            self.log,
10777            ads[0],
10778            None,
10779            None,
10780            ads[1],
10781            ads[2],
10782            call_forwarding_type="unconditional")
10783
10784    @TelephonyBaseTest.tel_test_wrap
10785    @test_tracker_info(uuid="26b85c3f-5a38-465a-a6e3-dfd03c6ea315")
10786    def test_call_forwarding_busy(self):
10787
10788        ads = self.android_devices
10789
10790        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10791                 (phone_setup_voice_general, (self.log, ads[1])),
10792                 (phone_setup_voice_general, (self.log, ads[2]))]
10793        if not multithread_func(self.log, tasks):
10794            self.log.error("Phone Failed to Set Up Properly.")
10795            return False
10796
10797        return three_phone_call_forwarding_short_seq(
10798            self.log,
10799            ads[0],
10800            None,
10801            None,
10802            ads[1],
10803            ads[2],
10804            call_forwarding_type="busy")
10805
10806    @TelephonyBaseTest.tel_test_wrap
10807    @test_tracker_info(uuid="96638a39-efe2-40e2-afb6-6a97f87c4af5")
10808    def test_call_forwarding_not_answered(self):
10809
10810        ads = self.android_devices
10811
10812        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10813                 (phone_setup_voice_general, (self.log, ads[1])),
10814                 (phone_setup_voice_general, (self.log, ads[2]))]
10815        if not multithread_func(self.log, tasks):
10816            self.log.error("Phone Failed to Set Up Properly.")
10817            return False
10818
10819        return three_phone_call_forwarding_short_seq(
10820            self.log,
10821            ads[0],
10822            None,
10823            None,
10824            ads[1],
10825            ads[2],
10826            call_forwarding_type="not_answered")
10827
10828    @TelephonyBaseTest.tel_test_wrap
10829    @test_tracker_info(uuid="a13e586a-3345-49d8-9e84-ca33bd3fbd7d")
10830    def test_call_forwarding_not_reachable(self):
10831
10832        ads = self.android_devices
10833
10834        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10835                 (phone_setup_voice_general, (self.log, ads[1])),
10836                 (phone_setup_voice_general, (self.log, ads[2]))]
10837        if not multithread_func(self.log, tasks):
10838            self.log.error("Phone Failed to Set Up Properly.")
10839            return False
10840
10841        return three_phone_call_forwarding_short_seq(
10842            self.log,
10843            ads[0],
10844            None,
10845            None,
10846            ads[1],
10847            ads[2],
10848            call_forwarding_type="not_reachable")
10849
10850    @TelephonyBaseTest.tel_test_wrap
10851    @test_tracker_info(uuid="e9a6027b-7dd1-4dca-a700-e4d42c9c947d")
10852    def test_call_waiting_scenario_1(self):
10853        """ Call waiting scenario 1: 1st call ended first by caller1 during 2nd
10854        call incoming. 2nd call ended by caller2.
10855        """
10856        ads = self.android_devices
10857
10858        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10859                 (phone_setup_voice_general, (self.log, ads[1])),
10860                 (phone_setup_voice_general, (self.log, ads[2]))]
10861        if not multithread_func(self.log, tasks):
10862            self.log.error("Phone Failed to Set Up Properly.")
10863            return False
10864
10865        return three_phone_call_waiting_short_seq(
10866            self.log,
10867            ads[0],
10868            None,
10869            None,
10870            ads[1],
10871            ads[2],
10872            call_waiting=True,
10873            scenario=1)
10874
10875    @TelephonyBaseTest.tel_test_wrap
10876    @test_tracker_info(uuid="3fe02cb7-68d7-4762-882a-02bff8ce32f9")
10877    def test_call_waiting_scenario_2(self):
10878        """ Call waiting scenario 2: 1st call ended first by caller1 during 2nd
10879        call incoming. 2nd call ended by callee.
10880        """
10881        ads = self.android_devices
10882
10883        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10884                 (phone_setup_voice_general, (self.log, ads[1])),
10885                 (phone_setup_voice_general, (self.log, ads[2]))]
10886        if not multithread_func(self.log, tasks):
10887            self.log.error("Phone Failed to Set Up Properly.")
10888            return False
10889
10890        return three_phone_call_waiting_short_seq(
10891            self.log,
10892            ads[0],
10893            None,
10894            None,
10895            ads[1],
10896            ads[2],
10897            call_waiting=True,
10898            scenario=2)
10899
10900    @TelephonyBaseTest.tel_test_wrap
10901    @test_tracker_info(uuid="bf5eb9ad-1fa2-468d-99dc-3cbcee8c89f8")
10902    def test_call_waiting_scenario_3(self):
10903        """ Call waiting scenario 3: 1st call ended first by callee during 2nd
10904        call incoming. 2nd call ended by caller2.
10905        """
10906        ads = self.android_devices
10907
10908        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10909                 (phone_setup_voice_general, (self.log, ads[1])),
10910                 (phone_setup_voice_general, (self.log, ads[2]))]
10911        if not multithread_func(self.log, tasks):
10912            self.log.error("Phone Failed to Set Up Properly.")
10913            return False
10914
10915        return three_phone_call_waiting_short_seq(
10916            self.log,
10917            ads[0],
10918            None,
10919            None,
10920            ads[1],
10921            ads[2],
10922            call_waiting=True,
10923            scenario=3)
10924
10925    @TelephonyBaseTest.tel_test_wrap
10926    @test_tracker_info(uuid="f2e4b6a9-6a6f-466c-884c-c0ef79d6ff01")
10927    def test_call_waiting_scenario_4(self):
10928        """Call waiting scenario 4: 1st call ended first by callee during 2nd
10929        call incoming. 2nd call ended by callee.
10930        """
10931        ads = self.android_devices
10932
10933        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10934                 (phone_setup_voice_general, (self.log, ads[1])),
10935                 (phone_setup_voice_general, (self.log, ads[2]))]
10936        if not multithread_func(self.log, tasks):
10937            self.log.error("Phone Failed to Set Up Properly.")
10938            return False
10939
10940        return three_phone_call_waiting_short_seq(
10941            self.log,
10942            ads[0],
10943            None,
10944            None,
10945            ads[1],
10946            ads[2],
10947            call_waiting=True,
10948            scenario=4)
10949
10950    @TelephonyBaseTest.tel_test_wrap
10951    @test_tracker_info(uuid="f2d36f45-63f6-4e01-9844-6fa53c26def7")
10952    def test_call_waiting_scenario_5(self):
10953        """ Call waiting scenario 5: 1st call ended by caller1. 2nd call ended
10954        by caller2.
10955        """
10956        ads = self.android_devices
10957
10958        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10959                 (phone_setup_voice_general, (self.log, ads[1])),
10960                 (phone_setup_voice_general, (self.log, ads[2]))]
10961        if not multithread_func(self.log, tasks):
10962            self.log.error("Phone Failed to Set Up Properly.")
10963            return False
10964
10965        return three_phone_call_waiting_short_seq(
10966            self.log,
10967            ads[0],
10968            None,
10969            None,
10970            ads[1],
10971            ads[2],
10972            call_waiting=True,
10973            scenario=5)
10974
10975    @TelephonyBaseTest.tel_test_wrap
10976    @test_tracker_info(uuid="7eb2a89d-30ad-4a34-8e63-87d0181b91aa")
10977    def test_call_waiting_scenario_6(self):
10978        """Call waiting scenario 6: 1st call ended by caller1. 2nd call ended by
10979        callee.
10980        """
10981        ads = self.android_devices
10982
10983        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
10984                 (phone_setup_voice_general, (self.log, ads[1])),
10985                 (phone_setup_voice_general, (self.log, ads[2]))]
10986        if not multithread_func(self.log, tasks):
10987            self.log.error("Phone Failed to Set Up Properly.")
10988            return False
10989
10990        return three_phone_call_waiting_short_seq(
10991            self.log,
10992            ads[0],
10993            None,
10994            None,
10995            ads[1],
10996            ads[2],
10997            call_waiting=True,
10998            scenario=6)
10999
11000    @TelephonyBaseTest.tel_test_wrap
11001    @test_tracker_info(uuid="c63882e5-5b72-4ca6-8e36-260c50f42028")
11002    def test_call_waiting_scenario_7(self):
11003        """ Call waiting scenario 7: 1st call ended by callee. 2nd call ended by
11004        caller2.
11005        """
11006        ads = self.android_devices
11007
11008        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
11009                 (phone_setup_voice_general, (self.log, ads[1])),
11010                 (phone_setup_voice_general, (self.log, ads[2]))]
11011        if not multithread_func(self.log, tasks):
11012            self.log.error("Phone Failed to Set Up Properly.")
11013            return False
11014
11015        return three_phone_call_waiting_short_seq(
11016            self.log,
11017            ads[0],
11018            None,
11019            None,
11020            ads[1],
11021            ads[2],
11022            call_waiting=True,
11023            scenario=7)
11024
11025    @TelephonyBaseTest.tel_test_wrap
11026    @test_tracker_info(uuid="f9be652f-a307-4fa5-9b30-ea78404110bd")
11027    def test_call_waiting_scenario_8(self):
11028        """Call waiting scenario 8: 1st call ended by callee. 2nd call ended by
11029        callee.
11030        """
11031        ads = self.android_devices
11032
11033        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
11034                 (phone_setup_voice_general, (self.log, ads[1])),
11035                 (phone_setup_voice_general, (self.log, ads[2]))]
11036        if not multithread_func(self.log, tasks):
11037            self.log.error("Phone Failed to Set Up Properly.")
11038            return False
11039
11040        return three_phone_call_waiting_short_seq(
11041            self.log,
11042            ads[0],
11043            None,
11044            None,
11045            ads[1],
11046            ads[2],
11047            call_waiting=True,
11048            scenario=8)
11049
11050    @TelephonyBaseTest.tel_test_wrap
11051    @test_tracker_info(uuid="b2e816b5-8e8f-4863-981c-47847d9527e0")
11052    def test_call_waiting_deactivated(self):
11053
11054        ads = self.android_devices
11055
11056        tasks = [(phone_setup_voice_general, (self.log, ads[0])),
11057                 (phone_setup_voice_general, (self.log, ads[1])),
11058                 (phone_setup_voice_general, (self.log, ads[2]))]
11059        if not multithread_func(self.log, tasks):
11060            self.log.error("Phone Failed to Set Up Properly.")
11061            return False
11062
11063        return three_phone_call_waiting_short_seq(
11064            self.log,
11065            ads[0],
11066            None,
11067            None,
11068            ads[1],
11069            ads[2],
11070            call_waiting=False)
11071
11072    """ Tests End """
11073