Merge "remove meteredness check in airplane mode"
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py
index bb0f66b..fb76389 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py
@@ -208,7 +208,7 @@
log = logging
STORY_LINE = "+19523521350"
CallResult = TelephonyVoiceTestResult.CallResult.Value
-
+voice_call_type = {}
class TelTestUtilsError(Exception):
pass
@@ -1640,7 +1640,9 @@
timeout=MAX_WAIT_TIME_CALL_INITIATION,
checking_interval=5,
incall_ui_display=INCALL_UI_DISPLAY_FOREGROUND,
- video=False):
+ video=False,
+ voice_type_init=None,
+ call_stats_check=False):
"""Make phone call from caller to callee.
Args:
@@ -1674,6 +1676,14 @@
return False
else:
return True
+
+ if call_stats_check:
+ voice_type_in_call = ad.droid.telephonyGetCurrentVoiceNetworkType()
+ phone_call_type = check_call_status(ad,
+ voice_type_init,
+ voice_type_in_call)
+ ad.log.debug("Voice Call Type: %s", phone_call_type)
+
finally:
if hasattr(ad, "sdm_log") and getattr(ad, "sdm_log"):
ad.adb.shell("i2cset -fy 3 64 6 1 b", ignore_status=True)
@@ -2322,7 +2332,9 @@
incall_ui_display=INCALL_UI_DISPLAY_FOREGROUND,
dialing_number_length=None,
video_state=None,
- slot_id_callee=None):
+ slot_id_callee=None,
+ voice_type_init=None,
+ call_stats_check=False):
""" Call process, including make a phone call from caller,
accept from callee, and hang up. The call is on default voice subscription
@@ -2360,7 +2372,8 @@
return call_setup_teardown_for_subscription(
log, ad_caller, ad_callee, subid_caller, subid_callee, ad_hangup,
verify_caller_func, verify_callee_func, wait_time_in_call,
- incall_ui_display, dialing_number_length, video_state)
+ incall_ui_display, dialing_number_length, video_state,
+ voice_type_init, call_stats_check)
def call_setup_teardown_for_subscription(
@@ -2375,7 +2388,9 @@
wait_time_in_call=WAIT_TIME_IN_CALL,
incall_ui_display=INCALL_UI_DISPLAY_FOREGROUND,
dialing_number_length=None,
- video_state=None):
+ video_state=None,
+ voice_type_init=None,
+ call_stats_check=False):
""" Call process, including make a phone call from caller,
accept from callee, and hang up. The call is on specified subscription
@@ -2509,6 +2524,18 @@
'CALL_DROP_OR_WRONG_STATE_DURING_ESTABLISHMENT')
if not tel_result_wrapper:
return tel_result_wrapper
+
+ if call_stats_check:
+ voice_type_in_call = check_voice_network_type([ad_caller, ad_callee], voice_init=False)
+ phone_a_call_type = check_call_status(ad_caller,
+ voice_type_init[0],
+ voice_type_in_call[0])
+ ad_caller.log.debug("Voice Call Type: %s", phone_a_call_type)
+ phone_b_call_type = check_call_status(ad_callee,
+ voice_type_init[1],
+ voice_type_in_call[1])
+ ad_callee.log.debug("Voice Call Type: %s", phone_b_call_type)
+
elapsed_time = 0
while (elapsed_time < wait_time_in_call):
CHECK_INTERVAL = min(CHECK_INTERVAL,
@@ -2560,6 +2587,7 @@
'CALL_ID_CLEANUP_FAIL')
return tel_result_wrapper
+
def call_setup_teardown_for_call_forwarding(
log,
ad_caller,
@@ -2631,6 +2659,7 @@
call_forwarding_type,
verify_after_cf_disabled)
+
def call_setup_teardown_for_call_forwarding_for_subscription(
log,
ad_caller,
@@ -3040,6 +3069,7 @@
verify_caller_func, verify_callee_func, wait_time_in_call,
incall_ui_display, dialing_number_length, video_state)
+
def call_setup_teardown_for_call_waiting(log,
ad_caller,
ad_callee,
@@ -3109,6 +3139,7 @@
video_state,
call_waiting)
+
def call_setup_teardown_for_call_waiting_for_subscription(
log,
ad_caller,
@@ -3544,6 +3575,7 @@
set_call_waiting(log, ad_callee, enable=1)
return result
+
def wait_for_call_id_clearing(ad,
previous_ids,
timeout=MAX_WAIT_TIME_CALL_DROP):
@@ -4043,6 +4075,7 @@
except AdbError:
return False
+
def iperf_test_by_adb(log,
ad,
iperf_server,
@@ -5178,6 +5211,7 @@
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)
@@ -5213,6 +5247,7 @@
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,
@@ -5360,7 +5395,6 @@
return True
-
def set_ims_provisioning_for_subscription(ad, feature_flag, value, sub_id=None):
""" Sets Provisioning Values for Subscription Id
@@ -5431,6 +5465,7 @@
ad.log.error(e)
return False
+
def activate_wfc_on_device(log, ad):
""" Activates WiFi calling on device.
@@ -5823,6 +5858,7 @@
"""
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.
@@ -5842,6 +5878,7 @@
return change_voice_subid_temporarily(
ad, sub_id, ad.droid.telephonyIsVolteAvailable)
+
def is_volte_enabled(log, ad, sub_id=None):
"""Return True if VoLTE feature bit is True.
@@ -7666,7 +7703,6 @@
return set_preferred_network_mode_pref(ad.log, ad, sub_id, mode)
-
def set_preferred_subid_for_sms(log, ad, sub_id):
"""set subscription id for SMS
@@ -7983,6 +8019,7 @@
ad.adb.shell("setprop persist.vendor.sys.modem.logging.enable false")
ad.adb.shell('echo "modem_logging_control START -n 10 -s 100 -i 1" > /data/vendor/radio/logs/always-on.conf')
+
def start_sdm_logger(ad):
"""Start SDM logger."""
if not getattr(ad, "sdm_log", True): return
@@ -8381,6 +8418,7 @@
activate_wfc_on_device(ad.log, ad)
return status
+
def install_carriersettings_apk(ad, carriersettingsapk, skip_setup_wizard=True):
""" Carrier Setting Installation Steps
@@ -8633,6 +8671,7 @@
if ad.adb.getprop("ro.build.id") != build_id:
build_id_override(ad, build_id)
+
def enable_privacy_usage_diagnostics(ad):
try:
ad.ensure_screen_on()
@@ -8647,6 +8686,7 @@
except Exception:
ad.log.info("Unable to toggle Usage and Diagnostics")
+
def build_id_override(ad, new_build_id=None, postfix=None):
build_fingerprint = ad.adb.getprop(
"ro.build.fingerprint") or ad.adb.getprop(
@@ -9058,6 +9098,7 @@
ad.log.debug("Carrier Config Version is %s", version)
return version
+
def get_er_db_id_version(ad):
out = ad.adb.shell("dumpsys activity service TelephonyDebugService | \
grep -i \"Database Version\"")
@@ -9078,6 +9119,7 @@
ad.log.error("Emergency Number is incorrect. %s ", result)
return False
+
def add_whitelisted_account(ad, user_account,user_password, retries=3):
if not ad.is_apk_installed("com.google.android.tradefed.account"):
ad.log.error("GoogleAccountUtil is not installed")
@@ -9198,6 +9240,7 @@
break
return True
+
def activate_google_fi_account(ad, retries=10):
_FI_APK = "com.google.android.apps.tycho"
_FI_ACTIVATE_CMD = ('am start -c android.intent.category.DEFAULT -n '
@@ -9436,6 +9479,7 @@
ad.log.info("radio.enable_tel_mon setting is %s", monitor_setting)
return monitor_setting == expected_monitor_setting
+
def get_call_forwarding_by_adb(log, ad, call_forwarding_type="unconditional"):
""" Get call forwarding status by adb shell command
'dumpsys telephony.registry'.
@@ -9478,6 +9522,7 @@
ad.log.error("'mCallForwarding' cannot be found in dumpsys.")
return False
+
def erase_call_forwarding_by_mmi(
log,
ad,
@@ -9594,6 +9639,7 @@
return result
+
def set_call_forwarding_by_mmi(
log,
ad,
@@ -9720,12 +9766,14 @@
(call_forwarding_type, forwarded_number))
return False
+
def get_call_waiting_status(log, ad):
""" (Todo) Get call waiting status (activated or deactivated) when there is
any proper method available.
"""
return True
+
def set_call_waiting(log, ad, enable=1, retry=1):
""" Activate/deactivate call waiting by dialing MMI code.
@@ -9766,6 +9814,7 @@
return False
+
def get_rx_tx_power_levels(log, ad):
""" Obtains Rx and Tx power levels from the MDS application.
@@ -9832,6 +9881,7 @@
return rx_power, tx_power
+
def sms_in_collision_send_receive_verify(
log,
ad_rx,
@@ -9899,6 +9949,7 @@
return False
return True
+
def sms_in_collision_send_receive_verify_for_subscription(
log,
ad_tx,
@@ -10344,6 +10395,7 @@
return res
+
def wait_for_matching_mt_sms_in_collision(log,
ad_rx,
phonenumber_tx,
@@ -10415,6 +10467,7 @@
len(received_sms2), phonenumber_tx2)
return False
+
def wait_for_matching_mt_sms_in_collision_with_mo_sms(log,
ad_rx,
ad_rx2,
@@ -10510,6 +10563,7 @@
return result
+
def wait_for_matching_multiple_sms(log,
ad_rx,
phonenumber_tx,
@@ -10579,6 +10633,7 @@
return True
+
def is_sms_in_collision_match(
event, phonenumber_tx, phonenumber_tx2, text, text2):
event_text = event['data']['Text'].strip()
@@ -10591,6 +10646,7 @@
return True
return False
+
def is_sms_in_collision_partial_match(
event, phonenumber_tx, phonenumber_tx2, text, text2):
for phonenumber, txt in [[phonenumber_tx, text], [phonenumber_tx2, text2]]:
@@ -10600,6 +10656,7 @@
return True
return False
+
def is_sms_match_among_multiple_sms(
event, phonenumber_tx, phonenumber_tx2, texts=[], texts2=[]):
for txt in texts:
@@ -10616,6 +10673,7 @@
return False
+
def is_sms_partial_match_among_multiple_sms(
event, phonenumber_tx, phonenumber_tx2, texts=[], texts2=[]):
event_text = event['data']['Text'].strip()
@@ -10636,6 +10694,7 @@
return False
+
def set_time_sync_from_network(ad, action):
if (action == 'enable'):
ad.log.info('Enabling sync time from network.')
@@ -10647,6 +10706,7 @@
time.sleep(WAIT_TIME_SYNC_DATE_TIME_FROM_NETWORK)
+
def datetime_handle(ad, action, set_datetime_value='', get_year=False):
get_value = ''
if (action == 'get'):
@@ -10671,6 +10731,7 @@
return get_value
+
def wait_for_sending_sms(ad_tx, max_wait_time=MAX_WAIT_TIME_SMS_RECEIVE):
try:
events = ad_tx.messaging_ed.pop_events(
@@ -10695,6 +10756,7 @@
EventSmsSentSuccess, EventSmsSentFailure)
return False
+
def wait_for_call_end(
log,
ad_caller,
@@ -10753,6 +10815,7 @@
return tel_result_wrapper
+
def voice_call_in_collision_with_mt_sms_msim(
log,
ad_primary,
@@ -10989,6 +11052,7 @@
return tel_result_wrapper
+
def change_voice_subid_temporarily(ad, sub_id, state_check_func, params=None):
result = False
voice_sub_id_changed = False
@@ -11009,6 +11073,7 @@
return result
+
def wait_for_network_service(
log,
ad,
@@ -11109,6 +11174,68 @@
return False
return False
+
+def check_voice_network_type(ads, voice_init=True):
+ """
+ Args:
+ ad: Android device object
+ voice_init: check voice network type before initiate call
+ Return:
+ voice_network_list: Network Type for all android devices
+ """
+ voice_network_list = []
+ for ad in ads:
+ voice_network_list.append(ad.droid.telephonyGetCurrentVoiceNetworkType())
+ if voice_init:
+ ad.log.debug("Voice Network Type Before Call is %s",
+ ad.droid.telephonyGetCurrentVoiceNetworkType())
+ else:
+ ad.log.debug("Voice Network Type During Call is %s",
+ ad.droid.telephonyGetCurrentVoiceNetworkType())
+ return voice_network_list
+
+
+def check_call_status(ad, voice_type_init=None, voice_type_in_call=None):
+ """"
+ Args:
+ ad: Android device object
+ voice_type_init: Voice network type before initiate call
+ voice_type_in_call: Voice network type in call state
+
+ Return:
+ voice_call_type_dict: Voice call status
+ """
+ dut = str(ad.serial)
+ network_type = voice_type_init + "_" + voice_type_in_call
+ if network_type == "NR_NR":
+ voice_call_type_dict = update_voice_call_type_dict(dut, "VoNR")
+ elif network_type == "NR_LTE":
+ voice_call_type_dict = update_voice_call_type_dict(dut, "EPSFB")
+ elif network_type == "LTE_LTE":
+ voice_call_type_dict = update_voice_call_type_dict(dut, "VoLTE")
+ elif network_type == "LTE_WCDMA":
+ voice_call_type_dict = update_voice_call_type_dict(dut, "CSFB")
+ else:
+ voice_call_type_dict = update_voice_call_type_dict(dut, "UNKNOWN")
+ return voice_call_type_dict
+
+
+def update_voice_call_type_dict(dut, key):
+ """
+ Args:
+ dut: Serial Number of android device object
+ key: Network subscription parameter (VoNR or EPSFB or VoLTE or CSFB or UNKNOWN)
+ Return:
+ voice_call_type: Voice call status
+ """
+ if dut in voice_call_type.keys():
+ voice_call_type[dut][key] += 1
+ else:
+ voice_call_type[dut] = {key:0}
+ voice_call_type[dut][key] += 1
+ return voice_call_type
+
+
def wait_for_log(ad, pattern, begin_time=None, end_time=None, max_wait_time=120):
"""Wait for logcat logs matching given pattern. This function searches in
logcat for strings matching given pattern by using search_logcat per second
@@ -11139,4 +11266,4 @@
stop_time = datetime.now()
passed_time = (stop_time - start_time).total_seconds()
if passed_time > max_wait_time:
- return
+ return
\ No newline at end of file
diff --git a/acts_tests/tests/google/tel/live/TelLiveStressTest.py b/acts_tests/tests/google/tel/live/TelLiveStressTest.py
index 6f980c5..50db714 100644
--- a/acts_tests/tests/google/tel/live/TelLiveStressTest.py
+++ b/acts_tests/tests/google/tel/live/TelLiveStressTest.py
@@ -82,6 +82,7 @@
from acts_contrib.test_utils.tel.tel_test_utils import wait_for_data_connection
from acts_contrib.test_utils.tel.tel_test_utils import wait_for_in_call_active
from acts_contrib.test_utils.tel.tel_test_utils import is_current_data_on_cbrs
+from acts_contrib.test_utils.tel.tel_test_utils import check_voice_network_type
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_3g
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_2g
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb
@@ -194,6 +195,7 @@
"CALL_DROP_OR_WRONG_STATE_AFTER_CONNECTED": 0,
"CALL_HANGUP_FAIL": 0,
"CALL_ID_CLEANUP_FAIL": 0 }
+ self.call_stats_check = self.user_params.get("call_stats_check", False)
return True
def setup_test(self):
@@ -427,6 +429,12 @@
test_name = "%s_No_%s_phone_call" % (self.test_name, the_number)
log_msg = "[Test Case] %s" % test_name
self.log.info("%s for %s seconds begin", log_msg, duration)
+
+ if self.call_stats_check:
+ voice_type_init = check_voice_network_type(ads, voice_init=True)
+ else:
+ voice_type_init = None
+
begin_time = get_device_epoch_time(ads[0])
for ad in self.android_devices:
if self.user_params.get("turn_on_tcpdump", False):
@@ -463,7 +471,9 @@
self.log,
self.dut,
self.call_server_number,
- incall_ui_display=INCALL_UI_DISPLAY_BACKGROUND
+ incall_ui_display=INCALL_UI_DISPLAY_BACKGROUND,
+ call_stats_check=self.call_stats_check,
+ voice_type_init=voice_type_init
) and wait_for_in_call_active(self.dut, 60, 3)
else:
call_setup_result = call_setup_teardown(
@@ -475,7 +485,9 @@
verify_callee_func=call_verification_func,
wait_time_in_call=0,
incall_ui_display=INCALL_UI_DISPLAY_BACKGROUND,
- slot_id_callee=slot_id_callee)
+ slot_id_callee=slot_id_callee,
+ call_stats_check=self.call_stats_check,
+ voice_type_init=voice_type_init)
self.result_collection[RESULTS_LIST[call_setup_result.result_value]] += 1
if not call_setup_result: