Exception only for Samsung Devices

I tried to ask READ_PHONE_STATE permission but it still crashes for some users on Samsung devices.

Hope Zoom team can find some way to fix it and release a new version.

Fatal Exception: java.lang.RuntimeException

Unable to resume activity {com.myapp/com.zipow.videobox.JoinByURLActivity}: java.lang.SecurityException: getCallState: Neither user 10299 nor current process has android.permission.READ_PHONE_STATE.

       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5223)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5262)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:54)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2434)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)```
Caused by java.lang.SecurityException

getCallState: Neither user 10299 nor current process has android.permission.READ_PHONE_STATE. - com.zipow.videobox.x.b.b.D

       at android.os.Parcel.createExceptionOrNull(Parcel.java:2437)
       at android.os.Parcel.createException(Parcel.java:2421)
       at android.os.Parcel.readException(Parcel.java:2404)
       at android.os.Parcel.readException(Parcel.java:2346)
       at com.android.internal.telecom.ITelecomService$Stub$Proxy.getCallStateUsingPackage(ITelecomService.java:2578)
       at android.telecom.TelecomManager.getCallState(TelecomManager.java:1912)
       at android.telephony.TelephonyManager.getCallState(TelephonyManager.java:6456)
       at com.zipow.videobox.x.b.b.D(ZmAudioStatusMgr.java:3)
       at com.zipow.videobox.x.b.b.C(ZmAudioStatusMgr.java:4)
       at com.zipow.videobox.x.b.b.t(ZmAudioStatusMgr.java:1)
       at com.zipow.videobox.conference.jni.ZmConfDefaultCallback.initialize(ZmConfDefaultCallback.java:2)
       at com.zipow.videobox.mainboard.Mainboard.createConfAppForSdk(Mainboard.java:20)
       at com.zipow.videobox.VideoBoxApplication.initConfAppForSDK(VideoBoxApplication.java:23)
       at com.zipow.videobox.VideoBoxApplication.startConfServiceForSDK(VideoBoxApplication.java:8)
       at com.zipow.videobox.ptapp.ConfProcessMgr.createConfProcess(ConfProcessMgr.java:11)
       at com.zipow.videobox.mainboard.Mainboard.notifyUrlActionImpl(Mainboard.java)
       at com.zipow.videobox.mainboard.Mainboard.notifyUrlAction(Mainboard.java:5)
       at com.zipow.videobox.confapp.meeting.premeeting.joinscene.ZMJoinByUrl.joinByUrl(ZMJoinByUrl.java:56)
       at com.zipow.videobox.confapp.meeting.premeeting.joinscene.ZMJoinByUrl.joinByUrl(ZMJoinByUrl.java:41)
       at com.zipow.videobox.confapp.meeting.premeeting.joinscene.ZMJoinByUrl.startConfrence(ZMJoinByUrl.java:3)
       at com.zipow.videobox.JoinByURLActivity.a(JoinByURLActivity.java:13)
       at com.zipow.videobox.JoinByURLActivity.a(JoinByURLActivity.java:41)
       at com.zipow.videobox.JoinByURLActivity.b(JoinByURLActivity.java:44)
       at com.zipow.videobox.JoinByURLActivity.onResume(JoinByURLActivity.java:126)
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1476)
       at android.app.Activity.performResume(Activity.java:8433)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5196)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5262)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:54)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2434)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)```

Hi @johankovalsikoski,

This crash indicates that you have not successfully requested the required permission. For more information on how to request permissions on Android, please see the Android permissions documentation. :slightly_smiling_face:

Thanks!

@jon.zoom I can confirm that this exception is indeed triggering on the following devices only:

  • Samsung S20+
  • Samsung S20 FE
  • Xiaomi Note 10 Pro

Looking at the stacktrace, it’s obvious that the exception is being thrown because the ZoomSDK is using a deprecated call on SDK 31+. This behavior has only manifested after Zoom’s recent release targeting Android 12/SDK 31+.

Please have a look once again.

1 Like

Hi @haseeb-gsu, thanks for using the dev forum.

The replacement method for the deprecated method used by the SDK also requires the READ_PHONE_STATE permission, so the crash would still happen but with a slightly different stack trace. The SDK needs this permission regardless. :slightly_smiling_face:

Thanks!

Thanks for responding. Here’s a few things to consider:

  • We let users join a meeting with just the meeting id and/or meeting password. This works, is part of the zoom feature set, and is part of the sample app.
  • I think that invokes the JoinByURLActivity in the Zoom SDK.
  • Zoom SDK declares READ_PHONE_STATE as a permission in mobilertc.aar on line 65.
  • Zoom’s manifest is merged with the application, and hence always includes this permission in the output.

I don’t see why the application needs to redeclare the permission? It’s working on 95% of Android devices without the application expliclity declaring it. It’s the Samsung/Xiaomi devices throwing that exception.

1 Like

Hi @haseeb-gsu,

Declaring the permission in the SDK’s manifest does not mean that the permission is granted to any app in which the SDK is included. Until something changes in the actual Android implementation itself, this permission will be required to use the SDK in order to maintain Android 12 support. :slightly_smiling_face:

Thanks!

I’m sure Zoom SDK handles requesting permissions as well. Essentially:

  • Zoom SDK is declaring the permissions in its manifest
  • Zoom SDK handles requesting the permissions on runtime as well during meetings. I have tested this, and the permissions are granted.

This is not a problem of requesting them or declaring them in the Manifest. I mentioned that the permission is there becuase you responded to the original question that he hasn’t requested the permission correctly.

The actual problem is somewhere else. I have tested the actual Samsung and Xiaomi devices, and they don’t show this error with the latest Zoom SDK. Perhaps a migration pre 12? Also, can you please provide a solution or point to one, given what’s already said above.

1 Like

Hi @haseeb-gsu,

This exception is produced by the operating system when getCallState is invoked without the READ_PHONE_STATE permission. You can resolve this by requesting that permission. This is not a bug with the SDK.

Thanks!

I can confirm SDK v5.10.1.5184 fixes the issue. Relevant update from SDK changelog could be:

New interfaces for Android 12 Custom UI

  • New interface in InMeetingService :
boolean updatePermissions(String[] permissions, int[] grantResults);
1 Like

Glad to hear this is working now!

Please don’t hesitate to reach back out in a new topic with any additional questions. :slightly_smiling_face: