Android 10은 Wi-Fi 잠금 API를 확장하여 지연 시간에 민감한 앱이 Wi-Fi를 지연 시간이 짧은 모드로 구성할 수 있도록 합니다.
지연 시간이 짧은 모드는 다음 조건이 모두 충족될 때 시작됩니다.
Wi-Fi가 사용 설정되었으며 기기가 인터넷에 액세스할 수 있습니다.
앱이 Wi-Fi 잠금을 생성하고 획득했으며 포그라운드에서 실행 중입니다.
화면이 켜져 있습니다.
기기에서 지연 시간이 짧은 모드를 지원할 수 있으려면 기기 제조업체에서 WLAN 드라이버 및 공급업체 HAL을 업데이트해야 합니다. 지연 시간이 짧은 모드에서는 절전 모드(IEEE 802.11 표준에서는 잠자기 상태라고도 함)가 프레임워크에 의해 명시적으로 사용 중지됩니다.
드라이버 및 펌웨어 레이어의 검색 및 로밍 매개변수를 최적화하면 Wi-Fi 지연 시간을 더욱 단축할 수 있습니다. 정확한 최적화는 구현에 따라 다릅니다.
Android에는 지연 시간이 짧은 모드와 별도로, 고성능 Wi-Fi 잠금 모드(API 수준 12에서 도입됨)가 있습니다.
구현
Wi-Fi 저지연 모드 기능을 지원하려면 다음 IWifiChip 함수에 대한 구현을 제공하세요.
지연 시간이 짧은 모드에서는 절전 모드가 Android 프레임워크의 WifiLockManager에 의해 명시적으로 사용 중지됩니다.
이 기능을 지원하려면 WLAN 드라이버에서 절전 모드를 사용 설정 및 사용 중지할 수 있도록 NL80211 명령어 NL80211_CMD_SET_POWER_SAVE를 지원해야 합니다. Wi-Fi 절전 모드가 사용 중지될 때 Wi-Fi 시스템은 켜진 상태로 유지되고 최소한의 지연으로 패킷을 보내거나 받을 준비가 되어 있어야 합니다.
기능 사용 중지
저지연 모드 기능을 사용 중지하려면 AIDL HAL의 경우 getFeatureSet(), HIDL HAL의 경우 getCapabilities_1_3()의 기본 코드를 capabilities & SET_LATENCY_MODE = 0와 같이 업데이트합니다. 여기서 SET_LATENCY_MODE는 IWifiChip AIDL 또는 HIDL에 정의되어 있습니다.
이 기능을 사용 중지하면 프레임워크는 저지연 모드가 활성 상태일 때만 절전 모드를 사용 중지합니다.
유효성 검사
지연 시간이 짧은 모드가 사용 설정되었을 때 작동하는지 테스트하려면 다음과 같은 자동화된 테스트 및 수동 핑 지연 시간 테스트를 실행하세요.
테스트 결과를 비교하여 지연 시간이 짧은 모드가 사용 설정되었을 때 핑 지연 시간 평균값이 감소하였는지 확인합니다.
기타 테스트
다른 환경에서 위 테스트를 반복합니다. 예를 들어 집이나 사무실에서 테스트를 반복합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Wi-Fi low-latency mode\n\nAndroid 10 extends the Wi-Fi lock API to allow\nlatency-sensitive apps to configure Wi-Fi to a\n[low-latency\nmode](https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY).\nThe low-latency mode starts when all of the following conditions are met:\n\n- Wi-Fi is enabled and the device has internet access.\n- The app has created and acquired a Wi-Fi lock, and is running in the foreground.\n- The screen is on.\n\nTo support low-latency mode on devices, device manufacturers must update the\nWLAN driver and vendor HAL. In low-latency mode, power save (also known as\ndoze state in the IEEE 802.11 standard) is explicitly disabled by the framework.\nThe scanning and roaming parameters in the driver and firmware layers can be\noptimized to further reduce Wi-Fi latency. The exact optimizations are\nimplementation specific.\n\nAndroid has a\n[high-performance Wi-Fi lock mode](https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF)\n(introduced in API level 12) that is separate from the low-latency mode.\n\nImplementation\n--------------\n\nTo support the Wi-Fi low-latency mode feature, provide implementations for\nthe following `IWifiChip` functions.\n\nIn the AIDL HAL:\n\n- `int getFeatureSet()`\n- `void setLatencyMode(in LatencyMode mode)`\n\nIn the HIDL HAL (1.3 or newer):\n\n- `getCapabilities_1_3() generates (WifiStatus status,\n bitfield\u003cChipCapabilityMask\u003e capabilities)`\n- `setLatencyMode(LatencyMode mode) generates (WifiStatus status)`\n\nA reference implementation can be found in\n[`wifi_legacy_hal.cpp`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/wifi/aidl/default/wifi_legacy_hal.cpp)\nwith the following functions:\n\n- `wifi_error wifi_get_supported_feature_set(wifi_interface_handle\n iface, feature_set *set)`\n- `wifi_error wifi_set_latency_mode(wifi_interface_handle handle,\n wifi_latency_mode mode)`\n\nIn low-latency mode, power save is explicitly disabled by\n[`WifiLockManager`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Wifi/service/java/com/android/server/wifi/WifiLockManager.java)\nin the Android framework.\nTo support this, the WLAN driver must support the NL80211 command,\n`NL80211_CMD_SET_POWER_SAVE`, to enable and disable power save. When Wi-Fi power\nsave is disabled, the Wi-Fi system must stay in the awake state and be ready to\nsend or receive packets with minimum delay.\n| **Note:** Low-latency mode is fully supported on devices that support the AIDL HAL, or the HIDL HAL (1.3 or newer). For devices running Android 10 that don't support `android.hardware.wifi@1.3`, `WifiLockManager` only disables power save when the low-latency mode Wi-Fi lock is acquired by the app and is active.\n\nDisable the feature\n-------------------\n\nTo turn off the low-latency mode feature, update the underlying code of\n`getFeatureSet()` for the AIDL HAL or\n`getCapabilities_1_3()` for the HIDL HAL,\nsuch that `capabilities & SET_LATENCY_MODE = 0`, where\n`SET_LATENCY_MODE` is defined in the `IWifiChip` AIDL or HIDL definition.\nWhen this feature is disabled,\nthe framework disables power save only when the low-latency mode is active.\n\nValidation\n----------\n\nTo test that low-latency mode works when enabled, run the following automated\ntests and manual ping latency tests.\n\n### Automated testing\n\nRun the following VTS and CTS tests:\n\n- VTS (AIDL): [`hardware/interfaces/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp)\n- VTS (HIDL): [`hardware/interfaces/wifi/1.3/vts/functional/wifi_chip_hidl_test.cpp`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/wifi/1.3/vts/functional/wifi_chip_hidl_test.cpp)\n- CTS: [`cts/tests/tests/net/src/android/net/wifi/cts/WifiLockTest.java`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/tests/tests/wifi/src/android/net/wifi/cts/WifiLockTest.java)\n\n### Manual testing\n\n#### Required test equipment and environment\n\nFor manual testing, the following setup is required:\n\n- Wi-Fi access point (AP)\n- Device-under-test (DUT) phone and test computer\n\n - The DUT must be connected to the access point over Wi-Fi.\n - The test computer must be connected to the access point over Wi-Fi or Ethernet.\n - The test computer must be connected to the DUT over USB.\n\n#### Uplink ping test\n\n1. Enable low latency mode.\n\n adb root\n adb shell cmd wifi force-low-latency-mode enabled\n\n2. Make sure your computer is connected with the phone through ADB. From\n the ADB shell, ping the gateway continuously for 3 hours at 1 second\n intervals.\n\n3. Save the test output in a text file and use a spreadsheet or a Python\n script to generate a histogram of the ping latency test results.\n\n4. Repeat steps 1 through 3 with latency mode disabled.\n\n adb root\n adb shell cmd wifi force-low-latency-mode disabled\n\n5. Compare the test results to ensure that the average ping latency value is\n reduced when the low-latency mode is enabled.\n\n| **Note:** Optionally, to determine whether end-to-end latency has improved overall, repeat the test using a well-known host address such as google.com.\n\n#### Downlink ping test\n\n1. Enable low-latency mode.\n\n adb root\n adb shell cmd wifi force-low-latency-mode enabled\n\n2. From the command line of the test computer, ping the phone's IP\n address continuously for 3 hours at 1 second intervals.\n\n3. Save the test output in a text file and use a spreadsheet or a Python\n script to generate a histogram of the ping latency test results.\n\n4. Repeat steps 1 through 3 with latency mode disabled.\n\n adb root\n adb shell cmd wifi force-low-latency-mode disabled\n\n5. Compare the test results to ensure that the average ping latency value is\n reduced when the low-latency mode is enabled.\n\n| **Note:** Optionally, to determine whether end-to-end latency is improved, repeat the ping test with a well-known host address such as google.com.\n\n#### Other tests\n\nRepeat the above tests in different environments. For example, at\nhome or in the office."]]