No need for using the wakelocks, as they are unreliable and buggy.
It would be more efficient to use the system's own version of keeping the screen on in a manageable way that is taken care of by Android:
Within the onCreate
in your activity, do this:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
WindowManager.FLAG_SHOW_WHEN_LOCKED);
This is from the developer's API found here:
public static final int FLAG_SHOW_WHEN_LOCKED
Since: API Level 5 Window flag: special flag to let windows be shown
when the screen is locked. This will let application windows take
precedence over key guard or any other lock screens. Can be used with
FLAG_KEEP_SCREEN_ON to turn screen on and display windows directly
before showing the key guard window. Can be used with
FLAG_DISMISS_KEYGUARD to automatically fully dismisss non-secure
keyguards. This flag only applies to the top-most full-screen window.
Constant Value: 524288 (0x00080000)
By combining it with the efficient screen on flag, should get around the screen-lock facility. The only thing is to make sure that your activity is the top-most on screen.
To quote, on the usage of FLAG_KEEP_SCREEN_ON
of PowerManager
public static final int SCREEN_BRIGHT_WAKE_LOCK
This constant is deprecated. Most applications should use
FLAG_KEEP_SCREEN_ON instead of this type of wake lock, as it will be
correctly managed by the platform as the user moves between
applications and doesn't require a special permission. Wake lock that
ensures that the screen is on at full brightness; the keyboard
backlight will be allowed to go off.