summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.xml11
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java40
2 files changed, 36 insertions, 15 deletions
diff --git a/api/current.xml b/api/current.xml
index 7806c24..83b15bd 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -121010,6 +121010,17 @@
visibility="public"
>
</field>
+<field name="WIFI_MODE_FULL_HIGH_PERF"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="3"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="WIFI_MODE_SCAN_ONLY"
type="int"
transient="false"
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index d05918f..4ac03a8 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -356,16 +356,6 @@ public class WifiManager {
public static final String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
/**
- * In this Wi-Fi lock mode, Wi-Fi will behave as in the mode
- * {@link #WIFI_MODE_FULL} but it operates at high performance
- * at the expense of power. This mode should be used
- * only when the wifi connection needs to have minimum loss and low
- * latency as it can impact the battery life.
- * @hide
- */
- public static final int WIFI_MODE_FULL_HIGH_PERF = 3;
-
- /**
* In this Wi-Fi lock mode, Wi-Fi will be kept active,
* and will behave normally, i.e., it will attempt to automatically
* establish a connection to a remembered access point that is
@@ -383,10 +373,29 @@ public class WifiManager {
* an application in this mode.
*/
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.
+ * <p>
+ * 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.
+ * Holding a {@link #WIFI_MODE_FULL_HIGH_PERF} lock for the
+ * duration of the voice call will improve the call quality.
+ * <p>
+ * When there is no support from the hardware, this lock mode
+ * will have the same behavior as {@link #WIFI_MODE_FULL}
+ */
+ public static final int WIFI_MODE_FULL_HIGH_PERF = 3;
/** Anything worse than or equal to this will show 0 bars. */
private static final int MIN_RSSI = -100;
-
+
/** Anything better than or equal to this will show the max bars. */
private static final int MAX_RSSI = -55;
@@ -1288,9 +1297,10 @@ public class WifiManager {
* Creates a new WifiLock.
*
* @param lockType the type of lock to create. See {@link #WIFI_MODE_FULL},
- * and {@link #WIFI_MODE_SCAN_ONLY} 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
+ * {@link #WIFI_MODE_FULL_HIGH_PERF} and {@link #WIFI_MODE_SCAN_ONLY} 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
* holds multiple WifiLocks.
*
@@ -1301,7 +1311,7 @@ public class WifiManager {
public WifiLock createWifiLock(int lockType, String tag) {
return new WifiLock(lockType, tag);
}
-
+
/**
* Creates a new WifiLock.
*