def is_phone_in_call_2g_for_subscription(log, ad, sub_id): """Return if phone is in 2G call for subscription id. Args: ad: Android device object. sub_id: subscription id. """ if not ad.droid.telecomIsInCall(): ad.log.error("Not in call.") return False nw_gen = get_network_gen_for_subscription(log, ad, sub_id, NETWORK_SERVICE_VOICE) if nw_gen != GEN_2G: ad.log.error("Voice rat on: %s. Expected: 2g", nw_gen) return False return True
def is_phone_in_call_3g_for_subscription(log, ad, sub_id): """Return if phone is in 3G call for subscription id. Args: ad: Android device object. sub_id: subscription id. """ if not ad.droid.telecomIsInCall(): log.error("{} not in call.".format(ad.serial)) return False nw_gen = get_network_gen_for_subscription(log, ad, sub_id, NETWORK_SERVICE_VOICE) if nw_gen != GEN_3G: log.error("{} voice rat on: {}. Expected: 3g".format( ad.serial, nw_gen)) return False return True