Exemplo n.º 1
0
 def _check_csfb_enabled(self):
     if not call_setup_teardown(self.log, self.dut, self.ad_reference,
                                self.dut, is_phone_in_call_csfb):
         self.log.error("CSFB Call Failed.")
         return False
     if not wait_for_network_generation(
             self.log, self.dut, GEN_4G,
             voice_or_data=NETWORK_SERVICE_DATA):
         self.dut.log.error("Data service failed to camp to 4G")
         return False
     if not verify_internet_connection(self.log, self.dut):
         self.log.error("Data not available on cell.")
         return False
     return True
Exemplo n.º 2
0
def phone_setup_iwlan_cellular_preferred(log,
                                         ad,
                                         wifi_ssid=None,
                                         wifi_pwd=None):
    """Phone setup function for iwlan Non-APM CELLULAR_PREFERRED test.
    Set WFC mode according to CELLULAR_PREFERRED.
    Set airplane mode according to False.
    Make sure phone connect to WiFi. (If wifi_ssid is not None.)
    Make sure phone don't report iwlan data network type.
    Make sure phone don't report wfc enabled flag to be true.

    Args:
        log: Log object.
        ad: Android device object.
        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.
    """
    toggle_airplane_mode(log, ad, False, strict_checking=False)
    try:
        toggle_volte(log, ad, True)
        if not wait_for_network_generation(
                log, ad, GEN_4G, voice_or_data=NETWORK_SERVICE_DATA):
            if not ensure_network_generation(
                    log, ad, GEN_4G, voice_or_data=NETWORK_SERVICE_DATA):
                ad.log.error("Fail to ensure data in 4G")
                return False
    except Exception as e:
        ad.log.error(e)
        ad.droid.telephonyToggleDataConnection(True)
    if wifi_ssid is not None:
        if not ensure_wifi_connected(log, ad, wifi_ssid, wifi_pwd):
            ad.log.error("Connect to WiFi failed.")
            return False
    if not set_wfc_mode(log, ad, WFC_MODE_CELLULAR_PREFERRED):
        ad.log.error("Set WFC mode failed.")
        return False
    if not wait_for_not_network_rat(
            log, ad, RAT_FAMILY_WLAN, voice_or_data=NETWORK_SERVICE_DATA):
        ad.log.error("Data rat in iwlan mode.")
        return False
    elif not wait_for_wfc_disabled(log, ad, MAX_WAIT_TIME_WFC_ENABLED):
        ad.log.error("Should report wifi calling disabled within %s.",
                     MAX_WAIT_TIME_WFC_ENABLED)
        return False
    return True
def phone_idle_video_for_subscription(log, ad, sub_id):
    """Return if phone (sub_id) is idle for video call.

    Args:
        log: log object.
        ad: android device object
        sub_id: ad's sub id

    Returns:
        True if ad (sub_id) is idle for video call.
    """

    if not wait_for_network_generation(log, ad, GEN_4G):
        log.error("{} voice not in LTE mode.".format(ad.serial))
        return False

    if not wait_for_video_enabled(log, ad, MAX_WAIT_TIME_VOLTE_ENABLED):
        log.error(
            "{} failed to <report video calling enabled> within {}s.".format(
                ad.serial, MAX_WAIT_TIME_VOLTE_ENABLED))
        return False
    return True