When i try to play audio file in whatsapp n when i bring my fingers near the sensor located besides front camera the screen turns off
Can u verify the problem?
It's probably related to Whatsapp App, because in my earlier phones also I've seen this behavior.
I checked it on poco x2 n redmi note 8
It doesn't happen with these devices
Just happens with rog 2
Anyway have u confirmed it if it happens on ur device as well?
It's a feature in WhatsApp to switch over to the earpiece when you move the phone to your ear. You're simulating this by holding your fingers over the sensor next to the front camera.
Whats the point of that feature when u r playing audio file n not talking on call
Also if its what'sapp feature than why doesn't it work in other devices? Stop kidding me okay
That's something you'll have to ask the WhatsApp devs, but my guess is that it's there to prevent any accidental touches as the app thinks you're holding the phone to your ear.
It's there for other devices as well, just tested.
Adding in some information.
As @Gustav_ASUS mentioned , this is intentional behavior from WhatsApp.
Why WhatsApp behaves like this for audio files ;
You may want whatever message is playing to be private - lifting the phone to your ear, WhatsApp will listen for proximity sensor to switch over the audio from "speaker mode" to "earpiece mode".
If you have problems with this behavior, you may bring it up with WhatsApp.
Why your Poco X2 or Redmi did not behave like this - we cannot answer - it could be because they do not have proximity sensors.