Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 652bc964 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

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
parent 439f5c6b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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"
+25 −15
Original line number Diff line number Diff line
@@ -355,16 +355,6 @@ public class WifiManager {
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    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
@@ -383,6 +373,25 @@ 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;
@@ -1288,7 +1297,8 @@ 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.
     * {@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