From 81b0ea6fc569ad87282f8a621e956d79e162923f Mon Sep 17 00:00:00 2001 From: lesl Date: Tue, 17 Mar 2020 14:55:56 +0800 Subject: wifi: LocalOnlyHotspot should not enable softap client timeout Update default config to disable auto shutdown Bug: 151639729 Test: atest frameworks/opt/net/wifi/tests/wifitests/ Test: atest android.net.wifi.cts.WifiManagerTest#testStartLocalOnlyHotspotSuccess and check the log Change-Id: Id7adf733facec02c9a4ef3b1f731d20cfd85fd06 --- service/java/com/android/server/wifi/WifiApConfigStore.java | 2 ++ tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java | 1 + 2 files changed, 3 insertions(+) diff --git a/service/java/com/android/server/wifi/WifiApConfigStore.java b/service/java/com/android/server/wifi/WifiApConfigStore.java index 660c99b30..3870fb413 100644 --- a/service/java/com/android/server/wifi/WifiApConfigStore.java +++ b/service/java/com/android/server/wifi/WifiApConfigStore.java @@ -370,6 +370,8 @@ public class WifiApConfigStore { configBuilder = new SoftApConfiguration.Builder(customConfig); } else { configBuilder = new SoftApConfiguration.Builder(); + // Default to disable the auto shutdown + configBuilder.setAutoShutdownEnabled(false); } configBuilder.setBand(apBand); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java index 02b53f5c8..bfa00cada 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java @@ -279,6 +279,7 @@ public class WifiApConfigStoreTest extends WifiBaseTest { assertEquals(SECURITY_TYPE_WPA2_PSK, config.getSecurityType()); } assertEquals(15, config.getPassphrase().length()); + assertFalse(config.isAutoShutdownEnabled()); } private void verifyDefaultLocalOnlyApConfig(SoftApConfiguration config, String expectedSsid, -- cgit v1.2.3