2

I have been reading as much as I can regarding the developer docs for the Android SDK about the following:

  • Wifi wakelock
  • WifiManager.WIFI_MODE_FULL_HIGH_PERF
  • Wifi sleep policy

They all make sense in their own context but I can't see the "big picture" so to speak.

  1. I guess that both the wifi wakelock and the WIFI_MODE_FULL_HIGH_PERF setting overrides the user sleep policy. Is that right?

  2. If I have the sleep policy on "Never", and I just make experimental APK:s for myself which is downloading stuff in the background via wifi, I guess I don't need the wifi wake lock nor the WIFI_MODE_FULL_HIGH_PERF?

  3. The code I have seen using a wifi wake lock has also acquired a power wake lock. Is there any occasion where I only want to acquire the wifi lock but not the power lock?

Community
  • 1
  • 1
ola1olsson
  • 253
  • 1
  • 2
  • 11

1 Answers1

0
  1. If the device goes into a deep sleep and shuts down wi-fi radio, the wi-fi lock will wake it back up when the lock is acquired. Correct, this is regardless of your wi-fi policy.

  2. I think you have it backwards- the policy question says "Keep Wi-Fi on during sleep" so if you want to avoid the need for wifi locks, you would choose the "Always" option value. I'd like to see a battery consumption analysis of Wi-Fi stay connected, versus sporadic 4G in deep sleep...

  3. I have never needed or used a power wake lock. Just system and wifi, and everything has worked fine for me to perform the functions desired.

gauglerb
  • 258
  • 1
  • 12