OSDN Git Service

wifi: Enhance WiFi Configuration to also include sim number.
authorSravanthi Palakonda <srapal@codeaurora.org>
Fri, 17 Jun 2016 14:00:02 +0000 (19:30 +0530)
committerLinux Build Service Account <lnxbuild@localhost>
Wed, 24 Aug 2016 14:15:05 +0000 (08:15 -0600)
For EAP SIM/AKA/AKA` authentication to happen on a specific SIM , the
SIM number has to be also a part of Wi-Fi configuration . This commit
ensures the same.

Change-Id: I3239c534bd8d221dc0af0174304427491a1d586b
CRs-Fixed: 1030715

wifi/java/android/net/wifi/WifiConfiguration.java

index 9d0c20c..6f20267 100644 (file)
@@ -69,6 +69,8 @@ public class WifiConfiguration implements Parcelable {
 
     /** {@hide} */
     private String mPasspointManagementObjectTree;
+    /** {@hide} */
+    public static final String SIMNumVarName = "sim_num";
 
     /**
      * Recognized key management schemes.
@@ -448,6 +450,12 @@ public class WifiConfiguration implements Parcelable {
 
     /**
      * @hide
+     * sim number selected
+     */
+    public int SIMNum;
+
+    /**
+     * @hide
      * Status of user approval for connection
      */
     public int userApproved = USER_UNSPECIFIED;
@@ -1350,6 +1358,7 @@ public class WifiConfiguration implements Parcelable {
         creatorUid = -1;
         shared = true;
         dtimInterval = 0;
+        SIMNum = 0;
     }
 
     /**
@@ -1511,6 +1520,10 @@ public class WifiConfiguration implements Parcelable {
         if (this.preSharedKey != null) {
             sbuf.append('*');
         }
+        sbuf.append('\n').append(" sim_num ");
+        if (this.SIMNum > 0 ) {
+            sbuf.append('*');
+        }
         sbuf.append("\nEnterprise config:\n");
         sbuf.append(enterpriseConfig);
 
@@ -1907,6 +1920,7 @@ public class WifiConfiguration implements Parcelable {
             creationTime = source.creationTime;
             updateTime = source.updateTime;
             shared = source.shared;
+            SIMNum = source.SIMNum;
         }
     }
 
@@ -1977,6 +1991,7 @@ public class WifiConfiguration implements Parcelable {
         dest.writeInt(noInternetAccessExpected ? 1 : 0);
         dest.writeInt(shared ? 1 : 0);
         dest.writeString(mPasspointManagementObjectTree);
+        dest.writeInt(SIMNum);
     }
 
     /** Implement the Parcelable interface {@hide} */
@@ -2048,6 +2063,7 @@ public class WifiConfiguration implements Parcelable {
                 config.noInternetAccessExpected = in.readInt() != 0;
                 config.shared = in.readInt() != 0;
                 config.mPasspointManagementObjectTree = in.readString();
+                config.SIMNum = in.readInt();
                 return config;
             }