summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFang Yunong <yunong@codeaurora.org>2016-07-02 12:29:51 +0800
committerLinux Build Service Account <lnxbuild@localhost>2016-08-24 08:08:00 -0600
commit0395f0fd6ce0488d90470322e77fa6fb8b3018da (patch)
tree47ca4e28159d829dd945921ece520d8f957973cf
parentd05213619e549580eebdc25517f290bc2f8eeee1 (diff)
downloadandroid_frameworks_opt_net_wifi-0395f0fd6ce0488d90470322e77fa6fb8b3018da.tar.gz
android_frameworks_opt_net_wifi-0395f0fd6ce0488d90470322e77fa6fb8b3018da.tar.bz2
android_frameworks_opt_net_wifi-0395f0fd6ce0488d90470322e77fa6fb8b3018da.zip
Hotspot: Add support to hide SSID for hotspot
From framework layer, needs to get/set wifi AP information from wifi AP configuration file for hidden SSID function and this function is controlled by one flag. Change-Id: I91849e470308eef43ad49666891ec4b3944e0e5b
-rw-r--r--service/java/com/android/server/wifi/WifiApConfigStore.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiApConfigStore.java b/service/java/com/android/server/wifi/WifiApConfigStore.java
index bcd8d03e9..57b7dc2da 100644
--- a/service/java/com/android/server/wifi/WifiApConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiApConfigStore.java
@@ -54,6 +54,8 @@ public class WifiApConfigStore {
private final String mApConfigFile;
private final BackupManagerProxy mBackupManagerProxy;
+ private static boolean mEnableRegionalHotspotCheckbox = false;
+
WifiApConfigStore(Context context, BackupManagerProxy backupManagerProxy) {
this(context, backupManagerProxy, DEFAULT_AP_CONFIG_FILE);
}
@@ -87,6 +89,11 @@ public class WifiApConfigStore {
/* Save the default configuration to persistent storage. */
writeApConfiguration(mApConfigFile, mWifiApConfig);
}
+ if (mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_regional_hotspot_show_broadcast_ssid_checkbox
+ )) {
+ mEnableRegionalHotspotCheckbox = true;
+ }
}
/**
@@ -135,6 +142,9 @@ public class WifiApConfigStore {
return null;
}
config.SSID = in.readUTF();
+ if (mEnableRegionalHotspotCheckbox) {
+ config.hiddenSSID = (in.readInt() != 0);
+ }
if (version >= 2) {
config.apBand = in.readInt();
@@ -170,6 +180,9 @@ public class WifiApConfigStore {
new FileOutputStream(filename)))) {
out.writeInt(AP_CONFIG_FILE_VERSION);
out.writeUTF(config.SSID);
+ if (mEnableRegionalHotspotCheckbox) {
+ out.writeInt(config.hiddenSSID ? 1 : 0);
+ }
out.writeInt(config.apBand);
out.writeInt(config.apChannel);
int authType = config.getAuthType();