element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.39k stars 729 forks source link

Incoming calls broken (when app in background) #7690

Closed opusforlife2 closed 1 year ago

opusforlife2 commented 1 year ago

Steps to reproduce

  1. Make sure the app is not open.
  2. Ask someone to call you.

Outcome

What did you expect?

To receive an incoming call notification.

What happened instead?

Given that most calls will be received while the app isn't open, this is a major breakdown in calling functionality.

The bug was added in 1.5.7, and updating to 1.5.8 didn't fix it. Can't be 1.5.4 for sure, the next older version on F-Droid.

Logs

FATAL EXCEPTION: pool-9-thread-1
Process: im.vector.app, PID: 23906
android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: app is in background uid UidRecord{8460461 u0a128 TRNB idle change:uncached procs:0 seq(0,0,0)}
    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1870)
    at android.app.ContextImpl.startService(ContextImpl.java:1826)
    at android.content.ContextWrapper.startService(ContextWrapper.java:776)
    at im.vector.app.features.call.webrtc.WebRtcCallManager.onCallEnded(WebRtcCallManager.kt:100)
    at im.vector.app.features.call.webrtc.WebRtcCallManager.access$onCallEnded(WebRtcCallManager.kt:1)
    at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:2)
    at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:1)
    at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invokeSuspend(WebRtcCall.kt:148)
    at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:8)
    at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:4)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:5)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:72)
    at im.vector.app.features.call.webrtc.WebRtcCall.terminate(WebRtcCall.kt:9)
    at im.vector.app.features.call.webrtc.WebRtcCall.terminate$default(WebRtcCall.kt:11)
    at im.vector.app.features.call.webrtc.WebRtcCall$onCallHangupReceived$1.invokeSuspend(WebRtcCall.kt:38)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:119)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)
    Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@aa9080d, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@17a93c2]

Your phone model

Xiaomi Mi 5 (3GB RAM)

Operating system version

Android 12 (LOS 19.1)

Application version and app store

1.5.7, 1.5.8, 1.5.10, 1.5.18, 1.5.20, 1.5.22, 1.5.25 - F-droid

Homeserver

No response

Will you send logs?

Yes

Are you willing to provide a PR?

No

bmarty commented 1 year ago

Tested today using an API 33 emulator, which various configuration: background sync / Ntfy and FCM notification and did not repro the crash on the latest 1.5.10.

You did not answer the questions about phone model / operating system which could help to repro here.

opusforlife2 commented 1 year ago

My bad. Since I only encountered it in a recent version I thought it must be a regression. Adding the info.

opusforlife2 commented 1 year ago

Just tested again with 1.5.10:

The "nothing" above means no notification or crash or anything. Just that upon opening the app there is a missed call shown.

bmarty commented 1 year ago

/me is trying with API 32 emu (Android 12).

bmarty commented 1 year ago

I can repro the issue, but it's a bit random.

I have merged https://github.com/vector-im/element-android/pull/7712 and this may help to fix this issue.

I will do more tests.

ghost commented 1 year ago

If it helps gauge impact, we're experiencing the same issue on 1.5.11 from F-Droid. It's occurring on Android 13 on a Pixel 6 Pro. It's definitely intermittent. Oddly enough in our case, it rarely (if ever) seems to be a problem when the phone is locked; it mainly seems to be when it's unlocked and any app other than Element is in the foreground. Hopeful #7712 resolves this. :)

opusforlife2 commented 1 year ago

it rarely (if ever) seems to be a problem when the phone is locked

For me it's the opposite. It's far more likely that I pick up the phone after it's been idle for a while and notice that Scoop caught a stacktrace because I have a missed call.

ghost commented 1 year ago

Oh! Interesting! The lock screen difference may have just been random in that case. Wonder if this has anything to do with #7643. Considering that bug both autodismisses notifications and automatically marks messages in a 1:1 chat as read upon send, that could possibly explain this issue as well, since calls are part of the room timeline and have read/unread statuses.

opusforlife2 commented 1 year ago

Ah, yes. I also never get a notification for the missed call. Only the crash. Once I open the app, it syncs and informs me of the missed call.

opusforlife2 commented 1 year ago

I have merged https://github.com/vector-im/element-android/pull/7712 and this may help to fix this issue.

@bmarty Finally got 1.5.18. Still occurring.

opusforlife2 commented 1 year ago

@bmarty ?

opusforlife2 commented 1 year ago

Hi, this needs to be triaged again.

opusforlife2 commented 1 year ago

I get multiple crashes daily when people call me. Can this please be triaged?

leafee98 commented 1 year ago

Maybe the same problem. There are several forms.

Environmet

Tests I tried

Scene 1: Keep at android desktop and leave element run in background, when call arrives, it's very possible not ring. Leave the phone alone until the caller hang up. Then the following log will show up, and next time you open element it will prompt you the crash.

