Looks for problems with WakeLock
usage
Failing to release a wakelock properly can keep the Android device in a high power mode, which reduces battery life. There are several causes of this, such as releasing the wake lock in onDestroy()
instead of in onPause()
, failing to call release()
in all possible code paths after an acquire()
, and so on.
NOTE: If you are using the lock just to keep the screen on, you should strongly consider using FLAG_KEEP_SCREEN_ON
instead. This window flag will be correctly managed by the platform as the user moves between applications and doesn't require a special permission. See http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_KEEP_SCREEN_ON.