For devices running Android 11 or higher, the Android Comms Test Suite (ACTS) supports core 5G NSA use cases for single and multi-device environments. This page covers how ACTS detects and ensures a device is connected to a 5G NSA network and gives you an overview of the test path structure
Detection
From Android 11, the Android framework includes APIs to detect 5G. For more details, see 5G detection.
Scripting Layer For Android (SL4A) supports 5G detection by listening for
LISTEN_DISPLAY_INFO_CHANGED
events from PhoneStateListener
and overriding the
onDisplayInfoChanged()
method. SL4A uses the following values to distinguish between NSA (non
standalone), mmWave (millimeter wave) and SA (standalone) connection types for
5G:
Connection type | Values |
---|---|
5G NSA | TelephonyManager.getDataNetworkType() = LTE |
5G mmWave | TelephonyDisplayInfo.getOverrideNetworkType() = NR_MMWAVE |
5G SA | TelephonyManager.getDataNetworkType() = NR |
ACTS tests use the
is_current_network_5g_nsa()
method to ensure the device is connected to a 5G NSA network
Test paths and test structure
All telephony tests (1400+) in ACTS are part of
the tel
directory.
5G tests are located in the
tools/test/connectivity/acts\_tests/tests/google/nr/
directory
(nr stands for new radio). With the introduction of 5G radio access technology
(RAT), 5G tests are separate from 4G, 3G, 2G and 1x for live network
environments to allow ACTS tests to be scalable and independent.
The following describes test classes for 5G tests.
Nsa5gActivationTest
: Verifies whether a single device correctly connects to 5G NSA from various states.test_5g_nsa_activation_from_apm test_5g_nsa_activation_from_reboot test_5g_nsa_activation_from_3g
Nsa5gVoiceTest
: Verifies voice calling functionality between multiple devices.test_5g_nsa_call_volte_to_volte test_5g_nsa_call_volte_to_3g test_5g_nsa_call_volte_mo_hold_unhold test_5g_nsa_call_mo_volte_in_active_data_transfer test_5g_nsa_volte_in_call_wifi_toggling
Nsa5gDataTest
: Verifies data functionality such as browsing, data stall, and meteredness.test_5g_nsa_data_browsing test_5g_nsa_data_stall_recovery test_5g_nsa_metered_cellular test_5g_nsa_metered_airplane test_5g_nsa_metered_wifi
Nsa5gSmsTest
: Verifies sending and receiving of SMS messages between multiple devices.test_5g_nsa_sms_mo_mt test_5g_nsa_sms_mo_mt_volte test_5g_nsa_sms_mo_mt_in_call_volte test_5g_nsa_sms_mo_mt_iwlan test_5g_nsa_sms_mo_mt_in_call_iwlan
Nsa5gMmsTest
: Verifies sending and receiving MMS messages between multiple devices.test_5g_nsa_mms_mo_mt test_5g_nsa_mms_mo_mt_in_call_volte test_5g_nsa_mms_mo_mt_iwlan_apm_off test_5g_nsa_mms_mo_mt_in_call_iwlan test_5g_nsa_mms_mo_mt_in_call_volte_wifi
Nsa5gTetheringTest
: Verifies Wi-Fi tethering over a device connected to 5G NSA.test_5g_nsa_tethering_to_5gwifi test_5g_nsa_tethering_to_2gwifi
Sample test output
To confirm a device is on 5G NSA, check for the following log messages in
test_run_info.txt
.
INFO [AndroidDevice|<SERIAL_ID>] Current ModePref for Sub 2 is in
NETWORK_MODE_NR_LTE_GSM_WCDMA [tel_test_utils.py:set_preferred_network_mode_pref:7634]
INFO [AndroidDevice|<SERIAL_ID>] Got expected event {'name': 'DisplayInfoChanged',
'data': {'override': 'NR_NSA', 'network': 'LTE', 'subscriptionId': 2147483647},
'time': 1611094526689} [tel_5g_utils.py:is_current_network_5g_nsa:58]
Troubleshooting
To triage the API response without running an ACTS test during failure, use the following commands:
>> python3
>> from acts.controllers.android_device import AndroidDevice; ad = AndroidDevice('<SERIAL_ID>'); a, b = ad.get_droid()
>> a.telephonyStartTrackingDisplayInfoChange()
>> b.start()
>> b.wait_for_event("DisplayInfoChanged", lambda _: True, timeout=30)
{'name': 'DisplayInfoChanged', 'data': 'TelephonyDisplayInfo {network=LTE, override=LTE_CA, 'time': 1586483596907}