The log below was captured by the following command:

adb logcat | grep -F "$(adb shell ps | grep im.vector.app | tr -s '[:space:]' ' ' | cut -d ' ' -f 2)"
click to show logs ``` 02-09 15:23:20.843 29841 29929 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=d3c9b940-8dfd-4274-b924-0b9b65ce2244, tags={ MatrixSDK-a6f0e368e1d3e8c6dae8d4c3b3c4ec78, org.matrix.android.sdk.internal.session.sync.job.SyncWorker } ] 02-09 15:23:20.947 29841 29946 D TrafficStats: tagSocket(6) with statsTag=0xffffffff, statsUid=-1 02-09 15:23:30.948 29841 29946 D TrafficStats: tagSocket(6) with statsTag=0xffffffff, statsUid=-1 02-09 15:23:31.419 29841 29944 D TrafficStats: tagSocket(173) with statsTag=0xffffffff, statsUid=-1 02-09 15:23:31.785 29841 30057 D CommonSerializeUtils: ## deserializeObject(): success 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: QUALCOMM build : 1159e70389, I1027f1d7d9 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: Build Date : 04/08/22 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.32.02.17 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: Local Branch : 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: Remote Branch : 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: Remote Branch : 02-09 15:23:31.809 29841 30057 I AdrenoGLES-0: Reconstruct Branch : 02-09 15:23:31.810 29841 30057 I AdrenoGLES-0: Build Config : S P 10.0.7 AArch64 02-09 15:23:31.810 29841 30057 I AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so 02-09 15:23:31.812 30057 30057 I (3)[30057:DefaultDispatch]binder: 29841:30057 ioctl 40046210 72203f1064 returned -22 02-09 15:23:31.819 29841 30057 I AdrenoGLES-0: PFP: 0x016dd093, ME: 0x00000000 02-09 15:23:31.827 29841 30057 I org.webrtc.Logging: EglBase14Impl: Using OpenGL ES version 2 02-09 15:23:31.860 1764 4607 D ConnectivityService: requestNetwork for uid/pid:10269/29841 activeRequest: null callbackRequest: 7877 [NetworkRequest [ REQUEST id=7878, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10269 RequestorUid: 10269 RequestorPkg: im.vector.app UnderlyingNetworks: Null] ]] callback flags: 0 order: 2147483647 02-09 15:23:32.527 29841 29924 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=d78b284b-52bd-4dcc-8446-54c73e67a51f, tags={ MatrixSDK-a6f0e368e1d3e8c6dae8d4c3b3c4ec78, org.matrix.android.sdk.internal.session.sync.job.SyncWorker } ] 02-09 15:23:32.528 29841 29924 I WM-WorkerWrapper: Setting status to enqueued for 4366c3a0-e69b-48ef-9d95-cbad19c038b4 02-09 15:23:32.556 1764 4607 D ConnectivityService: requestNetwork for uid/pid:10269/29841 activeRequest: null callbackRequest: 7879 [NetworkRequest [ REQUEST id=7880, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10269 RequestorUid: 10269 RequestorPkg: im.vector.app UnderlyingNetworks: Null] ]] callback flags: 0 order: 2147483647 02-09 15:23:32.911 29841 29926 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=4366c3a0-e69b-48ef-9d95-cbad19c038b4, tags={ MatrixSDK-a6f0e368e1d3e8c6dae8d4c3b3c4ec78, org.matrix.android.sdk.internal.session.sync.job.SyncWorker } ] 02-09 15:23:47.105 29841 29944 D TrafficStats: tagSocket(6) with statsTag=0xffffffff, statsUid=-1 02-09 15:23:47.969 1764 4078 D ConnectivityService: requestNetwork for uid/pid:10269/29841 activeRequest: null callbackRequest: 7881 [NetworkRequest [ REQUEST id=7882, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10269 RequestorUid: 10269 RequestorPkg: im.vector.app UnderlyingNetworks: Null] ]] callback flags: 0 order: 2147483647 02-09 15:23:48.516 1764 4078 W ActivityManager: Background start not allowed: service Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) } to im.vector.app/.core.services.CallAndroidService from pid=29841 uid=10269 pkg=im.vector.app startFg?=false 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: JitsiMeetUncaughtExceptionHandler FATAL ERROR 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: app is in background uid UidRecord{2c1b084 u0a269 TRNB idle change:procadj procs:0 seq(4305506,4295499)} 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1908) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at android.app.ContextImpl.startService(ContextImpl.java:1864) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at android.content.ContextWrapper.startService(ContextWrapper.java:817) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager.onCallEnded(WebRtcCallManager.kt:100) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager.access$onCallEnded(WebRtcCallManager.kt:1) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:2) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:1) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invokeSuspend(WebRtcCall.kt:148) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:8) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:4) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:5) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:72) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall.terminate(WebRtcCall.kt:9) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall.terminate$default(WebRtcCall.kt:11) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$onCallHangupReceived$1.invokeSuspend(WebRtcCall.kt:38) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:119) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at java.lang.Thread.run(Thread.java:1012) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ac75592, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@3de1b63] 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: app is in background uid UidRecord{2c1b084 u0a269 TRNB idle change:procadj procs:0 seq(4305506,4295499)} 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1908) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at android.app.ContextImpl.startService(ContextImpl.java:1864) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at android.content.ContextWrapper.startService(ContextWrapper.java:817) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager.onCallEnded(WebRtcCallManager.kt:100) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager.access$onCallEnded(WebRtcCallManager.kt:1) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:2) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:1) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invokeSuspend(WebRtcCall.kt:148) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:8) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:4) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:5) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:72) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall.terminate(WebRtcCall.kt:9) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall.terminate$default(WebRtcCall.kt:11) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at im.vector.app.features.call.webrtc.WebRtcCall$onCallHangupReceived$1.invokeSuspend(WebRtcCall.kt:38) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:119) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: at java.lang.Thread.run(Thread.java:1012) 02-09 15:23:48.535 29841 30093 E JitsiMeetSDK: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ac75592, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@3de1b63] 02-09 15:23:48.537 29841 29892 V JitsiMeetSDK: [PushRules] Rule PushRule(actions=[dont_notify], default=false, enabled=true, ruleId=!TczZJIbozgTQfqUYBA:nichi.co, conditions=[PushCondition(kind=event_match, key=room_id, pattern=!TczZJIbozgTQfqUYBA:nichi.co, iz=null)], pattern=null) match for event $RiMvXDjLcQn6WMHOg__as_Wz5FKETQqkhcQBg61ObEs 02-09 15:23:48.537 29841 30093 E AndroidRuntime: FATAL EXCEPTION: pool-9-thread-1 02-09 15:23:48.537 29841 30093 E AndroidRuntime: Process: im.vector.app, PID: 29841 02-09 15:23:48.537 29841 30093 E AndroidRuntime: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: app is in background uid UidRecord{2c1b084 u0a269 TRNB idle change:procadj procs:0 seq(4305506,4295499)} 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1908) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at android.app.ContextImpl.startService(ContextImpl.java:1864) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at android.content.ContextWrapper.startService(ContextWrapper.java:817) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCallManager.onCallEnded(WebRtcCallManager.kt:100) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCallManager.access$onCallEnded(WebRtcCallManager.kt:1) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:2) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCallManager$createWebRtcCall$webRtcCall$4.invoke(WebRtcCallManager.kt:1) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invokeSuspend(WebRtcCall.kt:148) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:8) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCall$terminate$2.invoke(Unknown Source:4) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:5) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:72) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCall.terminate(WebRtcCall.kt:9) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCall.terminate$default(WebRtcCall.kt:11) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at im.vector.app.features.call.webrtc.WebRtcCall$onCallHangupReceived$1.invokeSuspend(WebRtcCall.kt:38) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:119) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012) 02-09 15:23:48.537 29841 30093 E AndroidRuntime: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ac75592, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@3de1b63] 02-09 15:23:48.544 29841 29892 V JitsiMeetSDK: [PushRules] Rule PushRule(actions=[notify, {set_tweak=sound, value=default}], default=false, enabled=true, ruleId=!UldO0zEyrDSxyUOP:leafee98.com, conditions=[PushCondition(kind=event_match, key=room_id, pattern=!UldO0zEyrDSxyUOP:leafee98.com, iz=null)], pattern=null) match for event $_t0D9lgvdF_JiSFraQ7er5Zci8rxEXIv9QYrqj_T4v4 02-09 15:23:48.544 29841 29892 D JitsiMeetSDK: [PushRules] matched 4 out of 4 02-09 15:23:48.544 29841 29892 V JitsiMeetSDK: [PushRules] Found 0 redacted events 02-09 15:23:48.545 29841 29892 V JitsiMeetSDK: [PushRules] <-- Push task scheduled 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Push rule match for event $_AA2uJ2I0Fq6j7YX4UmwG7eR2O0io3roRCepFD8FIeY 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Matched push rule is set to not notify 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Push rule match for event $G5ZJQ_xvqMEkCgoPRVdxh9GyRk_6N_j-9KJu-IfZLbI 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Matched push rule is set to not notify 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Push rule match for event $RiMvXDjLcQn6WMHOg__as_Wz5FKETQqkhcQBg61ObEs 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Matched push rule is set to not notify 02-09 15:23:48.545 29841 30044 D JitsiMeetSDK: Push rule match for event $_t0D9lgvdF_JiSFraQ7er5Zci8rxEXIv9QYrqj_T4v4 02-09 15:23:48.547 29841 30093 I Process : Sending signal. PID: 29841 SIG: 9 02-09 15:23:48.547 29841 29892 V JitsiMeetSDK: SyncResponse.rooms post treatment took 50 ms 02-09 15:23:48.548 29841 29922 V JitsiMeetSDK: Unwedging: 0 are wedged 02-09 15:23:48.548 29841 29922 V JitsiMeetSDK: Nothing to unwedge 02-09 15:23:48.548 29841 29922 V JitsiMeetSDK: ## CRYPTO | refreshOutdatedDeviceLists() 02-09 15:23:48.549 29841 29892 V JitsiMeetSDK: cryptoSyncHandler.onSyncCompleted took 0 ms 02-09 15:23:48.609 925 925 I Zygote : Process 29841 exited due to signal 9 (Killed) 02-09 15:23:48.615 1764 2671 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(uid/pid:10269/29841, [NetworkRequest [ REQUEST id=7882, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10269 RequestorUid: 10269 RequestorPkg: im.vector.app UnderlyingNetworks: Null] ]], android.os.BinderProxy@6d9344c) 02-09 15:23:48.615 1764 2676 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(uid/pid:10269/29841, [NetworkRequest [ REQUEST id=7874, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10269 RequestorUid: 10269 RequestorPkg: im.vector.app UnderlyingNetworks: Null] ]], android.os.BinderProxy@6170c7f) 02-09 15:23:48.616 1764 12504 I ActivityManager: Process im.vector.app (pid 29841) has died: prcl TRNB 02-09 15:23:48.618 1764 1809 I libprocessgroup: Successfully killed process cgroup uid 10269 pid 29841 in 0ms ```

