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

Commit 5fee9aee authored by xshu's avatar xshu
Browse files

WifiManager: mark WPS related API calls deprecated

Bug: 72047245
Test: compile, run ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I1ac03e0729fea0ecc58785c94ebae28ba1523fd7
parent 1b3adf94
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -27281,7 +27281,7 @@ package android.net.wifi {
    method public int addNetwork(android.net.wifi.WifiConfiguration);
    method public void addOrUpdatePasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration);
    method public static int calculateSignalLevel(int, int);
    method public void cancelWps(android.net.wifi.WifiManager.WpsCallback);
    method public deprecated void cancelWps(android.net.wifi.WifiManager.WpsCallback);
    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);
@@ -27314,7 +27314,7 @@ package android.net.wifi {
    method public boolean setWifiEnabled(boolean);
    method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
    method public deprecated boolean startScan();
    method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
    method public deprecated void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
    method public int updateNetwork(android.net.wifi.WifiConfiguration);
    field public static final java.lang.String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
    field public static final java.lang.String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE = "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
@@ -27344,11 +27344,11 @@ package android.net.wifi {
    field public static final int WIFI_STATE_ENABLED = 3; // 0x3
    field public static final int WIFI_STATE_ENABLING = 2; // 0x2
    field public static final int WIFI_STATE_UNKNOWN = 4; // 0x4
    field public static final int WPS_AUTH_FAILURE = 6; // 0x6
    field public static final int WPS_OVERLAP_ERROR = 3; // 0x3
    field public static final int WPS_TIMED_OUT = 7; // 0x7
    field public static final int WPS_TKIP_ONLY_PROHIBITED = 5; // 0x5
    field public static final int WPS_WEP_PROHIBITED = 4; // 0x4
    field public static final deprecated int WPS_AUTH_FAILURE = 6; // 0x6
    field public static final deprecated int WPS_OVERLAP_ERROR = 3; // 0x3
    field public static final deprecated int WPS_TIMED_OUT = 7; // 0x7
    field public static final deprecated int WPS_TKIP_ONLY_PROHIBITED = 5; // 0x5
    field public static final deprecated int WPS_WEP_PROHIBITED = 4; // 0x4
  }
  public static class WifiManager.LocalOnlyHotspotCallback {
@@ -27382,11 +27382,11 @@ package android.net.wifi {
    method public void setWorkSource(android.os.WorkSource);
  }
  public static abstract class WifiManager.WpsCallback {
  public static abstract deprecated class WifiManager.WpsCallback {
    ctor public WifiManager.WpsCallback();
    method public abstract void onFailed(int);
    method public abstract void onStarted(java.lang.String);
    method public abstract void onSucceeded();
    method public abstract deprecated void onFailed(int);
    method public abstract deprecated void onStarted(java.lang.String);
    method public abstract deprecated void onSucceeded();
  }
  public class WpsInfo implements android.os.Parcelable {
+50 −15
Original line number Diff line number Diff line
@@ -1617,6 +1617,7 @@ public class WifiManager {
     *
     * @return hex-string encoded configuration token or null if there is no current network
     * @hide
     * @deprecated This API is deprecated
     */
    public String getCurrentNetworkWpsNfcConfigurationToken() {
        try {
@@ -2202,20 +2203,34 @@ public class WifiManager {
    /** @hide */
    public static final int SAVE_NETWORK_SUCCEEDED          = BASE + 9;

    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int START_WPS                       = BASE + 10;
    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int START_WPS_SUCCEEDED             = BASE + 11;
    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int WPS_FAILED                      = BASE + 12;
    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int WPS_COMPLETED                   = BASE + 13;

    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int CANCEL_WPS                      = BASE + 14;
    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int CANCEL_WPS_FAILED               = BASE + 15;
    /** @hide */
    /** @hide
     * @deprecated This is deprecated
     */
    public static final int CANCEL_WPS_SUCCEDED             = BASE + 16;

    /** @hide */
@@ -2255,15 +2270,25 @@ public class WifiManager {
    public static final int BUSY                        = 2;

    /* WPS specific errors */
    /** WPS overlap detected */
    /** WPS overlap detected
     * @deprecated This is deprecated
     */
    public static final int WPS_OVERLAP_ERROR           = 3;
    /** WEP on WPS is prohibited */
    /** WEP on WPS is prohibited
     * @deprecated This is deprecated
     */
    public static final int WPS_WEP_PROHIBITED          = 4;
    /** TKIP only prohibited */
    /** TKIP only prohibited
     * @deprecated This is deprecated
     */
    public static final int WPS_TKIP_ONLY_PROHIBITED    = 5;
    /** Authentication failure on WPS */
    /** Authentication failure on WPS
     * @deprecated This is deprecated
     */
    public static final int WPS_AUTH_FAILURE            = 6;
    /** WPS timed out */
    /** WPS timed out
     * @deprecated This is deprecated
     */
    public static final int WPS_TIMED_OUT               = 7;

    /**
@@ -2304,12 +2329,19 @@ public class WifiManager {
        public void onFailure(int reason);
    }

    /** Interface for callback invocation on a start WPS action */
    /** Interface for callback invocation on a start WPS action
     * @deprecated This is deprecated
     */
    public static abstract class WpsCallback {
        /** WPS start succeeded */

        /** WPS start succeeded
         * @deprecated This API is deprecated
         */
        public abstract void onStarted(String pin);

        /** WPS operation completed successfully */
        /** WPS operation completed successfully
         * @deprecated This API is deprecated
         */
        public abstract void onSucceeded();

        /**
@@ -2318,6 +2350,7 @@ public class WifiManager {
         * {@link #WPS_TKIP_ONLY_PROHIBITED}, {@link #WPS_OVERLAP_ERROR},
         * {@link #WPS_WEP_PROHIBITED}, {@link #WPS_TIMED_OUT} or {@link #WPS_AUTH_FAILURE}
         * and some generic errors.
         * @deprecated This API is deprecated
         */
        public abstract void onFailed(int reason);
    }
@@ -2911,6 +2944,7 @@ public class WifiManager {
     * @param listener for callbacks on success or failure. Can be null.
     * @throws IllegalStateException if the WifiManager instance needs to be
     * initialized again
     * @deprecated This API is deprecated
     */
    public void startWps(WpsInfo config, WpsCallback listener) {
        if (config == null) throw new IllegalArgumentException("config cannot be null");
@@ -2923,6 +2957,7 @@ public class WifiManager {
     * @param listener for callbacks on success or failure. Can be null.
     * @throws IllegalStateException if the WifiManager instance needs to be
     * initialized again
     * @deprecated This API is deprecated
     */
    public void cancelWps(WpsCallback listener) {
        getChannel().sendMessage(CANCEL_WPS, 0, putListener(listener));