opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
210 stars 169 forks source link

Android device shows microphone is actively being used even though session is paused and audio is disabled #419

Closed iori57 closed 1 year ago

iori57 commented 2 years ago

1) Start publishing to a session, notice that Android OS now reports that camera and microphone is being used by the app, which is fine.

image

2) Call session.onPause() followed by publisher.publishAudio = false. 2) (Optional) Move application into background by pressing Home button. 3) Android OS indicates that camera is no longer being used, but microphone is still being used by the application.

image

Although it does not affect usability of the app it is bad in terms of user privacy perspective - the user might think the app is still recording audio while it is in background, which is scary.

Is there other methods I can call to turn off the microphone access totally, just like the camera?

v-kpheng commented 1 year ago

@iori57, we're tracking this internally: https://jira.vonage.com/browse/VIDCS-798.

iori57 commented 1 year ago

Thanks for following up with this issue! Can you expedite this? It has just became a bigger problem now that our app has implemented network bandwidth test that runs in the background following the sample provided. When the network test runs (with publishAudio set to false), it shows that the microphone is being accessed, even when user is not making a call, which is scary in terms of user's privacy as user may thought our app is secretly recording audio in the background.

v-kpheng commented 1 year ago

@iori57, we're looking into it.

goncalocostamendes commented 1 year ago

@iori57 we have identified the root cause of the issue. Due to your urgency, if you are using a custom audio driver you can easily fix it yourself. I can guide you on it. Meanwhile we are working on a solution that can be applicable to our default audio driver.

iori57 commented 1 year ago

That is good news! I am using the default audio driver so will wait for the fix. Thank you!

beHaze commented 1 year ago

Fixed in 2.25.3 release.

ss-stanislavsky commented 8 months ago

@iori57 we have identified the root cause of the issue. Due to your urgency, if you are using a custom audio driver you can easily fix it yourself. I can guide you on it. Meanwhile we are working on a solution that can be applicable to our default audio driver.

Hello, could you please guide me how to fix this issue on old version of library with custom AudioDevice? Thanks!

goncalocostamendes commented 8 months ago

@ss-stanislavsky the fix ended up being only on our internal lib, so with the custom AudioDevice sample the LED should get disabled correctly.

Please guarantee you target version 2.25.3 or higher. If you have any issues please answer back