Android Question Intercepting outgoing calls (on dual sim phones)

viljemto

Member
Licensed User
Longtime User
Hi
this code was working for me before, but now on Android 7 and some type devices (LG, Lenovo), BroadcastReceiver android.intent.action.NEW_OUTGOING_CALL I am getting without slotId (just PHONE_NUMBER).

Previously I got both.

B4X:
SIM1:
11-09 22:27:00.425  7309  7309 I B4A     : my.tel.app - tel - BroadcastReceiver_OnReceive
11-09 22:27:00.425  7309  7309 I B4A     : Parameter1 - Action: android.intent.action.NEW_OUTGOING_CALL
11-09 22:27:00.425  7309  7309 I B4A     : Parameter2 - BroadcastIntent: Intent { act=android.intent.action.NEW_OUTGOING_CALL flg=0x10000010 (has extras) }
11-09 22:27:00.425  7309  7309 I B4A     : ExtrasToString: Bundle[{android.intent.extra.PHONE_NUMBER=0123456789}]

SIM2:
11-09 21:52:59.469  7309  7309 I B4A     : my.tel.app - tel - BroadcastReceiver_OnReceive
11-09 21:52:59.469  7309  7309 I B4A     : Parameter1 - Action: android.intent.action.NEW_OUTGOING_CALL
11-09 21:52:59.469  7309  7309 I B4A     : Parameter2 - BroadcastIntent: Intent { act=android.intent.action.NEW_OUTGOING_CALL flg=0x10000010 (has extras) }
11-09 21:52:59.469  7309  7309 I B4A     : ExtrasToString: Bundle[{android.intent.extra.PHONE_NUMBER=0123456789}]



In the logs I have found android.intent.action.CALL_PRIVILEGED, that has both extras, but I do not know how to intercept this.

B4X:
SIM1:
11-09 22:27:00.155  2561  2561 E MOCAI_CALL: MOCAI_CALL:startSmartCall intent=Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:xxxxxxxxxxxx flg=0x10000000 (has extras) }
11-09 22:27:00.156  2561  2561 E MOCAI_CALL: MOCAI_CALL:startSmartCall Extras=Bundle[{com.android.phone.force.slot=true, com.android.phone.extra.slot=0}]
11-09 22:27:00.158  2561  2561 D MOCAI_CALL: MOCAI_CALL:startSmartCall number=0123456789;type=0;suggestSlotId=-1001;slotId=0;forceSlotId=true

SIM2:
11-09 21:52:59.171  2561  2561 E MOCAI_CALL: MOCAI_CALL:startSmartCall intent=Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:xxxxxxxxxx flg=0x10000000 (has extras) }
11-09 21:52:59.171  2561  2561 E MOCAI_CALL: MOCAI_CALL:startSmartCall Extras=Bundle[{com.android.phone.force.slot=true, com.android.phone.extra.slot=1}]
11-09 21:52:59.173  2561  2561 D MOCAI_CALL: MOCAI_CALL:startSmartCall number=0123456789;type=0;suggestSlotId=-1001;slotId=1;forceSlotId=true

Had anybody any work with this maybe?
 

viljemto

Member
Licensed User
Longtime User
hi

first logs are caught with BroadcastReceiver and writen to log
Broadcast.Initialize("BroadcastReceiver")
Broadcast.addAction("android.intent.action.NEW_OUTGOING_CALL"

Sub BroadcastReceiver_OnReceive(Action As String, BroadcastIntent As Object)


second are directly with adb logcat as is from phone
 
Upvote 0

viljemto

Member
Licensed User
Longtime User
Upvote 0
Top