There is sometimes an error occurring when monitoring call state of my android phones (Samsung Galaxy S6-8; os: Android 6-8) using RILJ output in adb logcat and I have no idea where this might come from.
What I am doing:
- Read adb logcat oputput via "logcat -b main -v long" and "logcat -b radio -v long"
- Match each logline using regex filter "< GET_CURRENT_CALLS"
- map each line to its state: DIALING, ALERTING, ACTIVE, INCOMING, HOLDING, WAITING
Result:
This seems to work well, here is an example output for a call between an A- and B-Party:
A-Party 02-18 14:57:00.796: D/RILJ(4544): [0899]> GET_CURRENT_CALLS [SUB0]
A-Party 02-18 14:57:00.804: D/RILJ(4544): [0899]< GET_CURRENT_CALLS {[id=1,DIALING,toa=129,norm,mo,0,voc,noevp,,cli=1,,1] } [SUB0]
B-Party 02-18 14:57:42.956: D/RILJ(4494): [1856]> GET_CURRENT_CALLS [SUB0]
B-Party 02-18 14:57:42.963: D/RILJ(4494): [1856]< GET_CURRENT_CALLS {[id=1,INCOMING,toa=145,norm,mt,0,voc,noevp,,cli=1,,1] } [SUB0]
A-Party 02-18 14:57:02.869: D/RILJ(4544): [0902]> GET_CURRENT_CALLS [SUB0]
A-Party 02-18 14:57:02.870: D/RILJ(4544): [0903]> GET_CURRENT_CALLS [SUB0]
A-Party 02-18 14:57:02.873: D/RILJ(4544): [0902]< GET_CURRENT_CALLS {[id=1,ALERTING,toa=129,norm,mo,0,voc,noevp,,cli=1,,1] } [SUB0]
A-Party 02-18 14:57:02.879: D/RILJ(4544): [0903]< GET_CURRENT_CALLS {[id=1,ALERTING,toa=129,norm,mo,0,voc,noevp,,cli=1,,1] } [SUB0]
A-Party 02-18 14:57:02.909: D/RILJ(4544): [0904]> GET_CURRENT_CALLS [SUB0]
A-Party 02-18 14:57:02.917: D/RILJ(4544): [0904]< GET_CURRENT_CALLS {[id=1,ALERTING,toa=129,norm,mo,0,voc,noevp,,cli=1,,1] } [SUB0]
B-Party 02-18 14:57:59.539: D/RILJ(4494): [1862]> GET_CURRENT_CALLS [SUB0]
A-Party 02-18 14:57:18.988: D/RILJ(4544): [0906]> GET_CURRENT_CALLS [SUB0]
B-Party 02-18 14:57:59.545: D/RILJ(4494): [1862]< GET_CURRENT_CALLS {[id=1,ACTIVE,toa=145,norm,mt,0,voc,noevp,,cli=1,,1] } [SUB0]
A-Party 02-18 14:57:18.999: D/RILJ(4544): [0906]< GET_CURRENT_CALLS {[id=1,ACTIVE,toa=129,norm,mo,0,voc,noevp,,cli=1,,1] } [SUB0]
B-Party 02-18 14:58:31.225: D/RILJ(4494): [1865]> GET_CURRENT_CALLS [SUB0]
B-Party 02-18 14:58:31.251: D/RILJ(4494): [1865]< GET_CURRENT_CALLS {} [SUB0]
A-Party 02-18 14:57:55.350: D/RILJ(4544): [0909]> GET_CURRENT_CALLS [SUB0]
A-Party 02-18 14:57:55.363: D/RILJ(4544): [0909]< GET_CURRENT_CALLS {} [SUB0]
A-Party 02-18 14:58:27.693: D/RILJ(4544): [0924]> GET_CURRENT_CALLS [SUB0]
Problem:
For some executions, it seems there are log messages missing. It might happen that the line
A-Party 02-18 14:57:18.999: D/RILJ(4544): [0906]< GET_CURRENT_CALLS {[id=1,ACTIVE,toa=129,norm,mo,0,voc,noevp,,cli=1,,1] } [SUB0]
is missing. Therefore, the callstate ACTIVE is not registered, although I can see on my phones screen that the call was answered and really is active.
I am trying to get this running more stable for some time now, but I have no real clue what the issue might be. I already thought of/tried the following but do not know in detail if it might be a cause for this:
- Could it be a "bug" from the RILJ that it is missing a logline, or is it 100% reliable?
- Is there another more reliable service/possibility to keep track of call states? The phone seems to know the state correctly even if the RILJ log was missing so it has to know somehow from another source.
- Could it be an adb logcat issue that some messages are simply lost?
I am going out of ideas and would be really thankful if someone has some answers or another hint to fix this issue and to provide a 100% reliable call state tracking.
Thank you
Edit:
I saw several times a cpu usage of 100%, could it be possible that adb logs are "lost" due to cpu performance or can I be sure the loglines are recieved completely when usage is getting lower?