מצב Wi-Fi עם אחזור נמוך

אנדרואיד 10 מרחיבה את ממשק ה-API של נעילת ה-Wi-Fi כדי לאפשר לאפליקציות הרגישות לזמן אחזור להגדיר את ה-Wi-Fi למצב השהייה נמוכה . מצב השהייה נמוכה מתחיל כאשר מתקיימים כל התנאים הבאים:

  • Wi-Fi מופעל ולמכשיר יש גישה לאינטרנט.
  • האפליקציה יצרה ורכשה מנעול Wi-Fi, והיא פועלת בחזית.
  • המסך דולק.

כדי לתמוך במצב השהייה נמוכה במכשירים, יצרני התקנים חייבים לעדכן את מנהל ההתקן של ה-WLAN ואת הספק HAL. במצב אחזור נמוך, חיסכון בחשמל (הידוע גם כמצב נמנום בתקן IEEE 802.11) מושבת במפורש על ידי המסגרת. ניתן לבצע אופטימיזציה של פרמטרי הסריקה והנדידה בשכבות הדרייבר והקושחה כדי להפחית עוד יותר את זמן האחזור של ה-Wi-Fi. האופטימיזציות המדויקות הן ספציפיות ליישום.

לאנדרואיד יש מצב נעילת Wi-Fi בעל ביצועים גבוהים (הוצג ברמת API 12) הנפרד ממצב השהייה נמוכה.

יישום

כדי לתמוך בתכונת מצב Wi-Fi עם אחזור נמוך, ספק יישומים עבור הפונקציות הבאות IWifiChip .

ב-AIDL HAL:

  • int getFeatureSet()
  • void setLatencyMode(in LatencyMode mode)

ב-HIDL HAL (1.3 ומעלה):

  • getCapabilities_1_3() generates (WifiStatus status, bitfield<ChipCapabilityMask> capabilities)
  • setLatencyMode(LatencyMode mode) generates (WifiStatus status)

ניתן למצוא יישום עזר ב- wifi_legacy_hal.cpp עם הפונקציות הבאות:

  • wifi_error wifi_get_supported_feature_set(wifi_interface_handle iface, feature_set *set)
  • wifi_error wifi_set_latency_mode(wifi_interface_handle handle, wifi_latency_mode mode)

במצב אחזור נמוך, חיסכון בחשמל מושבת במפורש על ידי WifiLockManager במסגרת Android. To support this, the WLAN driver must support the NL80211 command, NL80211_CMD_SET_POWER_SAVE , to enable and disable power save. When Wi-Fi power save is disabled, the Wi-Fi system must stay in the awake state and be ready to send or receive packets with minimum delay.

השבתת התכונה

כדי לכבות את תכונת מצב השהייה נמוכה, עדכן את הקוד הבסיסי של getFeatureSet() עבור AIDL HAL או getCapabilities_1_3() עבור HIDL HAL, כך ש- capabilities & SET_LATENCY_MODE = 0 , כאשר SET_LATENCY_MODE מוגדר בהגדרת IWifiChip AIDL או . When this feature is disabled, the framework disables power save only when the low-latency mode is active.

מַתַן תוֹקֵף

To test that low-latency mode works when enabled, run the following automated tests and manual ping latency tests.

בדיקות אוטומטיות

הפעל את מבחני VTS ו-CTS הבאים:

בדיקה ידנית

ציוד בדיקה וסביבה נדרשים

For manual testing, the following setup is required:

  • Wi-Fi access point (AP)
  • Device-under-test (DUT) phone and test computer

    • The DUT must be connected to the access point over Wi-Fi.
    • The test computer must be connected to the access point over Wi-Fi or Ethernet.
    • The test computer must be connected to the DUT over USB.
  1. Enable low latency mode.

    adb root
    adb shell cmd wifi force-low-latency-mode enabled
    
  2. Make sure your computer is connected with the phone through ADB. From the ADB shell, ping the gateway continuously for 3 hours at 1 second intervals.

  3. Save the test output in a text file and use a spreadsheet or a Python script to generate a histogram of the ping latency test results.

  4. Repeat steps 1 through 3 with latency mode disabled.

    adb root
    adb shell cmd wifi force-low-latency-mode disabled
    
  5. Compare the test results to ensure that the average ping latency value is reduced when the low-latency mode is enabled.

  1. Enable low-latency mode.

    adb root
    adb shell cmd wifi force-low-latency-mode enabled
    
  2. From the command line of the test computer, ping the phone's IP address continuously for 3 hours at 1 second intervals.

  3. Save the test output in a text file and use a spreadsheet or a Python script to generate a histogram of the ping latency test results.

  4. Repeat steps 1 through 3 with latency mode disabled.

    adb root
    adb shell cmd wifi force-low-latency-mode disabled
    
  5. השווה את תוצאות הבדיקה כדי להבטיח שערך האחזור הממוצע של הפינג מופחת כאשר מצב השהייה נמוכה מופעל.

בדיקות אחרות

חזור על הבדיקות לעיל בסביבות שונות. למשל, בבית או במשרד.