diff --git a/api/current.txt b/api/current.txt index 079539e3c5f49..03e01604a4834 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29062,7 +29062,7 @@ package android.net.wifi { method public static int compareSignalLevel(int, int); method public android.net.wifi.WifiManager.MulticastLock createMulticastLock(java.lang.String); method public android.net.wifi.WifiManager.WifiLock createWifiLock(int, java.lang.String); - method public android.net.wifi.WifiManager.WifiLock createWifiLock(java.lang.String); + method public deprecated android.net.wifi.WifiManager.WifiLock createWifiLock(java.lang.String); method public deprecated boolean disableNetwork(int); method public deprecated boolean disconnect(); method public deprecated boolean enableNetwork(int, boolean); @@ -29124,9 +29124,10 @@ package android.net.wifi { field public static final int STATUS_NETWORK_SUGGESTIONS_SUCCESS = 0; // 0x0 field public static final deprecated java.lang.String SUPPLICANT_CONNECTION_CHANGE_ACTION = "android.net.wifi.supplicant.CONNECTION_CHANGE"; field public static final deprecated java.lang.String SUPPLICANT_STATE_CHANGED_ACTION = "android.net.wifi.supplicant.STATE_CHANGE"; - field public static final int WIFI_MODE_FULL = 1; // 0x1 + field public static final deprecated int WIFI_MODE_FULL = 1; // 0x1 field public static final int WIFI_MODE_FULL_HIGH_PERF = 3; // 0x3 - field public static final int WIFI_MODE_SCAN_ONLY = 2; // 0x2 + field public static final int WIFI_MODE_FULL_LOW_LATENCY = 4; // 0x4 + field public static final deprecated int WIFI_MODE_SCAN_ONLY = 2; // 0x2 field public static final java.lang.String WIFI_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_STATE_CHANGED"; field public static final int WIFI_STATE_DISABLED = 1; // 0x1 field public static final int WIFI_STATE_DISABLING = 0; // 0x0 diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 9789319ed6b9c..8e0d4acf089dc 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -953,8 +953,12 @@ public class WifiManager { * establish a connection to a remembered access point that is * within range, and will do periodic scans if there are remembered * access points but none are in range. + * + * @deprecated This API is non-functional and will have no impact. */ + @Deprecated public static final int WIFI_MODE_FULL = 1; + /** * In this Wi-Fi lock mode, Wi-Fi will be kept active, * but the only operation that will be supported is initiation of @@ -963,28 +967,62 @@ public class WifiManager { * nor will periodic scans be automatically performed looking for * remembered access points. Scans must be explicitly requested by * an application in this mode. + * + * @deprecated This API is non-functional and will have no impact. */ + @Deprecated public static final int WIFI_MODE_SCAN_ONLY = 2; + /** - * In this Wi-Fi lock mode, Wi-Fi will be kept active as in mode - * {@link #WIFI_MODE_FULL} but it operates at high performance - * with minimum packet loss and low packet latency even when - * the device screen is off. This mode will consume more power - * and hence should be used only when there is a need for such - * an active connection. + * In this Wi-Fi lock mode, Wi-Fi will not go to power save. + * This results in operating with low packet latency. + * The lock is active even when the device screen is off or + * the acquiring application is running in the background. + * This mode will consume more power and hence should be used only + * when there is a need for this tradeoff. *

* An example use case is when a voice connection needs to be - * kept active even after the device screen goes off. Holding the - * regular {@link #WIFI_MODE_FULL} lock will keep the wifi - * connection active, but the connection can be lossy. + * kept active even after the device screen goes off. * Holding a {@link #WIFI_MODE_FULL_HIGH_PERF} lock for the - * duration of the voice call will improve the call quality. + * duration of the voice call may improve the call quality. *

- * When there is no support from the hardware, this lock mode - * will have the same behavior as {@link #WIFI_MODE_FULL} + * When there is no support from the hardware, the {@link #WIFI_MODE_FULL_HIGH_PERF} + * lock will have no impact. */ public static final int WIFI_MODE_FULL_HIGH_PERF = 3; + /** + * In this Wi-Fi lock mode, Wi-Fi will operate with a priority to achieve low latency. + * {@link #WIFI_MODE_FULL_LOW_LATENCY} lock has the following limitations: + *

    + *
  1. The lock is only active when the screen is on.
  2. + *
  3. The lock is only active when the acquiring app is running in the foreground.
  4. + *
+ * Low latency mode optimizes for reduced packet latency, + * and as a result other performance measures may suffer when there are trade-offs to make: + *
    + *
  1. Battery life may be reduced.
  2. + *
  3. Throughput may be reduced.
  4. + *
  5. Frequency of Wi-Fi scanning may be reduced. This may result in:
  6. + * + *
+ *

+ * Example use cases are real time gaming or virtual reality applications where + * low latency is a key factor for user experience. + *

+ * When there is no support from the hardware, the {@link #WIFI_MODE_FULL_LOW_LATENCY} + * lock will cause the device not to go power save. + *

+ * Note: For an app which acquires both {@link #WIFI_MODE_FULL_LOW_LATENCY} and + * {@link #WIFI_MODE_FULL_HIGH_PERF} locks, {@link #WIFI_MODE_FULL_LOW_LATENCY} + * lock will be effective when app is running in foreground and screen is on, + * while the {@link #WIFI_MODE_FULL_HIGH_PERF} lock will take effect otherwise. + */ + public static final int WIFI_MODE_FULL_LOW_LATENCY = 4; + /** Anything worse than or equal to this will show 0 bars. */ @UnsupportedAppUsage private static final int MIN_RSSI = -100; @@ -3830,9 +3868,8 @@ public class WifiManager { /** * Creates a new WifiLock. * - * @param lockType the type of lock to create. See {@link #WIFI_MODE_FULL}, - * {@link #WIFI_MODE_FULL_HIGH_PERF} and {@link #WIFI_MODE_SCAN_ONLY} for - * descriptions of the types of Wi-Fi locks. + * @param lockType the type of lock to create. See {@link #WIFI_MODE_FULL_HIGH_PERF} + * and {@link #WIFI_MODE_FULL_LOW_LATENCY} for descriptions of the types of Wi-Fi locks. * @param tag a tag for the WifiLock to identify it in debugging messages. This string is * never shown to the user under normal conditions, but should be descriptive * enough to identify your application and the specific WifiLock within it, if it @@ -3857,12 +3894,14 @@ public class WifiManager { * @return a new, unacquired WifiLock with the given tag. * * @see WifiLock + * + * @deprecated This API is non-functional. */ + @Deprecated public WifiLock createWifiLock(String tag) { return new WifiLock(WIFI_MODE_FULL, tag); } - /** * Create a new MulticastLock *