If the player is afk and the phone goes to sleep, there is no reason to keep him connected at all. Maintaining a connection will drain the player's battery and place additional stress on your servers, both for no benefit, since the player isn't using the game anyway. This means higher costs for you and (potentially) negative reviews for your game.
Instead, you should just drop the connection when the phone goes to sleep and attempt to reconnect when the phone wakes up.
If you don't want to disconnect a user without him willing it to happen, you can set FLAG_KEEP_SCREEN_ON. This will keep the phone awake as long as the app is in focus while also shouting to the user, "Hey, I'm eating your battery! You should turn me off if you're really not playing anymore!"