summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-06-29 14:37:55 -0700
committerRebecca Silberstein <silberst@google.com>2017-07-05 17:39:32 +0000
commit5c5b37f9cc52daff34b8509dbda68e754fbbcacb (patch)
tree062866f356b31f4e7bab083434e345f1e130ea26 /service
parent2f09c3602b5207d8e8a46b7b9fabe17b42b02315 (diff)
SoftApManager: support hidden ap configs
WifiConfigurations for hostapd may set the hiddenSSID flag to true, intending to start softap without advertising the network. While this is not a valid option through the UI, it can be very useful in a test environment. This CL adds support to start hostapd with the hidden network flag set. Note: an integration test will be added to verify the behavior, but this requires additional plumbing in the test code. Tracking that work with Bug 63141761. Bug: 34209778 Test: ran modified integration test to verify the ssid is not broadcast Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If5fef73bc069f155572257e4a9c81efd00dccacf
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/SoftApManager.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java
index 64f4a1494..d4a1ea508 100644
--- a/service/java/com/android/server/wifi/SoftApManager.java
+++ b/service/java/com/android/server/wifi/SoftApManager.java
@@ -161,12 +161,16 @@ public class SoftApManager implements ActiveModeManager {
int encryptionType = getIApInterfaceEncryptionType(localConfig);
+ if (localConfig.hiddenSSID) {
+ Log.d(TAG, "SoftAP is a hidden network");
+ }
+
try {
// Note that localConfig.SSID is intended to be either a hex string or "double quoted".
// However, it seems that whatever is handing us these configurations does not obey
// this convention.
boolean success = mApInterface.writeHostapdConfig(
- localConfig.SSID.getBytes(StandardCharsets.UTF_8), false,
+ localConfig.SSID.getBytes(StandardCharsets.UTF_8), localConfig.hiddenSSID,
localConfig.apChannel, encryptionType,
(localConfig.preSharedKey != null)
? localConfig.preSharedKey.getBytes(StandardCharsets.UTF_8)