It looks like you are using the wake lock for the wrong purpose. From what I understood based on your explanation: you need the playback to continue when the screen goes off:
To do that - I would recommend you try the following logic.
- Try to have the player running in a service (not in the activity)
- Start the service with startForeground method (this will need you to include a notification as well)
- Use a Messenger to communicate between your activity and service.
But the wake lock may come handy; as this may be helpful in handling a audio stutter issue in future. I am not very sure about this part as I myself is yet to try out the wake lock as a solution to stuttering issue.
(I am not a professional/commercial programmer ; rather an ad-hoc developer who finds a requirement designs a solution, develops it and uses it for myself. So my solution might not be a 100% professional approach but I am sure it does the job)
Good Luck and happy coding
- S.Mani