summaryrefslogtreecommitdiffstats
path: root/wifi/java/android
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-02-16 12:13:59 -0800
committerIrfan Sheriff <isheriff@google.com>2011-02-16 14:28:45 -0800
commit652bc96444b0a82d34e6c3766b7862effac11adb (patch)
tree9b87050d52869ca1591a655f534c6ee9c674426a /wifi/java/android
parent439f5c6b39fe648da835d4c86dfcffed0f46dd94 (diff)
downloadframeworks_base-652bc96444b0a82d34e6c3766b7862effac11adb.zip
frameworks_base-652bc96444b0a82d34e6c3766b7862effac11adb.tar.gz
frameworks_base-652bc96444b0a82d34e6c3766b7862effac11adb.tar.bz2
Make high performance wifi lock public
gtalk and sip already use the high perf lock. Improve the comments and make the constant public. This will allow applications that use voice or video to keep the connection good even when device screen is off Change-Id: I3608cd478175c773bd835b26a686a61b8baf5471
Diffstat (limited to 'wifi/java/android')
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java40
1 files changed, 25 insertions, 15 deletions
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.
*