OSDN Git Service

Expose fields in WifiConfiguration.
authorAmin Shaikh <ashaikh@google.com>
Fri, 6 Jan 2017 18:00:33 +0000 (10:00 -0800)
committerAmin Shaikh <ashaikh@google.com>
Mon, 9 Jan 2017 06:29:51 +0000 (22:29 -0800)
hasNoInternetAccess and isNoInternetAccessExpected are key signals needed
to determine whether Wi-Fi should be woken up for a given saved network.

Test: make
Bug: 33224312
Change-Id: I3f48735ebae72e15fbdb0a3057cf7c71fb0cc307

api/system-current.txt
wifi/java/android/net/wifi/WifiConfiguration.java

index 7a0f24c..b9125e5 100644 (file)
@@ -27279,6 +27279,8 @@ package android.net.wifi {
   public class WifiConfiguration implements android.os.Parcelable {
     ctor public WifiConfiguration();
     method public int describeContents();
+    method public boolean hasNoInternetAccess();
+    method public boolean isNoInternetAccessExpected();
     method public boolean isPasspoint();
     method public void writeToParcel(android.os.Parcel, int);
     field public java.lang.String BSSID;
index 3b7f721..958279b 100644 (file)
@@ -608,6 +608,7 @@ public class WifiConfiguration implements Parcelable {
      * if there has been a report of it having no internet access, and, it never have had
      * internet access in the past.
      */
+    @SystemApi
     public boolean hasNoInternetAccess() {
         return numNoInternetAccessReports > 0 && !validatedInternetAccess;
     }
@@ -621,6 +622,17 @@ public class WifiConfiguration implements Parcelable {
     public boolean noInternetAccessExpected;
 
     /**
+     * The WiFi configuration is expected not to have Internet access (e.g., a wireless printer, a
+     * Chromecast hotspot, etc.). This will be set if the user explicitly confirms a connection to
+     * this configuration and selects "don't ask again".
+     * @hide
+     */
+    @SystemApi
+    public boolean isNoInternetAccessExpected() {
+        return noInternetAccessExpected;
+    }
+
+    /**
      * @hide
      * Last time the system was connected to this configuration.
      */