diff options
author | 2025-03-19 16:30:52 -0700 | |
---|---|---|
committer | 2025-03-19 16:30:52 -0700 | |
commit | 91a0bc648f55263ac504dcd8dfece062a053c092 (patch) | |
tree | 8033ff1fc5cd9037e48e9db2c3dec137bcfaf1ce | |
parent | 929bd716f6b3a4fa81f48f0413a10f05a1bcb171 (diff) | |
parent | d65e6affdb335bbea1faa0c1c46df8fd75a12bcd (diff) |
Merge "Allow fulfill approved request even screen off" into main
-rw-r--r-- | service/java/com/android/server/wifi/WifiNetworkFactory.java | 8 | ||||
-rw-r--r-- | service/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java index f29eb75cf6..ec4a5ca353 100644 --- a/service/java/com/android/server/wifi/WifiNetworkFactory.java +++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java @@ -1347,6 +1347,14 @@ public class WifiNetworkFactory extends NetworkFactory { // If there is no active request or if the user has already selected a network, // ignore screen state changes. if (mActiveSpecificNetworkRequest == null || !mIsPeriodicScanEnabled) return; + if (mSkipUserDialogue) { + // Allow App which bypass the user approval to fulfill the request during screen off. + return; + } + if (screenOn != mIsPeriodicScanPaused) { + // already at the expected state + return; + } // Pause periodic scans when the screen is off & resume when the screen is on. if (screenOn) { diff --git a/service/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java b/service/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java index 21aba31784..329a7a8ef0 100644 --- a/service/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java +++ b/service/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java @@ -3342,6 +3342,7 @@ public class WifiNetworkFactoryTest extends WifiBaseTest { WifiConfigurationTestUtil.createPskNetwork(), TEST_UID_1, TEST_PACKAGE_NAME_1, new int[0]); mWifiNetworkFactory.needNetworkFor(mNetworkRequest); + setScreenState(false); // Verify we did not trigger the UI for the second request. verify(mContext, never()).startActivityAsUser(any(), any()); |