Scene 2: Again keep at android desktop and element run at background, when call arrives and no ring, open element right now, before the caller hang up, it will show like below. Go back to desktop. Then element will not crash.

click to show the green "Call ringing... Tap to return" ![image](https://user-images.githubusercontent.com/32585295/217747331-972a5f51-cbfc-4785-ba80-4f2b3570ba79.png)

Scene 3: Keep element foreground, when the call arrives, the green Call ringing... Tap to return will show up and a new form will show with an animation slide down. Then no matter this call is accepted or denied by anyone, future calls must will ring. If you force stop element and start it again, it's very likely to not ring for calls.

click to view the new form prompting calls ![image](https://user-images.githubusercontent.com/32585295/217752034-370b7019-6561-49d5-848d-078e9ad0e45a.png)
opusforlife2 commented 1 year ago

Thank you for triaging. I was really hoping this would be fixed by the same change that fixed #7876, but the bug still exists on 1.5.25, sadly. Updating OP as well.

z411 commented 1 year ago

This has also happened several times, and the behavior is inconsistent. The call sometimes doesn't come through, or sometimes it comes through several minutes later and it stays ringing even though the other person cancelled the call long ago.

opusforlife2 commented 1 year ago

For me it doesn't come through 100% of the time.

z411 commented 1 year ago

We realized with my girlfriend that calls indeed won't come through when the app is in the background or the phone is locked. We don't want to downgrade. Please, this is a major issue that makes Element useless for us. Version 1.5.26

opusforlife2 commented 1 year ago

I just read that Element Android is being put in maintenance mode. I really hope this issue is looked at before that happens, otherwise this functionality will remain crippled for the rest of the year.

z411 commented 1 year ago

I guess we can only downgrade to 1.5.4

opusforlife2 commented 1 year ago

I'm not sure if that's safe to do. That version is half a year old, and might be incompatible now.

z411 commented 1 year ago

We downgraded to 1.5.4 with my girlfriend and calls, notifications and everything works perfectly as it should, even when the phone locked. The current version is just completely broken.

opusforlife2 commented 1 year ago

I'm gonna rely on you to be the brave tester for a few days, and possibly take the plunge myself if nothing bad comes up.

z411 commented 1 year ago

So far nothing weird or wrong has happened but we've tested only for 2 days for regular conversation. I'd be interested in your experience as well.

opusforlife2 commented 1 year ago

Welp. This didn't work for me at all. I got the exact same crash on 1.5.4. Went back to 1.5.28. Gotta wait until next year now.

opusforlife2 commented 1 year ago

Okay, I finally figured this out during a routine check of all my apps' settings. At some point, an OS update caused the "Display over other apps" permission to be toggled off automatically. This has happened several times before so I'm quite confident about the reason.

Once I re-granted this permission, the crash went away. I still get call notifications only sporadically, but at least the main reason for this issue being open is no longer true.


I don't remember Element ever asking for the Display permission. It must have been granted automatically. Maybe there should be a check in the code for this, for when the toggle is turned off for some reason.