diff options
author | Markus Liu <markusliu@google.com> | 2020-08-17 15:55:28 +0800 |
---|---|---|
committer | Jaineel Mehta <jaineelm@google.com> | 2020-09-28 23:37:18 +0000 |
commit | 6b41e0931a6f051fb84cfb9a4710e5a8df678247 (patch) | |
tree | f936c6bee511379e59fa2285802b5fa5d77d5969 | |
parent | 9f55647931f5750b6f1095ed75eb4edbf929e484 (diff) | |
download | platform_tools_test_connectivity-6b41e0931a6f051fb84cfb9a4710e5a8df678247.tar.gz platform_tools_test_connectivity-6b41e0931a6f051fb84cfb9a4710e5a8df678247.tar.bz2 platform_tools_test_connectivity-6b41e0931a6f051fb84cfb9a4710e5a8df678247.zip |
New test class "TelLiveGFTDSDSDDSSwitchTest" with 99 test cases
A new test class "TelLiveGFTDSDSDDSSwitchTest" is
created with 99 new test cases to ensure all basic
telephony functions work well after DDS switch on
Pixel DSDS devices.
All 99 test cases are listed below:
test_dds_switch_when_volte_enabled
test_dds_switch_and_reboot_when_volte_enabled
test_dds_switch_when_volte_cycling_psim
test_dds_switch_when_volte_cycling_esim
test_dds_switch_youtube_volte
test_dds_switch_youtube_csfb
test_dds_switch_youtube_and_voice_call_mo_volte_psim
test_dds_switch_youtube_and_voice_call_mo_volte_esim
test_dds_switch_youtube_and_voice_call_mt_volte_psim
test_dds_switch_youtube_and_voice_call_mt_volte_esim
test_dds_switch_youtube_and_voice_call_mo_csfb_psim
test_dds_switch_youtube_and_voice_call_mo_csfb_esim
test_dds_switch_youtube_and_voice_call_mt_csfb_psim
test_dds_switch_youtube_and_voice_call_mt_csfb_esim
test_dds_switch_youtube_and_sms_volte
test_dds_switch_youtube_and_sms_mo_csfb_psim
test_dds_switch_youtube_and_sms_mo_csfb_esim
test_dds_switch_youtube_and_sms_mt_csfb_psim
test_dds_switch_youtube_and_sms_mt_csfb_esim
test_dds_switch_youtube_and_mms_volte
test_dds_switch_youtube_and_mms_csfb
test_dds_switch_voice_call_mo_volte_psim
test_dds_switch_voice_call_mo_volte_esim
test_dds_switch_voice_call_mt_volte_psim
test_dds_switch_voice_call_mt_volte_esim
test_dds_switch_sms_volte
test_dds_switch_mms_volte
test_dds_switch_voice_call_mo_volte_psim_with_wfc_on_apm_cycling
test_dds_switch_voice_call_mo_volte_esim_with_wfc_on_apm_cycling
test_dds_switch_voice_call_mt_volte_psim_with_wfc_on_apm_cycling
test_dds_switch_voice_call_mt_volte_esim_with_wfc_on_apm_cycling
test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_on_apm_cycling
test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_on_apm_cycling
test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_on_apm_cycling
test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_on_apm_cycling
test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_on_apm_cycling
test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_on_apm_cycling
test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_on_apm_cycling
test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_on_apm_cycling
test_dds_switch_voice_call_mo_volte_psim_with_wfc_on_cellular_data_cycling
test_dds_switch_voice_call_mo_volte_esim_with_wfc_on_cellular_data_cycling
test_dds_switch_voice_call_mt_volte_psim_with_wfc_on_cellular_data_cycling
test_dds_switch_voice_call_mt_volte_esim_with_wfc_on_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling
test_dds_switch_voice_call_mo_volte_psim_with_wfc_on_wifi_cycling
test_dds_switch_voice_call_mo_volte_esim_with_wfc_on_wifi_cycling
test_dds_switch_voice_call_mt_volte_psim_with_wfc_on_wifi_cycling
test_dds_switch_voice_call_mt_volte_esim_with_wfc_on_wifi_cycling
test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mt_psim_wfc_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mt_esim_wfc_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling
test_dds_switch_voice_call_mo_volte_psim_with_wfc_off_apm_cycling
test_dds_switch_voice_call_mo_volte_esim_with_wfc_off_apm_cycling
test_dds_switch_voice_call_mt_volte_psim_with_wfc_off_apm_cycling
test_dds_switch_voice_call_mt_volte_esim_with_wfc_off_apm_cycling
test_dds_switch_voice_call_mo_volte_psim_with_wfc_off_cellular_data_cycling
test_dds_switch_voice_call_mo_volte_esim_with_wfc_off_cellular_data_cycling
test_dds_switch_voice_call_mt_volte_psim_with_wfc_off_cellular_data_cycling
test_dds_switch_voice_call_mt_volte_esim_with_wfc_off_cellular_data_cycling
test_dds_switch_voice_call_mo_volte_psim_with_wfc_off_wifi_cycling
test_dds_switch_voice_call_mo_volte_esim_with_wfc_off_wifi_cycling
test_dds_switch_voice_call_mt_volte_psim_with_wfc_off_wifi_cycling
test_dds_switch_voice_call_mt_volte_esim_with_wfc_off_wifi_cycling
test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_off_apm_cycling
test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_off_apm_cycling
test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_off_apm_cycling
test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_off_apm_cycling
test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_off_apm_cycling
test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_off_apm_cycling
test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_off_apm_cycling
test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_off_apm_cycling
test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling
test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_off_wifi_cycling
test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_off_wifi_cycling
Test plan:
https://testtracker.googleplex.com/testplans/details/19258
Bug: None
Test: Yes, locally
Change-Id: Ie26e80d132b46661488459eefbfc56585e952fe2
-rw-r--r-- | acts/framework/acts/test_utils/tel/tel_data_utils.py | 108 | ||||
-rw-r--r-- | acts/framework/acts/test_utils/tel/tel_test_utils.py | 479 | ||||
-rw-r--r-- | acts/framework/acts/test_utils/tel/tel_voice_utils.py | 33 | ||||
-rw-r--r-- | acts_tests/tests/google/tel/live/TelLiveGFTDSDSDDSSwitchTest.py | 2175 |
4 files changed, 2671 insertions, 124 deletions
diff --git a/acts/framework/acts/test_utils/tel/tel_data_utils.py b/acts/framework/acts/test_utils/tel/tel_data_utils.py index 3dbe92d46d..3b6207eac6 100644 --- a/acts/framework/acts/test_utils/tel/tel_data_utils.py +++ b/acts/framework/acts/test_utils/tel/tel_data_utils.py @@ -22,11 +22,14 @@ from acts.utils import rand_ascii_str from acts.test_utils.tel.tel_subscription_utils import \ get_subid_from_slot_index from acts.test_utils.tel.tel_subscription_utils import set_subid_for_data +from acts.test_utils.tel.tel_subscription_utils import get_outgoing_message_sub_id +from acts.test_utils.tel.tel_subscription_utils import get_outgoing_voice_sub_id from acts.test_utils.tel.tel_defines import MAX_WAIT_TIME_NW_SELECTION from acts.test_utils.tel.tel_defines import NETWORK_SERVICE_DATA from acts.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING from acts.test_utils.tel.tel_defines import WAIT_TIME_BETWEEN_STATE_CHECK from acts.test_utils.tel.tel_defines import MAX_WAIT_TIME_FOR_STATE_CHANGE +from acts.test_utils.tel.tel_defines import WAIT_TIME_AFTER_REBOOT from acts.test_utils.tel.tel_subscription_utils import get_default_data_sub_id from acts.test_utils.tel.tel_test_utils import start_youtube_video from acts.test_utils.tel.tel_test_utils import start_wifi_tethering @@ -607,3 +610,108 @@ def browsing_test(log, ad, wifi_ssid=None, pass_threshold_in_mb = 1.0): usage = "unknown" ad.log.info("Usage of browsing: %s MB" % usage) return False + +def reboot_test(log, ad, wifi_ssid=None): + """ Reboot test to verify the service availability after reboot. + + Test procedure: + 1. Reboot + 2. Wait WAIT_TIME_AFTER_REBOOT for reboot complete. + 3. Check service state. False will be returned if service state is not "IN_SERVICE". + 4. Check if network is connected. False will be returned if not. + 5. Check if cellular data or Wi-Fi connection is available. False will be returned if not. + 6. Check if internet connection is available. False will be returned if not. + 7. Check if DSDS mode, data sub ID, voice sub ID and message sub ID still keep the same. + + Args: + log: log object. + ad: android object. + wifi_ssid: SSID of Wi-Fi AP for Wi-Fi connection. + + Returns: + True if pass; False if fail. + """ + try: + wifi_connected = False + if wifi_ssid and check_is_wifi_connected(ad.log, ad, wifi_ssid): + wifi_connected = True + + data_subid = get_default_data_sub_id(ad) + voice_subid = get_outgoing_voice_sub_id(ad) + sms_subid = get_outgoing_message_sub_id(ad) + + ad.reboot() + time.sleep(WAIT_TIME_AFTER_REBOOT) + + if not wait_for_state( + get_service_state_by_adb, + "IN_SERVICE", + MAX_WAIT_TIME_FOR_STATE_CHANGE, + WAIT_TIME_BETWEEN_STATE_CHECK, + log, + ad): + ad.log.error("Current service state: %s" % service_state) + return False + + if not ad.droid.connectivityNetworkIsConnected(): + ad.log.error("Network is NOT connected!") + return False + + if wifi_connected: + if not check_is_wifi_connected(ad.log, ad, wifi_ssid): + return False + else: + if not wait_for_cell_data_connection(log, ad, True): + ad.log.error("Failed to enable data connection.") + return False + + if not verify_internet_connection(log, ad): + ad.log.error("Internet connection is not available") + return False + + sim_mode = ad.droid.telephonyGetPhoneCount() + if hasattr(ad, "dsds"): + if sim_mode == 1: + ad.log.error("Phone is in single SIM mode after reboot.") + return False + elif sim_mode == 2: + ad.log.info("Phone keeps being in dual SIM mode after reboot.") + else: + if sim_mode == 1: + ad.log.info("Phone keeps being in single SIM mode after reboot.") + elif sim_mode == 2: + ad.log.error("Phone is in dual SIM mode after reboot.") + return False + + data_subid_after_reboot = get_default_data_sub_id(ad) + if data_subid_after_reboot != data_subid: + ad.log.error( + "Data sub ID changed! (Before reboot: %s; after reboot: %s)", + data_subid, data_subid_after_reboot) + return False + else: + ad.log.info("Data sub ID does not change after reboot.") + + voice_subid_after_reboot = get_outgoing_voice_sub_id(ad) + if voice_subid_after_reboot != voice_subid: + ad.log.error( + "Voice sub ID changed! (Before reboot: %s; after reboot: %s)", + voice_subid, voice_subid_after_reboot) + return False + else: + ad.log.info("Voice sub ID does not change after reboot.") + + sms_subid_after_reboot = get_outgoing_message_sub_id(ad) + if sms_subid_after_reboot != sms_subid: + ad.log.error( + "Message sub ID changed! (Before reboot: %s; after reboot: %s)", + sms_subid, sms_subid_after_reboot) + return False + else: + ad.log.info("Message sub ID does not change after reboot.") + + except Exception as e: + ad.log.error(e) + return False + + return True
\ No newline at end of file diff --git a/acts/framework/acts/test_utils/tel/tel_test_utils.py b/acts/framework/acts/test_utils/tel/tel_test_utils.py index d863c9c6d0..3783af200f 100644 --- a/acts/framework/acts/test_utils/tel/tel_test_utils.py +++ b/acts/framework/acts/test_utils/tel/tel_test_utils.py @@ -180,6 +180,7 @@ from acts.test_utils.tel.tel_subscription_utils import get_outgoing_voice_sub_id from acts.test_utils.tel.tel_subscription_utils import get_incoming_voice_sub_id from acts.test_utils.tel.tel_subscription_utils import get_incoming_message_sub_id from acts.test_utils.tel.tel_subscription_utils import set_subid_for_outgoing_call +from acts.test_utils.tel.tel_subscription_utils import set_incoming_voice_sub_id from acts.test_utils.tel.tel_subscription_utils import set_subid_for_message from acts.test_utils.tel.tel_subscription_utils import get_subid_on_same_network_of_host_ad from acts.test_utils.wifi import wifi_test_utils @@ -4945,16 +4946,25 @@ def show_enhanced_4g_lte(ad, sub_id): if capabilities: if "hide_enhanced_4g_lte" in capabilities: result = False - ad.log.info('"Enhanced 4G LTE MODE" is hidden for sub ID %s.', sub_id) - show_enhanced_4g_lte_mode = getattr(ad, "show_enhanced_4g_lte_mode", False) + ad.log.info( + '"Enhanced 4G LTE MODE" is hidden for sub ID %s.', sub_id) + show_enhanced_4g_lte_mode = getattr( + ad, "show_enhanced_4g_lte_mode", False) if show_enhanced_4g_lte_mode in ["true", "True"]: current_voice_sub_id = get_outgoing_voice_sub_id(ad) if sub_id != current_voice_sub_id: set_incoming_voice_sub_id(ad, sub_id) - ad.log.info('Show "Enhanced 4G LTE MODE" forcibly for sub ID %s.', sub_id) - ad.adb.shell("am broadcast -a com.google.android.carrier.action.LOCAL_OVERRIDE -n com.google.android.carrier/.ConfigOverridingReceiver --ez hide_enhanced_4g_lte_bool false") - ad.telephony["subscription"][sub_id]["capabilities"].remove("hide_enhanced_4g_lte") + ad.log.info( + 'Show "Enhanced 4G LTE MODE" forcibly for sub ID %s.', + sub_id) + ad.adb.shell( + "am broadcast \ + -a com.google.android.carrier.action.LOCAL_OVERRIDE \ + -n com.google.android.carrier/.ConfigOverridingReceiver \ + --ez hide_enhanced_4g_lte_bool false") + ad.telephony["subscription"][sub_id]["capabilities"].remove( + "hide_enhanced_4g_lte") if sub_id != current_voice_sub_id: set_incoming_voice_sub_id(ad, current_voice_sub_id) @@ -4965,11 +4975,13 @@ def show_enhanced_4g_lte(ad, sub_id): def toggle_volte(log, ad, new_state=None): """Toggle enable/disable VoLTE for default voice subscription. + Args: ad: Android device object. new_state: VoLTE mode state to set to. True for enable, False for disable. If None, opposite of the current state. + Raises: TelTestUtilsError if platform does not support VoLTE. """ @@ -4982,7 +4994,8 @@ def toggle_volte_for_subscription(log, ad, sub_id, new_state=None): Args: ad: Android device object. - sub_id: subscription ID + sub_id: Optional. If not assigned the default sub ID for voice call will + be used. new_state: VoLTE mode state to set to. True for enable, False for disable. If None, opposite of the current state. @@ -4991,19 +5004,74 @@ def toggle_volte_for_subscription(log, ad, sub_id, new_state=None): if not show_enhanced_4g_lte(ad, sub_id): return False - current_state = ad.droid.imsMmTelIsAdvancedCallingEnabled(sub_id) - if new_state is None: - new_state = not current_state - if new_state != current_state: - ad.log.info("Toggle Enhanced 4G LTE Mode from %s to %s on sub_id %s", current_state, - new_state, sub_id) - ad.droid.imsMmTelSetAdvancedCallingEnabled(sub_id, new_state) - check_state = ad.droid.imsMmTelIsAdvancedCallingEnabled(sub_id) - if check_state != new_state: - ad.log.error("Failed to toggle Enhanced 4G LTE Mode to %s, still set to %s on sub_id %s", - new_state, check_state, sub_id) - return False - return True + current_state = None + result = True + + if sub_id is None: + sub_id = ad.droid.subscriptionGetDefaultVoiceSubId() + + try: + current_state = ad.droid.imsMmTelIsAdvancedCallingEnabled(sub_id) + except Exception as e: + ad.log.warning(e) + + if current_state is not None: + if new_state is None: + new_state = not current_state + if new_state != current_state: + ad.log.info( + "Toggle Enhanced 4G LTE Mode from %s to %s on sub_id %s", + current_state, new_state, sub_id) + ad.droid.imsMmTelSetAdvancedCallingEnabled(sub_id, new_state) + check_state = ad.droid.imsMmTelIsAdvancedCallingEnabled(sub_id) + if check_state != new_state: + ad.log.error("Failed to toggle Enhanced 4G LTE Mode to %s, still \ + set to %s on sub_id %s", new_state, check_state, sub_id) + result = False + return result + else: + # TODO: b/26293960 No framework API available to set IMS by SubId. + voice_sub_id_changed = False + current_sub_id = get_incoming_voice_sub_id(ad) + if current_sub_id != sub_id: + set_incoming_voice_sub_id(ad, sub_id) + voice_sub_id_changed = True + + # b/139641554 + ad.terminate_all_sessions() + bring_up_sl4a(ad) + + if not ad.droid.imsIsEnhanced4gLteModeSettingEnabledByPlatform(): + ad.log.info( + "Enhanced 4G Lte Mode Setting is not enabled by platform for \ + sub ID %s.", sub_id) + return False + + current_state = ad.droid.imsIsEnhanced4gLteModeSettingEnabledByUser() + ad.log.info("Current state of Enhanced 4G Lte Mode Setting for sub \ + ID %s: %s", sub_id, current_state) + ad.log.info("New desired state of Enhanced 4G Lte Mode Setting for sub \ + ID %s: %s", sub_id, new_state) + + if new_state is None: + new_state = not current_state + if new_state != current_state: + ad.log.info( + "Toggle Enhanced 4G LTE Mode from %s to %s for sub ID %s.", + current_state, new_state, sub_id) + ad.droid.imsSetEnhanced4gMode(new_state) + time.sleep(5) + + check_state = ad.droid.imsIsEnhanced4gLteModeSettingEnabledByUser() + if check_state != new_state: + ad.log.error("Failed to toggle Enhanced 4G LTE Mode to %s, \ + still set to %s on sub_id %s", new_state, check_state, sub_id) + result = False + + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + + return result def toggle_wfc(log, ad, new_state=None): @@ -5012,43 +5080,124 @@ def toggle_wfc(log, ad, new_state=None): Args: log: Log object ad: Android device object. - new_state: True or False + new_state: WFC state to set to. + True for enable, False for disable. + If None, opposite of the current state. """ - if not ad.droid.imsIsWfcEnabledByPlatform(): - ad.log.info("WFC is not enabled by platform") - return False - current_state = ad.droid.imsIsWfcEnabledByUser() - if current_state is None: - new_state = not current_state - if new_state != current_state: - ad.log.info("Toggle WFC user enabled from %s to %s", current_state, - new_state) - ad.droid.imsSetWfcSetting(new_state) - return True + return toggle_wfc_for_subscription( + log, ad, new_state, get_outgoing_voice_sub_id(ad)) -def toggle_wfc_for_subscription(ad, new_state=None, sub_id=None): - """ Toggle WFC enable/disable +def toggle_wfc_for_subscription(log, ad, new_state=None, sub_id=None): + """ Toggle WFC enable/disable for specified voice subscription. Args: ad: Android device object. - sub_id: subscription Id - new_state: True or False + sub_id: Optional. If not assigned the default sub ID for voice call will + be used. + new_state: WFC state to set to. + True for enable, False for disable. + If None, opposite of the current state. """ + current_state = None + result = True + if sub_id is None: sub_id = ad.droid.subscriptionGetDefaultVoiceSubId() - current_state = ad.droid.imsMmTelIsVoWiFiSettingEnabled(sub_id) - if current_state is None: - new_state = not current_state - if new_state != current_state: - ad.log.info("SubId %s - Toggle WFC from %s to %s", sub_id, - current_state, new_state) - ad.droid.imsMmTelSetVoWiFiSettingEnabled(sub_id, new_state) + + try: + current_state = ad.droid.imsMmTelIsVoWiFiSettingEnabled(sub_id) + except Exception as e: + ad.log.warning(e) + + if current_state is not None: + if new_state is None: + new_state = not current_state + if new_state != current_state: + ad.log.info( + "Toggle Enhanced 4G LTE Mode from %s to %s on sub_id %s", + current_state, new_state, sub_id) + ad.droid.imsMmTelSetVoWiFiSettingEnabled(sub_id, new_state) + check_state = ad.droid.imsMmTelIsVoWiFiSettingEnabled(sub_id) + if check_state != new_state: + ad.log.error("Failed to toggle Enhanced 4G LTE Mode to %s, \ + still set to %s on sub_id %s", new_state, check_state, sub_id) + result = False + return result + else: + voice_sub_id_changed = False + if not sub_id: + sub_id = get_outgoing_voice_sub_id(ad) + else: + current_sub_id = get_incoming_voice_sub_id(ad) + if current_sub_id != sub_id: + set_incoming_voice_sub_id(ad, sub_id) + voice_sub_id_changed = True + + # b/139641554 + ad.terminate_all_sessions() + bring_up_sl4a(ad) + + if not ad.droid.imsIsWfcEnabledByPlatform(): + ad.log.info("WFC is not enabled by platform for sub ID %s.", sub_id) + return False + + current_state = ad.droid.imsIsWfcEnabledByUser() + ad.log.info("Current state of WFC Setting for sub ID %s: %s", + sub_id, current_state) + ad.log.info("New desired state of WFC Setting for sub ID %s: %s", + sub_id, new_state) + + if new_state is None: + new_state = not current_state + if new_state != current_state: + ad.log.info("Toggle WFC user enabled from %s to %s for sub ID %s", + current_state, new_state, sub_id) + ad.droid.imsSetWfcSetting(new_state) + + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + + return True + +def is_enhanced_4g_lte_mode_setting_enabled(ad, sub_id, enabled_by="platform"): + voice_sub_id_changed = False + current_sub_id = get_incoming_voice_sub_id(ad) + if current_sub_id != sub_id: + set_incoming_voice_sub_id(ad, sub_id) + voice_sub_id_changed = True + if enabled_by == "platform": + res = ad.droid.imsIsEnhanced4gLteModeSettingEnabledByPlatform() + else: + res = ad.droid.imsIsEnhanced4gLteModeSettingEnabledByUser() + if not res: + ad.log.info("Enhanced 4G Lte Mode Setting is NOT enabled by %s for sub \ + ID %s.", enabled_by, sub_id) + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + return False + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + ad.log.info("Enhanced 4G Lte Mode Setting is enabled by %s for sub ID %s.", + enabled_by, sub_id) return True +def set_enhanced_4g_mode(ad, sub_id, state): + voice_sub_id_changed = False + current_sub_id = get_incoming_voice_sub_id(ad) + if current_sub_id != sub_id: + set_incoming_voice_sub_id(ad, sub_id) + voice_sub_id_changed = True + + ad.droid.imsSetEnhanced4gMode(state) + time.sleep(5) + + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) def wait_for_enhanced_4g_lte_setting(log, ad, + sub_id, max_time=MAX_WAIT_TIME_FOR_STATE_CHANGE): """Wait for android device to enable enhance 4G LTE setting. @@ -5062,9 +5211,13 @@ def wait_for_enhanced_4g_lte_setting(log, Return False if timeout. """ return wait_for_state( - ad.droid.imsIsEnhanced4gLteModeSettingEnabledByPlatform, + is_enhanced_4g_lte_mode_setting_enabled, True, - max_wait_time=max_time) + max_time, + WAIT_TIME_BETWEEN_STATE_CHECK, + ad, + sub_id, + enabled_by="platform") def set_wfc_mode(log, ad, wfc_mode): @@ -5080,29 +5233,8 @@ def set_wfc_mode(log, ad, wfc_mode): Returns: True if success. False if ad does not support WFC or error happened. """ - if wfc_mode != WFC_MODE_DISABLED and wfc_mode not in ad.telephony[ - "subscription"][get_outgoing_voice_sub_id(ad)].get("wfc_modes", []): - ad.log.error("WFC mode %s is not supported", wfc_mode) - raise signals.TestSkip("WFC mode %s is not supported" % wfc_mode) - try: - ad.log.info("Set wfc mode to %s", wfc_mode) - if wfc_mode != WFC_MODE_DISABLED: - start_adb_tcpdump(ad, interface="wlan0", mask="all") - if not ad.droid.imsIsWfcEnabledByPlatform(): - if wfc_mode == WFC_MODE_DISABLED: - return True - else: - ad.log.error("WFC not supported by platform.") - return False - ad.droid.imsSetWfcMode(wfc_mode) - mode = ad.droid.imsGetWfcMode() - if mode != wfc_mode: - ad.log.error("WFC mode is %s, not in %s", mode, wfc_mode) - return False - except Exception as e: - log.error(e) - return False - return True + return set_wfc_mode_for_subscription( + ad, wfc_mode, get_outgoing_voice_sub_id(ad)) def set_wfc_mode_for_subscription(ad, wfc_mode, sub_id=None): @@ -5118,22 +5250,97 @@ def set_wfc_mode_for_subscription(ad, wfc_mode, sub_id=None): Returns: True if success. False if ad does not support WFC or error happened. """ + if wfc_mode not in [ + WFC_MODE_WIFI_ONLY, + WFC_MODE_CELLULAR_PREFERRED, + WFC_MODE_WIFI_PREFERRED, + WFC_MODE_DISABLED]: + + ad.log.error("Given WFC mode (%s) is not correct.", wfc_mode) + return False + + current_mode = None + result = True + + if sub_id is None: + sub_id = ad.droid.subscriptionGetDefaultVoiceSubId() + try: - if sub_id is None: - sub_id = ad.droid.subscriptionGetDefaultVoiceSubId() - if not ad.droid.imsMmTelIsVoWiFiSettingEnabled(sub_id): - ad.log.info("SubId %s - Enabling WiFi Calling", sub_id) - ad.droid.imsMmTelSetVoWiFiSettingEnabled(sub_id, True) - ad.log.info("SubId %s - setwfcmode to %s", sub_id, wfc_mode) - ad.droid.imsMmTelSetVoWiFiModeSetting(sub_id, wfc_mode) - mode = ad.droid.imsMmTelGetVoWiFiModeSetting(sub_id) - if mode != wfc_mode: - ad.log.error("SubId %s - getwfcmode shows %s", sub_id, mode) - return False + current_mode = ad.droid.imsMmTelGetVoWiFiModeSetting(sub_id) + ad.log.info("Current WFC mode of sub ID: %s", current_mode) except Exception as e: - ad.log.error(e) - return False - return True + ad.log.warning(e) + + if current_mode is not None: + try: + if not ad.droid.imsMmTelIsVoWiFiSettingEnabled(sub_id): + if wfc_mode is WFC_MODE_DISABLED: + return True + ad.log.info( + "WFC is disabled for sub ID %s. Enabling WFC...", sub_id) + ad.droid.imsMmTelSetVoWiFiSettingEnabled(sub_id, True) + + if wfc_mode is WFC_MODE_DISABLED: + ad.droid.imsMmTelSetVoWiFiSettingEnabled(sub_id, False) + return True + + ad.log.info("Set wfc mode to %s for sub ID %s.", wfc_mode, sub_id) + ad.droid.imsMmTelSetVoWiFiModeSetting(sub_id, wfc_mode) + mode = ad.droid.imsMmTelGetVoWiFiModeSetting(sub_id) + if mode != wfc_mode: + ad.log.error("WFC mode for sub ID %s is %s, not in %s", + sub_id, mode, wfc_mode) + return False + except Exception as e: + ad.log.error(e) + return False + return True + else: + voice_sub_id_changed = False + if not sub_id: + sub_id = get_outgoing_voice_sub_id(ad) + else: + current_sub_id = get_incoming_voice_sub_id(ad) + if current_sub_id != sub_id: + set_incoming_voice_sub_id(ad, sub_id) + voice_sub_id_changed = True + + # b/139641554 + ad.terminate_all_sessions() + bring_up_sl4a(ad) + + if wfc_mode != WFC_MODE_DISABLED and wfc_mode not in ad.telephony[ + "subscription"][get_outgoing_voice_sub_id(ad)].get("wfc_modes", []): + ad.log.error("WFC mode %s is not supported", wfc_mode) + raise signals.TestSkip("WFC mode %s is not supported" % wfc_mode) + try: + ad.log.info("Set wfc mode to %s", wfc_mode) + if wfc_mode != WFC_MODE_DISABLED: + start_adb_tcpdump(ad, interface="wlan0", mask="all") + if not ad.droid.imsIsWfcEnabledByPlatform(): + if wfc_mode == WFC_MODE_DISABLED: + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + return True + else: + ad.log.error("WFC not supported by platform.") + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + return False + ad.droid.imsSetWfcMode(wfc_mode) + mode = ad.droid.imsGetWfcMode() + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + if mode != wfc_mode: + ad.log.error("WFC mode is %s, not in %s", mode, wfc_mode) + return False + except Exception as e: + log.error(e) + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + return False + return True + def set_ims_provisioning_for_subscription(ad, feature_flag, value, sub_id=None): @@ -5564,18 +5771,24 @@ def wait_for_data_attach_for_subscription(log, ad, sub_id, max_time): NETWORK_SERVICE_DATA) -def is_ims_registered(log, ad): +def is_ims_registered(log, ad, sub_id=None): """Return True if IMS registered. Args: log: log object. ad: android device. + sub_id: Optional. If not assigned the default sub ID of voice call will + be used. Returns: Return True if IMS registered. Return False if IMS not registered. """ - return ad.droid.telephonyIsImsRegistered() + if not sub_id: + return ad.droid.telephonyIsImsRegistered() + else: + return change_voice_subid_temporarily( + ad, sub_id, ad.droid.telephonyIsImsRegistered) def wait_for_ims_registered(log, ad, max_time=MAX_WAIT_TIME_WFC_ENABLED): @@ -5592,26 +5805,48 @@ def wait_for_ims_registered(log, ad, max_time=MAX_WAIT_TIME_WFC_ENABLED): """ return _wait_for_droid_in_state(log, ad, max_time, is_ims_registered) +def is_volte_available(log, ad, sub_id): + """Return True if VoLTE is available. + + Args: + log: log object. + ad: android device. + sub_id: Optional. If not assigned the default sub ID of voice call will + be used. + + Returns: + Return True if VoLTE is available. + Return False if VoLTE is not available. + """ + if not sub_id: + return ad.droid.telephonyIsVolteAvailable() + else: + return change_voice_subid_temporarily( + ad, sub_id, ad.droid.telephonyIsVolteAvailable) -def is_volte_enabled(log, ad): +def is_volte_enabled(log, ad, sub_id=None): """Return True if VoLTE feature bit is True. Args: log: log object. ad: android device. + sub_id: Optional. If not assigned the default sub ID of voice call will + be used. Returns: Return True if VoLTE feature bit is True and IMS registered. Return False if VoLTE feature bit is False or IMS not registered. """ - if not is_ims_registered(log, ad): - ad.log.info("IMS is not registered.") + if not is_ims_registered(log, ad, sub_id): + ad.log.info("IMS is not registered for sub ID %s.", sub_id) return False - if not ad.droid.telephonyIsVolteAvailable(): - ad.log.info("IMS is registered, IsVolteCallingAvailble is False") + if not is_volte_available(log, ad, sub_id): + ad.log.info("IMS is registered for sub ID %s, IsVolteCallingAvailable \ + is False", sub_id) return False else: - ad.log.info("IMS is registered, IsVolteCallingAvailble is True") + ad.log.info("IMS is registered for sub ID %s, IsVolteCallingAvailable \ + is True", sub_id) return True @@ -5634,7 +5869,8 @@ def is_video_enabled(log, ad): return video_status -def wait_for_volte_enabled(log, ad, max_time=MAX_WAIT_TIME_VOLTE_ENABLED): +def wait_for_volte_enabled( + log, ad, max_time=MAX_WAIT_TIME_VOLTE_ENABLED,sub_id=None): """Wait for android device to report VoLTE enabled bit true. Args: @@ -5646,7 +5882,11 @@ def wait_for_volte_enabled(log, ad, max_time=MAX_WAIT_TIME_VOLTE_ENABLED): Return True if device report VoLTE enabled bit true within max_time. Return False if timeout. """ - return _wait_for_droid_in_state(log, ad, max_time, is_volte_enabled) + if not sub_id: + return _wait_for_droid_in_state(log, ad, max_time, is_volte_enabled) + else: + return _wait_for_droid_in_state_for_subscription( + log, ad, sub_id, max_time, is_volte_enabled) def wait_for_video_enabled(log, ad, max_time=MAX_WAIT_TIME_VOLTE_ENABLED): @@ -5679,10 +5919,10 @@ def is_wfc_enabled(log, ad): ad.log.info("IMS is not registered.") return False if not ad.droid.telephonyIsWifiCallingAvailable(): - ad.log.info("IMS is registered, IsWifiCallingAvailble is False") + ad.log.info("IMS is registered, IsWifiCallingAvailable is False") return False else: - ad.log.info("IMS is registered, IsWifiCallingAvailble is True") + ad.log.info("IMS is registered, IsWifiCallingAvailable is True") return True @@ -6355,7 +6595,7 @@ def mms_receive_verify_after_call_hangup_for_subscription( if not wait_for_matching_mms(log, ad_rx, phonenumber_tx, message): return False finally: - ad_rx.droid.smsStopTrackingIncomingMmsMessage() + ad_rx.messaging_droid.smsStopTrackingIncomingMmsMessage() return True @@ -10314,44 +10554,59 @@ def wait_for_matching_multiple_sms(log, return True -def is_sms_in_collision_match(event, phonenumber_tx, phonenumber_tx2, text, text2): +def is_sms_in_collision_match( + event, phonenumber_tx, phonenumber_tx2, text, text2): event_text = event['data']['Text'].strip() if event_text.startswith("("): event_text = event_text.split(")")[-1] for phonenumber, txt in [[phonenumber_tx, text], [phonenumber_tx2, text2]]: - if check_phone_number_match(event['data']['Sender'], phonenumber) and txt.startswith(event_text): + if check_phone_number_match( + event['data']['Sender'], phonenumber) and txt.startswith(event_text): return True return False -def is_sms_in_collision_partial_match(event, phonenumber_tx, phonenumber_tx2, text, text2): +def is_sms_in_collision_partial_match( + event, phonenumber_tx, phonenumber_tx2, text, text2): for phonenumber, txt in [[phonenumber_tx, text], [phonenumber_tx2, text2]]: - if check_phone_number_match(event['data']['Sender'], phonenumber) and event['data']['Text'].strip() == txt: + if check_phone_number_match( + event['data']['Sender'], phonenumber) and \ + event['data']['Text'].strip() == txt: return True return False -def is_sms_match_among_multiple_sms(event, phonenumber_tx, phonenumber_tx2, texts=[], texts2=[]): +def is_sms_match_among_multiple_sms( + event, phonenumber_tx, phonenumber_tx2, texts=[], texts2=[]): for txt in texts: - if check_phone_number_match(event['data']['Sender'], phonenumber_tx) and event['data']['Text'].strip() == txt: + if check_phone_number_match( + event['data']['Sender'], phonenumber_tx) and \ + event['data']['Text'].strip() == txt: return True for txt in texts2: - if check_phone_number_match(event['data']['Sender'], phonenumber_tx2) and event['data']['Text'].strip() == txt: + if check_phone_number_match( + event['data']['Sender'], phonenumber_tx2) and \ + event['data']['Text'].strip() == txt: return True return False -def is_sms_partial_match_among_multiple_sms(event, phonenumber_tx, phonenumber_tx2, texts=[], texts2=[]): +def is_sms_partial_match_among_multiple_sms( + event, phonenumber_tx, phonenumber_tx2, texts=[], texts2=[]): event_text = event['data']['Text'].strip() if event_text.startswith("("): event_text = event_text.split(")")[-1] for txt in texts: - if check_phone_number_match(event['data']['Sender'], phonenumber_tx) and txt.startswith(event_text): + if check_phone_number_match( + event['data']['Sender'], phonenumber_tx) and \ + txt.startswith(event_text): return True for txt in texts2: - if check_phone_number_match(event['data']['Sender'], phonenumber_tx2) and txt.startswith(event_text): + if check_phone_number_match( + event['data']['Sender'], phonenumber_tx2) and \ + txt.startswith(event_text): return True return False @@ -10390,3 +10645,19 @@ def datetime_handle(ad, action, set_datetime_value='', get_year=False): ad.adb.shell('am broadcast -a android.intent.action.TIME_SET') return get_value + +def change_voice_subid_temporarily(ad, sub_id, state_check_func): + result = False + voice_sub_id_changed = False + current_sub_id = get_incoming_voice_sub_id(ad) + if current_sub_id != sub_id: + set_incoming_voice_sub_id(ad, sub_id) + voice_sub_id_changed = True + + if state_check_func(): + result = True + + if voice_sub_id_changed: + set_incoming_voice_sub_id(ad, current_sub_id) + + return result
\ No newline at end of file diff --git a/acts/framework/acts/test_utils/tel/tel_voice_utils.py b/acts/framework/acts/test_utils/tel/tel_voice_utils.py index 4294bf3ea6..1c41658fa5 100644 --- a/acts/framework/acts/test_utils/tel/tel_voice_utils.py +++ b/acts/framework/acts/test_utils/tel/tel_voice_utils.py @@ -765,7 +765,6 @@ def phone_setup_iwlan(log, Make sure phone connect to WiFi. (If wifi_ssid is not None.) Wait for phone to be in iwlan data network type. Wait for phone to report wfc enabled flag to be true. - Args: log: Log object. ad: Android device object. @@ -774,14 +773,9 @@ def phone_setup_iwlan(log, wifi_ssid: WiFi network SSID. This is optional. If wifi_ssid is None, then phone_setup_iwlan will not attempt to connect to wifi. wifi_pwd: WiFi network password. This is optional. - Returns: True if success. False if fail. """ - if not get_capability_for_subscription(ad, CAPABILITY_WFC, - get_outgoing_voice_sub_id(ad)): - ad.log.error("WFC is not supported, abort test.") - raise signals.TestSkip("WFC is not supported, abort test.") return phone_setup_iwlan_for_subscription(log, ad, get_outgoing_voice_sub_id(ad), is_airplane_mode, wfc_mode, @@ -801,7 +795,6 @@ def phone_setup_iwlan_for_subscription(log, Make sure phone connect to WiFi. (If wifi_ssid is not None.) Wait for phone to be in iwlan data network type. Wait for phone to report wfc enabled flag to be true. - Args: log: Log object. ad: Android device object. @@ -811,19 +804,19 @@ def phone_setup_iwlan_for_subscription(log, wifi_ssid: WiFi network SSID. This is optional. If wifi_ssid is None, then phone_setup_iwlan will not attempt to connect to wifi. wifi_pwd: WiFi network password. This is optional. - Returns: True if success. False if fail. """ + if not get_capability_for_subscription(ad, CAPABILITY_WFC, sub_id): + ad.log.error("WFC is not supported, abort test.") + raise signals.TestSkip("WFC is not supported, abort test.") toggle_airplane_mode(log, ad, is_airplane_mode, strict_checking=False) - # check if WFC supported phones if wfc_mode != WFC_MODE_DISABLED and not ad.droid.imsIsWfcEnabledByPlatform( ): ad.log.error("WFC is not enabled on this device by checking " "ImsManager.isWfcEnabledByPlatform") return False - if wifi_ssid is not None: if not ensure_wifi_connected(log, ad, wifi_ssid, wifi_pwd, apm=is_airplane_mode): ad.log.error("Fail to bring up WiFi connection on %s.", wifi_ssid) @@ -832,11 +825,9 @@ def phone_setup_iwlan_for_subscription(log, ad.log.info("WiFi network SSID not specified, available user " "parameters are: wifi_network_ssid, wifi_network_ssid_2g, " "wifi_network_ssid_5g") - if not set_wfc_mode(log, ad, wfc_mode): ad.log.error("Unable to set WFC mode to %s.", wfc_mode) return False - if not wait_for_wfc_enabled(log, ad, max_time=MAX_WAIT_TIME_WFC_ENABLED): ad.log.error("WFC is not enabled") return False @@ -1077,8 +1068,9 @@ def phone_setup_csfb_for_subscription(log, ad, sub_id): if not phone_setup_4g_for_subscription(log, ad, sub_id): ad.log.error("Failed to set to 4G data.") return False - if ad.droid.imsIsEnhanced4gLteModeSettingEnabledByPlatform(): - toggle_volte(log, ad, False) + + toggle_volte(log, ad, False) + if not ensure_network_generation_for_subscription( log, ad, sub_id, GEN_4G, voice_or_data=NETWORK_SERVICE_DATA): return False @@ -1111,20 +1103,22 @@ def phone_setup_volte(log, ad): def phone_setup_volte_for_subscription(log, ad, sub_id): """Setup VoLTE enable for subscription id. - Args: log: log object ad: android device object. sub_id: subscription id. - Returns: True: if VoLTE is enabled successfully. False: for errors """ + if not get_capability_for_subscription(ad, CAPABILITY_VOLTE, + get_outgoing_voice_sub_id(ad)): + ad.log.error("VoLTE is not supported, abort test.") + raise signals.TestSkip("VoLTE is not supported, abort test.") if not phone_setup_4g_for_subscription(log, ad, sub_id): ad.log.error("Failed to set to 4G data.") return False - if not wait_for_enhanced_4g_lte_setting(log, ad): + if not wait_for_enhanced_4g_lte_setting(log, ad, sub_id): ad.log.error("Enhanced 4G LTE setting is not available") return False toggle_volte_for_subscription(log, ad, sub_id, True) @@ -1361,7 +1355,6 @@ def phone_idle_volte(log, ad): def phone_idle_volte_for_subscription(log, ad, sub_id): """Return if phone is idle for VoLTE call test for subscription id. - Args: ad: Android device object. sub_id: subscription id. @@ -1371,7 +1364,7 @@ def phone_idle_volte_for_subscription(log, ad, sub_id): voice_or_data=NETWORK_SERVICE_VOICE): ad.log.error("Voice rat not in LTE mode.") return False - if not wait_for_volte_enabled(log, ad, MAX_WAIT_TIME_VOLTE_ENABLED): + if not wait_for_volte_enabled(log, ad, MAX_WAIT_TIME_VOLTE_ENABLED, sub_id): ad.log.error( "Failed to <report volte enabled true> within %s seconds.", MAX_WAIT_TIME_VOLTE_ENABLED) @@ -1699,7 +1692,7 @@ def is_phone_in_call_iwlan(log, ad, call_id=None): ad.log.info("IMS is not registered.") return False if not ad.droid.telephonyIsWifiCallingAvailable(): - ad.log.info("IsWifiCallingAvailble is False") + ad.log.info("IsWifiCallingAvailable is False") return False if not call_id: call_ids = ad.droid.telecomCallGetCallIds() diff --git a/acts_tests/tests/google/tel/live/TelLiveGFTDSDSDDSSwitchTest.py b/acts_tests/tests/google/tel/live/TelLiveGFTDSDSDDSSwitchTest.py new file mode 100644 index 0000000000..206874e73e --- /dev/null +++ b/acts_tests/tests/google/tel/live/TelLiveGFTDSDSDDSSwitchTest.py @@ -0,0 +1,2175 @@ +#!/usr/bin/env python3 +# +# Copyright 2020 - Google +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re +import time + +from acts import asserts +from acts import signals +from acts.test_decorators import test_tracker_info +from acts.test_utils.tel.loggers.protos.telephony_metric_pb2 import \ + TelephonyVoiceTestResult +from acts.test_utils.tel.loggers.telephony_metric_logger import \ + TelephonyMetricLogger +from acts.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest +from acts.test_utils.tel.tel_defines import MAX_WAIT_TIME_SMS_RECEIVE +from acts.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL +from acts.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING +from acts.test_utils.tel.tel_defines import INVALID_SUB_ID +from acts.test_utils.tel.tel_defines import WFC_MODE_DISABLED +from acts.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED +from acts.test_utils.tel.tel_defines import WFC_MODE_WIFI_ONLY +from acts.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED +from acts.test_utils.tel.tel_data_utils import reboot_test +from acts.test_utils.tel.tel_subscription_utils import get_subid_from_slot_index +from acts.test_utils.tel.tel_subscription_utils import get_default_data_sub_id +from acts.test_utils.tel.tel_subscription_utils import set_subid_for_message +from acts.test_utils.tel.tel_subscription_utils import set_subid_for_data +from acts.test_utils.tel.tel_subscription_utils import set_incoming_voice_sub_id +from acts.test_utils.tel.tel_subscription_utils import set_dds_on_slot_0 +from acts.test_utils.tel.tel_subscription_utils import set_dds_on_slot_1 +from acts.test_utils.tel.tel_subscription_utils import \ + get_subid_on_same_network_of_host_ad +from acts.test_utils.tel.tel_test_utils import multithread_func +from acts.test_utils.tel.tel_test_utils import start_youtube_video +from acts.test_utils.tel.tel_test_utils import \ + wait_for_cell_data_connection_for_subscription +from acts.test_utils.tel.tel_test_utils import toggle_volte_for_subscription +from acts.test_utils.tel.tel_test_utils import toggle_wfc_for_subscription +from acts.test_utils.tel.tel_test_utils import set_wfc_mode_for_subscription +from acts.test_utils.tel.tel_test_utils import \ + sms_send_receive_verify_for_subscription +from acts.test_utils.tel.tel_test_utils import mms_send_receive_verify +from acts.test_utils.tel.tel_test_utils import verify_http_connection +from acts.test_utils.tel.tel_test_utils import verify_internet_connection +from acts.test_utils.tel.tel_test_utils import log_messaging_screen_shot +from acts.test_utils.tel.tel_test_utils import ensure_phones_idle +from acts.test_utils.tel.tel_test_utils import get_slot_index_from_subid +from acts.test_utils.tel.tel_test_utils import toggle_airplane_mode +from acts.test_utils.tel.tel_test_utils import is_volte_enabled +from acts.test_utils.tel.tel_test_utils import check_is_wifi_connected +from acts.test_utils.tel.tel_test_utils import ensure_wifi_connected +from acts.test_utils.tel.tel_test_utils import wait_for_wfc_enabled +from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_3g +from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb +from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_volte +from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_iwlan +from acts.test_utils.tel.tel_voice_utils import phone_setup_iwlan_for_subscription +from acts.test_utils.tel.tel_voice_utils import \ + phone_setup_csfb_for_subscription +from acts.test_utils.tel.tel_voice_utils import \ + phone_setup_voice_3g_for_subscription +from acts.test_utils.tel.tel_voice_utils import \ + phone_setup_voice_general_for_subscription +from acts.test_utils.tel.tel_voice_utils import \ + phone_setup_volte_for_subscription +from acts.test_utils.tel.tel_voice_utils import two_phone_call_msim_for_slot +from acts.utils import rand_ascii_str + +CallResult = TelephonyVoiceTestResult.CallResult.Value + +class TelLiveGFTDSDSDDSSwitchTest(TelephonyBaseTest): + def setup_class(self): + TelephonyBaseTest.setup_class(self) + self.message_lengths = (50, 160, 180) + self.tel_logger = TelephonyMetricLogger.for_test_case() + + def teardown_test(self): + ensure_phones_idle(self.log, self.android_devices) + + def _msim_message_test( + self, + ad_mo, + ad_mt, + mo_sub_id, + mt_sub_id, msg="SMS", + max_wait_time=MAX_WAIT_TIME_SMS_RECEIVE, + expected_result=True): + """Make MO/MT SMS/MMS at specific slot. + + Args: + ad_mo: Android object of the device sending SMS/MMS + ad_mt: Android object of the device receiving SMS/MMS + mo_sub_id: Sub ID of MO device + mt_sub_id: Sub ID of MT device + max_wait_time: Max wait time before SMS/MMS is received. + expected_result: True for successful sending/receiving and False on + the contrary + + Returns: + True if the result matches expected_result and False on the + contrary. + """ + + if msg == "SMS": + for length in self.message_lengths: + message_array = [rand_ascii_str(length)] + if not sms_send_receive_verify_for_subscription( + self.log, + ad_mo, + ad_mt, + mo_sub_id, + mt_sub_id, + message_array, + max_wait_time): + ad_mo.log.warning( + "%s of length %s test failed", msg, length) + return False + else: + ad_mo.log.info( + "%s of length %s test succeeded", msg, length) + self.log.info("%s test of length %s characters succeeded.", + msg, self.message_lengths) + + elif msg == "MMS": + for length in self.message_lengths: + message_array = [("Test Message", rand_ascii_str(length), None)] + + if not mms_send_receive_verify( + self.log, + ad_mo, + ad_mt, + message_array, + max_wait_time, + expected_result): + self.log.warning("%s of body length %s test failed", + msg, length) + return False + else: + self.log.info( + "%s of body length %s test succeeded", msg, length) + self.log.info("%s test of body lengths %s succeeded", + msg, self.message_lengths) + return True + + def _test_dds_switch_during_data_transfer( + self, + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction=None, + call_or_sms_or_mms="call", + streaming=True, + is_airplane_mode=False, + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]): + """Switch DDS and make voice call (VoLTE/WFC/CS call)/SMS/MMS together + with Youtube playing after each DDS switch at specific slot in specific + RAT. + + Test step: + 1. Get sub ID of each slot of the primary device. + 2. Set up phones in desired RAT. + 3. Switch DDS to slot 0. + 4. Check HTTP connection after DDS switch. + 5. Play Youtube. + 6. Make voice call (VoLTE/WFC/CS call)/SMS/MMS + 7. Switch DDS to slot 1 and repeat step 4-6. + 8. Switch DDS to slot 0 again and repeat step 4-6. + + Args: + 1, slot_0_nw_gen: Network generation of slot 0 on the primary device + 2, slot_1_nw_gen: Network generation of slot 1 on the primary device + 3. call_slot: Slot for making voice call + 4. call_direction: "mo" or "mt" or None to stoping making call. + 5. call_or_sms_or_mms: Voice call or SMS or MMS + 6. streaming: True for playing Youtube after DDS switch and False on + the contrary. + 7. is_airplane_mode: True of False for WFC setup + 8. wfc_mode: Cellular preferred or Wi-Fi preferred. + + Returns: + True or False + """ + ad = self.android_devices[0] + slot_0_subid = get_subid_from_slot_index(self.log, ad, 0) + slot_1_subid = get_subid_from_slot_index(self.log, ad, 1) + + if slot_0_subid == INVALID_SUB_ID or slot_1_subid == INVALID_SUB_ID: + ad.log.error("Not all slots have valid sub ID.") + raise signals.TestFailure("Failed", + extras={"fail_reason": "Not all slots have valid sub ID"}) + + ad.log.info( + "Step 0: Set up phone in desired RAT (slot 0: %s, slot 1: %s)", + slot_0_nw_gen, slot_1_nw_gen) + if slot_0_nw_gen == "volte": + slot0_phone_setup_func = phone_setup_volte_for_subscription + is_slot0_in_call = is_phone_in_call_volte + elif slot_0_nw_gen == "csfb": + slot0_phone_setup_func = phone_setup_csfb_for_subscription + is_slot0_in_call = is_phone_in_call_csfb + elif slot_0_nw_gen == "3g": + slot0_phone_setup_func = phone_setup_voice_3g_for_subscription + is_slot0_in_call = is_phone_in_call_3g + elif slot_0_nw_gen == "wfc": + slot0_phone_setup_func = phone_setup_iwlan_for_subscription + is_slot0_in_call = is_phone_in_call_iwlan + else: + slot0_phone_setup_func = phone_setup_voice_general_for_subscription + is_slot0_in_call = None + + if slot_0_nw_gen == "wfc": + tasks = [(slot0_phone_setup_func,( + self.log, + ad, + slot_0_subid, + is_airplane_mode, + wfc_mode[0], + self.wifi_network_ssid, + self.wifi_network_pass))] + else: + tasks = [(slot0_phone_setup_func, (self.log, ad, slot_0_subid))] + if not multithread_func(self.log, tasks): + self.log.error("Phone Failed to Set Up Properly.") + self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE")) + raise signals.TestFailure("Failed", + extras={"fail_reason": "Phone Failed to Set Up Properly."}) + + if slot_1_nw_gen == "volte": + slot1_phone_setup_func = phone_setup_volte_for_subscription + is_slot1_in_call = is_phone_in_call_volte + elif slot_1_nw_gen == "csfb": + slot1_phone_setup_func = phone_setup_csfb_for_subscription + is_slot1_in_call = is_phone_in_call_csfb + elif slot_1_nw_gen == "3g": + slot1_phone_setup_func = phone_setup_voice_3g_for_subscription + is_slot1_in_call = is_phone_in_call_3g + elif slot_1_nw_gen == "wfc": + slot1_phone_setup_func = phone_setup_iwlan_for_subscription + is_slot1_in_call = is_phone_in_call_iwlan + else: + slot1_phone_setup_func = phone_setup_voice_general_for_subscription + is_slot1_in_call = None + + if slot_1_nw_gen == "wfc": + tasks = [(slot1_phone_setup_func, ( + self.log, + ad, + slot_1_subid, + is_airplane_mode, + wfc_mode[1], + self.wifi_network_ssid, + self.wifi_network_pass))] + else: + tasks = [(slot1_phone_setup_func, (self.log, ad, slot_1_subid))] + if not multithread_func(self.log, tasks): + self.log.error("Phone Failed to Set Up Properly.") + self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE")) + raise signals.TestFailure("Failed", + extras={"fail_reason": "Phone Failed to Set Up Properly."}) + + for attempt in range(3): + if attempt is not 0: + ad.log.info("Repeat step 1 to 4.") + + ad.log.info("Step 1: Switch DDS.") + if attempt % 2 == 0: + set_dds_on_slot_0(ad) + else: + set_dds_on_slot_1(ad) + + ad.log.info("Step 2: Check HTTP connection after DDS switch.") + if not verify_http_connection(self.log, ad): + ad.log.error("Failed to verify http connection.") + return False + else: + ad.log.info("Verify http connection successfully.") + + if streaming: + ad.log.info("Step 3: Start Youtube streaming.") + if not start_youtube_video(ad): + ad.log.warning("Fail to bring up youtube video") + time.sleep(10) + else: + ad.log.info("Step 3: Skip Youtube streaming.") + + if not call_direction: + return True + else: + expected_result = True + if call_direction == "mo": + ad_mo = self.android_devices[0] + ad_mt = self.android_devices[1] + mo_sub_id = get_subid_from_slot_index(self.log, ad, call_slot) + if call_or_sms_or_mms == "call": + set_incoming_voice_sub_id(ad_mo, mo_sub_id) + _, mt_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices) + + if call_slot == 0: + is_mo_in_call = is_slot0_in_call + elif call_slot == 1: + is_mo_in_call = is_slot1_in_call + is_mt_in_call = None + + elif call_or_sms_or_mms == "sms": + set_subid_for_message(ad_mo, mo_sub_id) + _, mt_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices, type="sms") + set_subid_for_message(ad_mt, mt_sub_id) + + elif call_or_sms_or_mms == "mms": + current_data_sub_id = get_default_data_sub_id(ad_mo) + if mo_sub_id != current_data_sub_id: + ad_mo.log.warning( + "Current data sub ID (%s) does not match" + " message sub ID (%s). MMS should NOT be sent.", + current_data_sub_id, mo_sub_id) + expected_result = False + set_subid_for_message(ad_mo, mo_sub_id) + _, mt_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices, type="sms") + set_subid_for_message(ad_mt, mt_sub_id) + set_subid_for_data(ad_mt, mt_sub_id) + ad_mt.droid.telephonyToggleDataConnection(True) + + elif call_direction == "mt": + ad_mo = self.android_devices[1] + ad_mt = self.android_devices[0] + mt_sub_id = get_subid_from_slot_index(self.log, ad, call_slot) + if call_or_sms_or_mms == "call": + set_incoming_voice_sub_id(ad_mt, mt_sub_id) + _, mo_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices) + + if call_slot == 0: + is_mt_in_call = is_slot0_in_call + elif call_slot == 1: + is_mt_in_call = is_slot1_in_call + is_mo_in_call = None + + elif call_or_sms_or_mms == "sms": + set_subid_for_message(ad_mt, mt_sub_id) + _, mo_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices, type="sms") + set_subid_for_message(ad_mo, mo_sub_id) + + elif call_or_sms_or_mms == "mms": + current_data_sub_id = get_default_data_sub_id(ad_mt) + if mt_sub_id != current_data_sub_id: + ad_mt.log.warning( + "Current data sub ID (%s) does not match" + " message sub ID (%s). MMS should NOT be" + " received.", current_data_sub_id, mt_sub_id) + expected_result = False + set_subid_for_message(ad_mt, mt_sub_id) + _, mo_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices, type="sms") + set_subid_for_message(ad_mo, mo_sub_id) + set_subid_for_data(ad_mo, mo_sub_id) + ad_mo.droid.telephonyToggleDataConnection(True) + + if call_or_sms_or_mms == "call": + self.log.info("Step 4: Make voice call.") + mo_slot = get_slot_index_from_subid( + self.log, ad_mo, mo_sub_id) + mt_slot = get_slot_index_from_subid( + self.log, ad_mt, mt_sub_id) + result = two_phone_call_msim_for_slot( + self.log, + ad_mo, + mo_slot, + None, + is_mo_in_call, + ad_mt, + mt_slot, + None, + is_mt_in_call) + self.tel_logger.set_result(result.result_value) + + if not result: + self.log.error( + "Failed to make MO call from %s slot %s to %s" + " slot %s", ad_mo.serial, mo_slot, ad_mt.serial, + mt_slot) + raise signals.TestFailure("Failed", + extras={"fail_reason": str(result.result_value)}) + else: + self.log.info("Step 4: Send %s.", call_or_sms_or_mms) + if call_or_sms_or_mms == "sms": + result = self._msim_message_test( + ad_mo, + ad_mt, + mo_sub_id, + mt_sub_id, + msg=call_or_sms_or_mms.upper()) + elif call_or_sms_or_mms == "mms": + result = self._msim_message_test( + ad_mo, + ad_mt, + mo_sub_id, + mt_sub_id, + msg=call_or_sms_or_mms.upper(), + expected_result=expected_result) + if not result: + log_messaging_screen_shot( + ad_mo, test_name="%s_tx" % call_or_sms_or_mms) + log_messaging_screen_shot( + ad_mt, test_name="%s_rx" % call_or_sms_or_mms) + + return False + return True + + def _test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + self, + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction=None, + streaming=True, + airplane_mode_cycling=False, + cellular_data_cycling=False, + wifi_cycling=False, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=False): + """Switch DDS and make VoLTE/WFC call together with Youtube playing + after each DDS switch at specific slot in specific RAT. + + Test step: + 1. Get sub ID of each slot of the primary device. + 2. Set up phones in desired RAT. + 3. Toggle on/off VoLTE/WFC and set WFC mode. + 4. Airplane mode or cellular data or Wi-Fi cycling. + 5. Switch DDS to slot 0. + 6. Check HTTP connection after DDS switch. + 7. Play Youtube. + 8. Make VoLTE or WFC call. + 9. Switch DDS to slot 1 and repeat step 6-8. + 10. Switch DDS to slot 0 again and repeat step 6-8. + + Args: + 1, slot_0_nw_gen: Network generation of slot 0 on the primary device + 2, slot_1_nw_gen: Network generation of slot 1 on the primary device + 3. call_slot: Slot for making voice call + 4. call_direction: "mo" or "mt" or None to stoping making call. + 5. streaming: True for playing Youtube after DDS switch and False on + the contrary. + 6. airplane_mode_cycling: True for cycling airplane + 7. cellular_data_cycling: True for cycling cellular data + 8. wifi_cycling: True for cycling Wi-Fi + 9. enable_volte: True for enabling and False for disabling VoLTE for + each slot on the primary device + 10. enable_wfc: True for enabling and False for disabling WFC for + each slot on the primary device + 11. wfc_mode: Cellular preferred or Wi-Fi preferred. + 12. is_airplane_mode: True of False for WFC setup + + Returns: + True or False + """ + ad = self.android_devices[0] + slot_0_subid = get_subid_from_slot_index(self.log, ad, 0) + slot_1_subid = get_subid_from_slot_index(self.log, ad, 1) + + if slot_0_subid == INVALID_SUB_ID or slot_1_subid == INVALID_SUB_ID: + ad.log.error("Not all slots have valid sub ID.") + raise signals.TestFailure("Failed", + extras={"fail_reason": "Not all slots have valid sub ID"}) + + ad.log.info( + "Step 0: Set up phone in desired RAT (slot 0: %s, slot 1: %s)", + slot_0_nw_gen, slot_1_nw_gen) + if slot_0_nw_gen == "volte": + slot0_phone_setup_func = phone_setup_volte_for_subscription + is_slot0_in_call = is_phone_in_call_volte + elif slot_0_nw_gen == "wfc": + slot0_phone_setup_func = phone_setup_iwlan_for_subscription + is_slot0_in_call = is_phone_in_call_iwlan + else: + slot0_phone_setup_func = phone_setup_voice_general_for_subscription + is_slot0_in_call = None + + if slot_0_nw_gen == "wfc": + tasks = [(slot0_phone_setup_func, ( + self.log, + ad, + slot_0_subid, + is_airplane_mode, + wfc_mode[0], + self.wifi_network_ssid, + self.wifi_network_pass))] + else: + tasks = [(slot0_phone_setup_func, (self.log, ad, slot_0_subid))] + if not multithread_func(self.log, tasks): + self.log.error("Phone Failed to Set Up Properly.") + self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE")) + raise signals.TestFailure("Failed", + extras={"fail_reason": "Phone Failed to Set Up Properly."}) + + if slot_1_nw_gen == "volte": + slot1_phone_setup_func = phone_setup_volte_for_subscription + is_slot1_in_call = is_phone_in_call_volte + elif slot_1_nw_gen == "wfc": + slot1_phone_setup_func = phone_setup_iwlan_for_subscription + is_slot1_in_call = is_phone_in_call_iwlan + else: + slot1_phone_setup_func = phone_setup_voice_general_for_subscription + is_slot1_in_call = None + + if slot_1_nw_gen == "wfc": + tasks = [(slot1_phone_setup_func, ( + self.log, + ad, + slot_1_subid, + is_airplane_mode, + wfc_mode[1], + self.wifi_network_ssid, + self.wifi_network_pass))] + else: + tasks = [(slot1_phone_setup_func, (self.log, ad, slot_1_subid))] + if not multithread_func(self.log, tasks): + self.log.error("Phone Failed to Set Up Properly.") + self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE")) + raise signals.TestFailure("Failed", + extras={"fail_reason": "Phone Failed to Set Up Properly."}) + + ad.log.info("Step 1: Enable/disable VoLTE and WFC.") + for sub_id, volte in zip([slot_0_subid, slot_1_subid], enable_volte): + if not toggle_volte_for_subscription( + self.log, + ad, + sub_id, + new_state=volte): + return False + + for sub_id, wfc, mode in \ + zip([slot_0_subid, slot_1_subid], enable_wfc, wfc_mode): + if not toggle_wfc_for_subscription(self.log, ad, new_state=wfc, sub_id=sub_id): + return False + if not set_wfc_mode_for_subscription(ad, mode, sub_id=sub_id): + return False + + if airplane_mode_cycling: + ad.log.info("Step 2: Airplane mode cycling.") + ad.log.info("Step 2-1: Toggle on airplane mode.") + if not toggle_airplane_mode(self.log, ad, True): + ad.log.error("Failed to toggle on airplane mode.") + return False + time.sleep(5) + ad.log.info("Step 2-2: Toggle off airplane mode.") + if not toggle_airplane_mode(self.log, ad, False): + ad.log.error("Failed to toggle off airplane mode.") + return False + + if is_airplane_mode: + time.sleep(5) + ad.log.info("Step 2-3: Toggle on airplane mode again.") + if not toggle_airplane_mode(self.log, ad, True): + ad.log.error("Failed to toggle on airplane mode.") + return False + + if wfc_mode[0] or wfc_mode[1]: + time.sleep(5) + ad.log.info("Step 2-4: Toggle on Wi-Fi again.") + if not ensure_wifi_connected( + self.log, + ad, + self.wifi_network_ssid, + self.wifi_network_pass, + apm=is_airplane_mode): + return False + time.sleep(5) + + if cellular_data_cycling: + if call_slot is 0: + sub_id = slot_0_subid + elif call_slot is 1: + sub_id = slot_1_subid + ad.log.info("Step 2: Cellular data cycling") + ad.log.info("Step 2-1: Toggle off cellular data.") + ad.droid.telephonyToggleDataConnection(False) + if not check_is_wifi_connected( + self.log, + ad, + self.wifi_network_ssid): + if not wait_for_cell_data_connection_for_subscription( + self.log, ad, sub_id, False): + ad.log.error("Failed to disable cellular data") + return False + + if not verify_internet_connection( + self.log, + ad, + expected_state=False): + ad.log.error("Internet still accessible when cellular data" + " is disabled.") + return False + time.sleep(5) + ad.log.info("Step 2-2: Toggle on cellular data.") + ad.droid.telephonyToggleDataConnection(True) + if not check_is_wifi_connected( + self.log, + ad, + self.wifi_network_ssid): + if not wait_for_cell_data_connection_for_subscription( + self.log, ad, sub_id, True): + ad.log.error("Failed to enable cellular data") + return False + if not verify_internet_connection(self.log, ad, retries=3): + ad.log.error( + "Internet inaccessible when cellular data is enabled.") + return False + + if wifi_cycling: + ad.log.info("Step 2: Wi-Fi cycling") + ad.log.info("Step 2-1: Toggle on Wi-Fi.") + if not ensure_wifi_connected( + self.log, + ad, + self.wifi_network_ssid, + self.wifi_network_pass, + apm=is_airplane_mode): + return False + time.sleep(5) + ad.log.info("Step 2-2: Toggle off Wi-Fi.") + ad.droid.wifiToggleState(False) + time.sleep(5) + + if (call_slot is 0 and slot_0_nw_gen == "wfc") or \ + (call_slot is 1 and slot_1_nw_gen == "wfc"): + if not ensure_wifi_connected( + self.log, + ad, + self.wifi_network_ssid, + self.wifi_network_pass, + apm=is_airplane_mode): + return False + + for attempt in range(3): + if attempt is not 0: + ad.log.info("Repeat step 1 to 4.") + + ad.log.info("Step 3: Switch DDS.") + if attempt % 2 == 0: + set_dds_on_slot_0(ad) + else: + set_dds_on_slot_1(ad) + + ad.log.info("Step 4: Check HTTP connection after DDS switch.") + if not verify_http_connection(self.log, ad): + ad.log.error("Failed to verify http connection.") + return False + else: + ad.log.info("Verify http connection successfully.") + + if streaming: + ad.log.info("Step 5: Start Youtube streaming.") + if not start_youtube_video(ad): + ad.log.warning("Fail to bring up youtube video") + time.sleep(10) + else: + ad.log.info("Step 5: Skip Youtube streaming.") + + if not call_direction: + return True + else: + expected_result = True + if call_direction == "mo": + ad_mo = self.android_devices[0] + ad_mt = self.android_devices[1] + mo_sub_id = get_subid_from_slot_index(self.log, ad, call_slot) + + set_incoming_voice_sub_id(ad_mo, mo_sub_id) + _, mt_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices) + + if call_slot == 0: + is_mo_in_call = is_slot0_in_call + elif call_slot == 1: + is_mo_in_call = is_slot1_in_call + is_mt_in_call = None + + elif call_direction == "mt": + ad_mo = self.android_devices[1] + ad_mt = self.android_devices[0] + mt_sub_id = get_subid_from_slot_index(self.log, ad, call_slot) + + set_incoming_voice_sub_id(ad_mt, mt_sub_id) + _, mo_sub_id, _ = get_subid_on_same_network_of_host_ad( + self.android_devices) + + if call_slot == 0: + is_mt_in_call = is_slot0_in_call + elif call_slot == 1: + is_mt_in_call = is_slot1_in_call + is_mo_in_call = None + + if (call_slot is 0 and slot_0_nw_gen == "wfc") or \ + (call_slot is 1 and slot_1_nw_gen == "wfc"): + if not wait_for_wfc_enabled(self.log, ad): + return False + + self.log.info("Step 6: Make voice call.") + mo_slot = get_slot_index_from_subid(self.log, ad_mo, mo_sub_id) + mt_slot = get_slot_index_from_subid(self.log, ad_mt, mt_sub_id) + result = two_phone_call_msim_for_slot( + self.log, + ad_mo, + mo_slot, + None, + is_mo_in_call, + ad_mt, + mt_slot, + None, + is_mt_in_call) + self.tel_logger.set_result(result.result_value) + + if not result: + self.log.error( + "Failed to make MO call from %s slot %s to %s slot %s", + ad_mo.serial, mo_slot, ad_mt.serial, mt_slot) + raise signals.TestFailure("Failed", + extras={"fail_reason": str(result.result_value)}) + + return True + + def _test_dds_switch_volte_cycling(self, slot=0): + """ VoLTE cycling after DDS switch. + + Test steps: + 1. Enable VoLTE. + 2. Disable VoLTE. + 3. Switch DDS to slot 0. + 4. Check HTTP connection after DDS switch. + 5. Enable VoLTE again. + 6. Check if IMS can be registered successfully and if VoLTE is + available. + 7. Repeat steps 2-6 for 2 times and each time DDS should be switched + to another slot. + + Args: + slot: slot to be tested + + Returns: + True or False + """ + ad = self.android_devices[0] + slot_0_subid = get_subid_from_slot_index(self.log, ad, 0) + slot_1_subid = get_subid_from_slot_index(self.log, ad, 1) + + if slot is 0: + sub_id = slot_0_subid + elif slot is 1: + sub_id = slot_1_subid + + ad.log.info("Step 1: Enable VoLTE for sub ID %s.", sub_id) + if not phone_setup_volte_for_subscription(self.log, ad, sub_id): + return False + + for attempt in range(3): + if attempt is not 0: + ad.log.info("Repeat step 2 to 4.") + + ad.log.info("Step 2-1: Disable VoLTE for sub ID %s.", sub_id) + if not toggle_volte_for_subscription( + self.log, ad, sub_id, new_state=False): + return False + + ad.log.info( + "Step 2-2: Ensure VoLTE is disabled for sub ID %s.", sub_id) + if is_volte_enabled(self.log, ad, sub_id): + return False + + ad.log.info("Step 3: Switch DDS.") + if attempt % 2 == 0: + set_dds_on_slot_0(ad) + else: + set_dds_on_slot_1(ad) + + ad.log.info("Step 4: Check HTTP connection after DDS switch.") + if not verify_http_connection(self.log, ad): + ad.log.error("Failed to verify http connection.") + return False + else: + ad.log.info("Verify http connection successfully.") + + ad.log.info( + "Step 5: Enable VoLTE again after DDS switch for sub ID %s.", + sub_id) + if not phone_setup_volte_for_subscription(self.log, ad, sub_id): + return False + + return True + + @test_tracker_info(uuid="06908fb0-aaaa-4c95-b073-ea5ba8977050") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_when_volte_enabled(self): + ad = self.android_devices[0] + slot_0_subid = get_subid_from_slot_index(self.log, ad, 0) + slot_1_subid = get_subid_from_slot_index(self.log, ad, 1) + + ad.log.info("Step 0: Ensure VoLTE is enabled as initial condition.") + if not phone_setup_volte_for_subscription(self.log, ad, slot_0_subid): + return False + if not phone_setup_volte_for_subscription(self.log, ad, slot_1_subid): + return False + + for attempt in range(3): + ad.log.info("Step 1: Switch DDS.") + if attempt % 2 == 0: + set_dds_on_slot_0(ad) + else: + set_dds_on_slot_1(ad) + + ad.log.info("Step 2: Check HTTP connection after DDS switch.") + if not verify_http_connection(self.log, ad): + ad.log.error("Failed to verify http connection.") + return False + else: + ad.log.info("Verify http connection successfully.") + + ad.log.info("Step 3: Ensure VoLTE is still enabled after DDS" + " switch.") + if not phone_setup_volte_for_subscription( + self.log, ad, slot_0_subid): + return False + if not phone_setup_volte_for_subscription( + self.log, ad, slot_1_subid): + return False + return True + + @test_tracker_info(uuid="6b41d84c-4485-47b0-a5d8-eac16ed36258") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_and_reboot_when_volte_enabled(self): + ad = self.android_devices[0] + slot_0_subid = get_subid_from_slot_index(self.log, ad, 0) + slot_1_subid = get_subid_from_slot_index(self.log, ad, 1) + + ad.log.info("Step 0: Ensure VoLTE is enabled as initial condition.") + if not phone_setup_volte_for_subscription(self.log, ad, slot_0_subid): + return False + if not phone_setup_volte_for_subscription(self.log, ad, slot_1_subid): + return False + + for attempt in range(3): + ad.log.info("Step 1: Switch DDS.") + if attempt % 2 == 0: + set_dds_on_slot_0(ad) + else: + set_dds_on_slot_1(ad) + + ad.log.info("Step 2: Check HTTP connection after DDS switch.") + if not verify_http_connection(self.log, ad): + ad.log.error("Failed to verify http connection.") + return False + else: + ad.log.info("Verify http connection successfully.") + + ad.log.info("Step 3: Reboot.") + if not reboot_test(self.log, ad): + return False + + ad.log.info("Step 4: Ensure VoLTE is still enabled after DDS" + " switch.") + if not phone_setup_volte_for_subscription( + self.log, ad, slot_0_subid): + return False + if not phone_setup_volte_for_subscription( + self.log, ad, slot_1_subid): + return False + return True + + @test_tracker_info(uuid="bb440f33-ab0d-4999-885c-5c1f933430c4") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_when_volte_cycling_psim(self): + return self._test_dds_switch_volte_cycling(slot=0) + + @test_tracker_info(uuid="cbd5a4ae-be37-4435-b9db-fe58e8fdac5f") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_when_volte_cycling_esim(self): + return self._test_dds_switch_volte_cycling(slot=1) + + + @test_tracker_info(uuid="2df5faf9-8318-4acb-9068-e6ec0481c2ca") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_volte(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte") + + @test_tracker_info(uuid="eb73506e-c604-48df-be04-9b602a801afc") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mo_volte_psim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo") + + @test_tracker_info(uuid="2e2feab1-65a8-40a7-8666-0c46cb3411a4") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mo_volte_esim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo") + + @test_tracker_info(uuid="f2a7d62c-1f54-4081-b7bb-4782c5482b41") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mt_volte_psim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt") + + @test_tracker_info(uuid="df211078-b260-499d-8f7e-86cad039c5f5") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mt_volte_esim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt") + + @test_tracker_info(uuid="bd77782d-f43d-40c6-9982-47cd452d980f") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mo_csfb_psim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="csfb", + slot_1_nw_gen="csfb", + call_slot=0, + call_direction="mo") + + @test_tracker_info(uuid="361a6f69-e6ea-4013-960d-732931fcd130") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mo_csfb_esim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="csfb", + slot_1_nw_gen="csfb", + call_slot=1, + call_direction="mo") + + @test_tracker_info(uuid="26186d4f-0b0d-41c5-ab91-04e9851461f0") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mt_csfb_psim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="csfb", + slot_1_nw_gen="csfb", + call_slot=0, + call_direction="mt") + + @test_tracker_info(uuid="7d31c644-a470-4eb9-b272-f0cfc34d23cb") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_voice_call_mt_csfb_esim(self): + return self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="csfb", + slot_1_nw_gen="csfb", + call_slot=1, + call_direction="mt") + + @test_tracker_info(uuid="614076a6-b042-45f3-84fe-c84591e02f78") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_sms_volte(self): + result = True + self.log.info("Scenario 1: MO SMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + call_or_sms_or_mms="sms"): + result = False + self.log.info("Scenario 2: MO SMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + call_or_sms_or_mms="sms"): + result = False + self.log.info("Scenario 3: MT SMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + call_or_sms_or_mms="sms"): + result = False + self.log.info("Scenario 4: MT SMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + call_or_sms_or_mms="sms"): + result = False + return result + + @test_tracker_info(uuid="5e61f007-7b01-4dee-ac2d-fd2225ac3dbd") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_youtube_and_mms_volte(self): + result = True + self.log.info("Scenario 1: MO MMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + call_or_sms_or_mms="mms"): + result = False + self.log.info("Scenario 2: MO MMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + call_or_sms_or_mms="mms"): + result = False + self.log.info("Scenario 3: MT MMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + call_or_sms_or_mms="mms"): + result = False + self.log.info("Scenario 4: MT MMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + call_or_sms_or_mms="mms"): + result = False + return result + + @test_tracker_info(uuid="47b9bf08-2c17-4646-b1d3-3d191318bc0d") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim(self): + return self._test_dds_switch_during_data_transfer( + "volte", "volte", 0, "mo", "call", False) + + @test_tracker_info(uuid="eef31675-f0a3-4086-8474-d67614ede507") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim(self): + return self._test_dds_switch_during_data_transfer( + "volte", "volte", 1, "mo", "call", False) + + @test_tracker_info(uuid="ce8b6ce8-d314-49ca-bead-391c15809235") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim(self): + return self._test_dds_switch_during_data_transfer( + "volte", "volte", 0, "mt", "call", False) + + @test_tracker_info(uuid="64c941e0-fcab-43ca-a988-f667398f1997") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim(self): + return self._test_dds_switch_during_data_transfer( + "volte", "volte", 1, "mt", "call", False) + + @test_tracker_info(uuid="28963e86-f8ce-4324-8ce8-8e6628fd2d99") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_sms_volte(self): + result = True + self.log.info("Scenario 1: MO SMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 0, "mo", "sms", False): + result = False + self.log.info("Scenario 2: MO SMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 1, "mo", "sms", False): + result = False + self.log.info("Scenario 3: MT SMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 0, "mt", "sms", False): + result = False + self.log.info("Scenario 4: MT SMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 1, "mt", "sms", False): + result = False + return result + + @test_tracker_info(uuid="915c0eb3-1a84-4eb0-8cba-cafe32c0d604") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_mms_volte(self): + result = True + self.log.info("Scenario 1: MO MMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 0, "mo", "mms", False): + result = False + self.log.info("Scenario 2: MO MMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 1, "mo", "mms", False): + result = False + self.log.info("Scenario 3: MT MMS at slot 0") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 0, "mt", "mms", False): + result = False + self.log.info("Scenario 4: MT MMS at slot 1") + if not self._test_dds_switch_during_data_transfer( + "volte", "volte", 1, "mt", "mms", False): + result = False + return result + + @test_tracker_info(uuid="d58939c0-d246-453e-9eac-54152d6dc70c") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim_with_wfc_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="61dfb957-6349-4190-8e63-973558b1292b") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim_with_wfc_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="127377f2-973f-4758-b138-4c0dd276f893") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim_with_wfc_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="a149d357-27a7-490d-a30b-70f44cd43ac7") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim_with_wfc_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="bc522b4d-2d26-4b5f-b82c-f92356f103d0") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="970ccdb4-c7b3-4b56-b93b-f811407c82cb") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="26c8b63e-631c-42d0-868b-03c2db6181b7") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="efd73091-8667-42a3-8551-eafa497fc383") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="618768b9-83c2-4ab7-b1fb-10a4037c5834") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="24d695a1-7421-4038-bb07-4d81f3f6d05b") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="2f28db8f-c0c3-4cf6-9f6f-439c9e32d9f3") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="60d851c5-f79d-46e7-b921-b510bcdc9024") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_on_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="092b1e43-3de4-4b08-b526-4f3f1e71a47a") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim_with_wfc_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="3b876b39-1cfb-4adb-a45c-11a02890f8e1") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim_with_wfc_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="96c42ffb-5b4e-4ab0-b52a-8b498a25f759") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim_with_wfc_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="fbd4c30c-fef9-4100-b704-eb27d3bcb7ae") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim_with_wfc_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="ad491362-8bcc-4097-84af-932878002ce6") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="c137fe4e-380b-4dc5-8996-c8c5654596f7") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="e7936ce8-1652-4b21-b3f0-5327084b823c") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="86db06b4-907f-4085-af8e-75c983831bb0") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="e43b23b5-022a-4830-9110-839ece333f6f") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="00d0bfc2-2121-4ba9-9dd7-72bf78380121") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="4921a948-54d4-4945-81ea-02893d10b6e6") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="ed4b8ba4-1b31-4e3c-9be3-0e184e324523") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_on_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="1fb43960-51dd-4be9-adf1-51c84cb8d85a") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim_with_wfc_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="1052e02f-5a4b-4826-9c47-9ab6d142f300") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim_with_wfc_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="23bb1991-6ff1-4528-aeee-1ec0c7b525be") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim_with_wfc_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="1d5842c5-91f5-4c87-9f65-67891d255d43") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim_with_wfc_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED]) + + @test_tracker_info(uuid="33ed3dee-581f-4ae8-b236-1317377a6ca1") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="88391458-6886-483f-a997-c62fd6dfd0b8") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="966bcb75-dd2d-4400-a880-e7407989ee52") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="7ff48189-5b4b-4b2d-a96a-fa66e86d0596") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="ab503377-7150-4a6d-a7c1-b21009a69402") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_psim_wfc_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="7f02ee60-19e9-4602-8f6d-a13b976a6bba") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_esim_wfc_cellular_preferred_apm_on_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="e93fa3ac-c5cd-4e21-b872-5172aa22d030") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="c2af6998-f702-4e36-bbaa-f099a307b21a") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_with_volte_on_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="45ba6e90-bdaa-4dc0-a504-c596bafdfaad") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim_with_wfc_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="1b573f40-3eaf-4149-baad-2e73e5bf15f4") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim_with_wfc_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="13511fb6-2984-40c3-b1b9-22f27f241c07") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim_with_wfc_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="61cf33d1-e1b2-427a-bb38-29a4c7566947") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim_with_wfc_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="31a2a741-c825-46f8-8e0a-8487fab9940e") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim_with_wfc_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="9fb2a85f-08b3-4d5d-9e03-3f7f67039148") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim_with_wfc_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="30eba519-b349-4a75-9f31-3fea0d1a8447") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim_with_wfc_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="37240938-3ce1-4ad2-b35a-a8862dc2c70f") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim_with_wfc_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="a7321b9c-fb2c-4a03-9566-05e4244ae6fd") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_psim_with_wfc_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="6de8d678-2f72-41ea-9ed9-47b27afee038") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_volte_esim_with_wfc_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="7bc16dcf-6dab-4eec-931d-9b342caa7a32") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_psim_with_wfc_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=0, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="9c13e51b-385d-4df6-90b7-33b5e185f225") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_volte_esim_with_wfc_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="volte", + slot_1_nw_gen="volte", + call_slot=1, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[True, True], + enable_wfc=[False, False], + wfc_mode=[WFC_MODE_DISABLED, WFC_MODE_DISABLED]) + + @test_tracker_info(uuid="161341e7-5c2d-45f9-9b11-4f44d542cd01") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="4d43f92f-562f-4bf1-bc25-71410f14425c") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="fe83e92d-c554-4f81-a447-d58300426da7") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="76ba6834-1523-4ce8-80b9-079f2428da67") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="15289348-8e09-4997-b5a3-f66bb7e7dca1") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="1ae4fa98-1ac3-4194-a483-097b7262415b") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="13d0af2c-2870-4cbc-8a38-311f93cd4bd7") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="5fbe2002-a02f-4750-81e5-4a06d7b62740") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_off_apm_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + airplane_mode_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="f8f523d2-e432-45d4-a850-469a22894bc7") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="750a8690-f9dd-4779-b13f-4011f478f194") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="9fcda7e5-1705-4bbe-8f18-f005437c71f2") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="0e054729-945a-4f6f-ad29-4d832f0b11ed") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="2e387739-cc4a-4d48-aa56-83bf621835b1") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="a0e2deda-9148-4665-abc8-7665e3818d06") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="6a43acef-aaa1-4fe8-ae7e-c8e045bf8814") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="95524166-212f-4e82-9e02-2f9b58d92a9f") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_off_cellular_data_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + cellular_data_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="828ae64c-41b3-4974-a412-342d3ca16ce3") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_cellular_preferred_apm_on_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="343cf9dc-4f4c-4c0c-bd7b-ba664381f6bd") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_cellular_preferred_apm_on_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="6ef18605-bf4c-43d8-83fd-0bf71311973e") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_psim_wifi_preferred_apm_off_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="9bddfe69-68e1-4d04-aeaa-75fb0f9ed9aa") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mo_wfc_esim_wifi_preferred_apm_off_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mo", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="81e7d2b6-e3eb-4651-807f-66bf8eeeea93") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_cellular_preferred_apm_on_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="8c6da88b-be3a-4c0c-a239-255faf03a28b") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_cellular_preferred_apm_on_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_CELLULAR_PREFERRED, WFC_MODE_CELLULAR_PREFERRED], + is_airplane_mode=True) + + @test_tracker_info(uuid="1b9ef6b4-c0c0-4375-b1a5-d569b946491e") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_psim_wifi_preferred_apm_off_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=0, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False) + + @test_tracker_info(uuid="5771fedb-5eed-4868-84a3-0d7a01474dcf") + @TelephonyBaseTest.tel_test_wrap + def test_dds_switch_voice_call_mt_wfc_esim_wifi_preferred_apm_off_with_volte_off_wifi_cycling(self): + return self._test_dds_switch_during_data_transfer_with_apm_cycling_and_ims_setting( + slot_0_nw_gen="wfc", + slot_1_nw_gen="wfc", + call_slot=1, + call_direction="mt", + streaming=True, + wifi_cycling=True, + enable_volte=[False, False], + enable_wfc=[True, True], + wfc_mode=[WFC_MODE_WIFI_PREFERRED, WFC_MODE_WIFI_PREFERRED], + is_airplane_mode=False)
\ No newline at end of file |