Why READ_PHONE_STATE permission is required while using Video API Android SDK? Why READ_PHONE_STATE permission is required while using Video API Android SDK?

Why READ_PHONE_STATE permission is required while using Video API Android SDK?

Maria Scieranska

Question

Why Vonage/TokBox requires this permission from a business perspective? How are these data used by Vonage/Tokbox? Why is this permission necessary?

Applies To

  • Video API Android SDK

Answer

READ_PHONE_STATE permission is needed so the SDK can react appropriately to incoming and outgoing calls.

The application will not crash when the READ_PHONE_STATE is omitted but the audio behavior could be unpredictable when this permission is omitted.

For example: Let's say the user attends an incoming voice call while an Opentok session is active, the audio may not route as expected, then:
1) The user may hear audio from both opentok session and the incoming voice call which may not sound pleasant

And/Or 2) The audio may route through Speakerphone even when a Bluetooth headset is paired and connected.

And/Or other effects.

This behavior can be different depending on the Phone manufacture, brands other than Google (Pixel) release their own custom versions of Android OS.

Note that READ_PHONE_STATE does NOT grant access to phone numbers since Android 10 (https://source.android.com/devices/tech/config/device-identifiers)