react-native-webrtc / react-native-webrtc/react-native-callkeep

Selfmanaged Callkeep crashes after bumpig targetSdkVersion to 31

Open
#635 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
511
Avg merge
9h 12m
Merged PRs (30d)
2

Description

Bug report

  • I've checked the example to reproduce the issue.

  • Reproduced on:

  • Android

Description

React native callkeep is unable to run displayIncomingCall when the app receive a high priority FCM notification and starts the background service that wakes the app up . Instead it crashes.

Similar issue was reported here

please i need to know if you have a self managed setup running on android 12> @linus-komnick @manuquentin

Android Permissions.

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.smarthealthmobile.permission.C2D_MESSAGE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.RECORD_VIDEO" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
    <uses-permission android:name="android.permission.READ_CALL_LOG" tools:node="remove" />
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
    <uses-feature android:name="android.hardware.telephony" android:required="false" />


Steps to Reproduce

Versions

- Callkeep: 4.3.3
- React Native: 0.63.4
- Android: Android 12 and above
- Phone model: Samsung galaxy ultra and google pixel 3a

Logs

2022-11-25 13:50:14.285 5722-5782/com.smarthealthmobile E/unknown:ReactNative: CatalystInstanceImpl caught native exception
    java.lang.SecurityException: Neither user 10315 nor current process has android.permission.READ_PHONE_NUMBERS.
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2425)
        at android.os.Parcel.createException(Parcel.java:2409)
        at android.os.Parcel.readException(Parcel.java:2392)
        at android.os.Parcel.readException(Parcel.java:2334)
        at com.android.internal.telecom.ITelecomService$Stub$Proxy.getPhoneAccount(ITelecomService.java:1926)
        at android.telecom.TelecomManager.getPhoneAccount(TelecomManager.java:1374)
        at io.wazo.callkeep.RNCallKeepModule.hasPhoneAccount(RNCallKeepModule.java:681)
        at io.wazo.callkeep.RNCallKeepModule.displayIncomingCall(RNCallKeepModule.java:182)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:1012)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with io.wazo.callkeep.RNCallKeepModule.java, especially hasPhoneAccount at line 681 and displayIncomingCall at line 182, and reproduce the FCM-triggered call on Android 12+ with the listed permissions. Done means displayIncomingCall no longer crashes with the reported READ_PHONE_NUMBERS SecurityException in the self-managed setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, react-native
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.