Search code examples
androidwakelock

Wakelock CPU speed


My app holds a partial wakelock (to ensure the CPU keeps running) and also uses a proximity wake lock to turn the screen off if the user holds the phone near their face. The app plays audio to the user using its own native threads and the OpenSLES api.

The problem I have is that when the proximity sensor triggers and the screen turns off the CPU appears to slow down and the native threads can no-longer keep up and the audio stutters.

Anyone know what's going on here and if there's anything I can do about it?

Regards

Phil


Solution

  • What I really needed was a high performance wifi lock - it was actually the wifi that was the problem, not the CPU.

    See http://developer.android.com/reference/android/net/wifi/WifiManager.html#WIFI_MODE_FULL_HIGH_PERF