summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2020-05-27 10:49:20 -0700
committerRoshan Pius <rpius@google.com>2020-05-27 11:10:17 -0700
commit2643b8eef2007c18d2e0e7d722e0372858bc66ed (patch)
tree33d8c1504d3516646903e431c89cc29819fc261e /service
parentc11cd31f25516662ea9a8d6b774d9e591a3fda91 (diff)
WifiWakeup: Ignore wakeup start if no saved networks or suggestions
If there are no saved networks or suggestions, there is no use of starting wifi wake feature. So, gate the feature start based on whether any saved networks are present on the device or not. This also works around a race in the wake initialization/deinitialization sequence on a freshly wiped device. This quick initialization/deinitialization causes the device to not show the notification on enabling the feature for a day. Bug: 155795687 Test: atest com.android.server.wifi Test: Manual tests - Flash wipe the device. - Connect to saved networks. - Turn off wifi. - Check that wake feature is enabled and the notification shown. Change-Id: I6bc6315c9c1852e7cdb17ad73c4ed34d3895a951
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WakeupController.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WakeupController.java b/service/java/com/android/server/wifi/WakeupController.java
index b003b74b9..d9882dbf3 100644
--- a/service/java/com/android/server/wifi/WakeupController.java
+++ b/service/java/com/android/server/wifi/WakeupController.java
@@ -240,6 +240,10 @@ public class WakeupController {
*/
public void start() {
Log.d(TAG, "start()");
+ if (getGoodSavedNetworksAndSuggestions().isEmpty()) {
+ Log.i(TAG, "Ignore wakeup start since there are no good networks.");
+ return;
+ }
mWifiInjector.getWifiScanner().registerScanListener(
new HandlerExecutor(mHandler), mScanListener);