opentok/opentok-android-sdk-samples

During voice call connection openTok need video permission

saeed-lotfi opened this issue · 2 comments

During voice call connection if user not grant video permission app will be crash

Start voice call and if you not grant video permission app will be crash

Caused by: android.os.ServiceSpecificException: validateClientPermissionsLocked: cannot open camera "1" without camera permission (code 1)

 at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1384)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:724)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:970)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:991)
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:829)
        at com.opentok.android.Camera2VideoCapturer.initCamera(Unknown Source:59)
        at com.opentok.android.Camera2VideoCapturer.doInit(Unknown Source:19)
        at com.opentok.android.Camera2VideoCapturer.init(Unknown Source:15)
        at com.opentok.android.PublisherKit.b(Unknown Source:4)
        at com.opentok.android.PublisherKit.$r8$lambda$NVQ_orQtpQuuz8-c02oYWYEwbeA(Unknown Source:0)
        at com.opentok.android.PublisherKit$$ExternalSyntheticLambda0.run(Unknown Source:2)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7898)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@saeed-lotfi, thanks for filing this issue. We're missing some details, though, unfortunately. Can you please refile the issue? You'll be prompted to fill out some key details, which will make it easier for us to root cause.

The exact same problem occurs to me, in version 2.24.2 the app crashes when starting a voice call. Asking for the camera permission in this case is solved, but it shouldn't be like that when it's not used.