From fe4d392358829cd9698e287a013431f4e4e8968e Mon Sep 17 00:00:00 2001 From: xshu Date: Mon, 14 Sep 2020 22:25:52 -0700 Subject: [PATCH] New recent failure reason for MBO To support displaying MBO failure reason in wifi picker UI. Bug: 155697192 Test: atest android.net.wifi Change-Id: I953d46c0fe55e174df5879107ee683a640233e5b --- api/system-current.txt | 1 + wifi/api/system-current.txt | 1 + wifi/java/android/net/wifi/WifiConfiguration.java | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/api/system-current.txt b/api/system-current.txt index c3e56643a8055..36acc01a1aa55 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -7208,6 +7208,7 @@ package android.net.wifi { field @Deprecated public static final int RANDOMIZATION_NONE = 0; // 0x0 field @Deprecated public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1 field @Deprecated public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17; // 0x11 + field @Deprecated public static final int RECENT_FAILURE_MBO_OCE_DISCONNECT = 1001; // 0x3e9 field @Deprecated public static final int RECENT_FAILURE_NONE = 0; // 0x0 field @Deprecated public boolean allowAutojoin; field @Deprecated public int carrierId; diff --git a/wifi/api/system-current.txt b/wifi/api/system-current.txt index eff64a31367aa..c9e2616500a64 100644 --- a/wifi/api/system-current.txt +++ b/wifi/api/system-current.txt @@ -331,6 +331,7 @@ package android.net.wifi { field @Deprecated public static final int RANDOMIZATION_NONE = 0; // 0x0 field @Deprecated public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1 field @Deprecated public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17; // 0x11 + field @Deprecated public static final int RECENT_FAILURE_MBO_OCE_DISCONNECT = 1001; // 0x3e9 field @Deprecated public static final int RECENT_FAILURE_NONE = 0; // 0x0 field @Deprecated public boolean allowAutojoin; field @Deprecated public int carrierId; diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 1588bf72c9694..a493620b738f6 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -2037,7 +2037,8 @@ public class WifiConfiguration implements Parcelable { @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = "RECENT_FAILURE_", value = { RECENT_FAILURE_NONE, - RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA}) + RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA, + RECENT_FAILURE_MBO_OCE_DISCONNECT}) public @interface RecentFailureReason {} /** @@ -2054,6 +2055,13 @@ public class WifiConfiguration implements Parcelable { @SystemApi public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17; + /** + * This network recently disconnected as a result of MBO/OCE. + * @hide + */ + @SystemApi + public static final int RECENT_FAILURE_MBO_OCE_DISCONNECT = 1001; + /** * Get the failure reason for the most recent connection attempt, or * {@link #RECENT_FAILURE_NONE} if there was no failure.