Simple-Dialer icon indicating copy to clipboard operation
Simple-Dialer copied to clipboard

Dont working blocking incoming calls from not stored contacts

Open wendig0x opened this issue 1 year ago • 4 comments

Dont working blocking incoming calls from not stored contacts Poco F2 Pro MIUI 13 Android 12

wendig0x avatar Sep 08 '22 16:09 wendig0x

not sure what you mean, what is the issue? What app version are you using?

tibbi avatar Sep 10 '22 21:09 tibbi

Version is 5.15.0

If i turn on "Block calls from not stored contacts" - not stored contact can still call me

wendig0x avatar Sep 11 '22 06:09 wendig0x

do you use Simple Dialer as the default app for handling calls? So you see the incoming call number shown, or it is some private calls only?

tibbi avatar Sep 11 '22 08:09 tibbi

Yes, i use Simple Dialer as the default app for handling calls. And I see the incoming call number when someone calls me

wendig0x avatar Sep 11 '22 08:09 wendig0x

I am experiencing this as well. I would be willing to help out because I have a phone # that gets SPAM/ROBO calls all day long. I can attach a debugger to the dialer app but I would just need some guidance on breakpoints or logging I could add to help us determine the root cause.

bzark avatar Oct 27 '22 02:10 bzark

@wendig0x does the issue still exist in the latest version? Some call-blocking changes were made after version 5.15.0 was released

naveensingh avatar Oct 27 '22 09:10 naveensingh

@bzark what app version and device are you on?

When you receive these calls, are you able to see the caller number (in the notification or on-screen)?

naveensingh avatar Oct 27 '22 09:10 naveensingh

@bzark what app version and device are you on?

When you receive these calls, are you able to see the caller number (in the notification or on-screen)?

@wendig0x does the issue still exist in the latest version? Some call-blocking changes were made after version 5.15.0 was released

Yes, I'm running 5.15.0 and it still happens.

bzark avatar Oct 27 '22 10:10 bzark

I get the notification in the call history. Sometimes it rings and there is no display of any notification, the phone just rings

bzark avatar Oct 27 '22 10:10 bzark

all right, thanks. I'm working on this.

naveensingh avatar Oct 27 '22 10:10 naveensingh

@bzark are you also on a device running MIUI rom?

naveensingh avatar Oct 27 '22 11:10 naveensingh

@bzark are you also on a device running MIUI rom?

I'm running on Android 10

bzark avatar Oct 27 '22 11:10 bzark

Hey! @bzark @wendig0x

I have uploaded a test APK here: https://github.com/Naveen3Singh/Simple-Dialer/releases/download/test_call_blocking_q_plus/dialer-fdroid-debug.apk

If you are willing, pls test and see if the issue still exists. You can uninstall the test app afterward. (It'll show up as "Dialer_debug").

Note: On android 10 and above, Simple dialer must be the default Caller ID app for call blocking to work. Once requested, choose Simple dialer as the default caller id app.

naveensingh avatar Oct 27 '22 17:10 naveensingh

Note: On android 10 and above, Simple dialer must be the default Caller ID app for call blocking to work. Once requested, choose Simple dialer as the default caller id app.

On Android 10 you are talking about Settings -> Apps & notifications -> Default apps -> Caller ID & spam app

You are saying that Dialer needs to be set there correct?

bzark avatar Oct 28 '22 01:10 bzark

Yes. You can do that with the version you have currently installed and blocking calls should work.

The apk I sent just requests it programmatically

naveensingh avatar Oct 28 '22 09:10 naveensingh

You are using RoleManager to set ROLE_CALL_SCREENING? Or is your code automatically setting it because I don't think you can do that right?

bzark avatar Oct 28 '22 09:10 bzark

Yes, that is correct. Users have to manually select the default caller ID app & spam like they choose the default dialer app. Before android 10, the default dialer app becomes the default caller ID & spam app (the same happens on android 10+ too if "None" is the default caller ID app but AFAIK this behavior is not documented anywhere and is probably unreliable)

The way things are implemented, blocking numbers by the pattern also requires Simple Dialer to be set as the default caller ID & spam app.

You can check out the related commits in this PR: https://github.com/SimpleMobileTools/Simple-Dialer/pull/471

naveensingh avatar Oct 28 '22 10:10 naveensingh

On Android 10 you are talking about Settings -> Apps & notifications -> Default apps -> Caller ID & spam app

did that work? Are you able to block unknown numbers now?

naveensingh avatar Oct 28 '22 10:10 naveensingh

On Android 10 you are talking about Settings -> Apps & notifications -> Default apps -> Caller ID & spam app

did that work? Are you able to block unknown numbers now?

No, I already received a call since I made Dialer the default call ID app. That is why I asked about attaching a debugger or adding in some debug log messages to maybe narrow down quicker what the issue is. Also I should probably run a version later than 5.15.0? You said there are fixes in later versions?

bzark avatar Oct 28 '22 18:10 bzark

No, I already received a call since I made Dialer the default call ID app.

Strange, there aren't many reasons for it to not work now.

I should probably run a version later than 5.15.0

Not exactly bug fixes, but call blocking logic was restructured a bit since 5.15.0

Debugging:

(I'm assuming you are able to perform git clones and compile/run android projects) Clone and compile the app from this branch: https://github.com/Naveen3Singh/Simple-Dialer/tree/caller_id_perm It's the same as the official branch with just the additional commits related to the caller ID role.

In SimpleCallScreeningService, these are the lines that we want to play with: https://github.com/SimpleMobileTools/Simple-Dialer/blob/b6da87f39182e40819b8d3fc1c82fe47d630836f/app/src/main/kotlin/com/simplemobiletools/dialer/services/SimpleCallScreeningService.kt#L16-L34

Add a few breakpoints or log statements (easier if you haven't used the debugger) to find out the values of number, baseConfig.blockUnknownNumbers and isBlocked in respondToCall method. Lmk if you need any help setting this up

Thanks

naveensingh avatar Oct 28 '22 18:10 naveensingh

Thanks for the detailed information, I'll get it setup in the debugger. But I just noticed this in logcat. This may be the start of what is going on. Any idea on this Exception?

Package Manager could not find ComponentName: ComponentInfo{com.simplemobiletools.dialer/com.android.incallui.InCallServiceImpl}. Trying to bind anyway.: (...->CS.crCo->H.CS.crCo->H.CS.crCo.pICR)->CSW.hCCC->ICF.pFTO->ICF.oCFC@E-E-Atg java.lang.Exception at com.android.server.telecom.InCallController.getInCallServiceComponent(InCallController.java:1227) at com.android.server.telecom.InCallController.bindToServices(InCallController.java:1150) at com.android.server.telecom.InCallController.onCallAdded(InCallController.java:788) at com.android.server.telecom.CallsManager.addCall(CallsManager.java:3321) at com.android.server.telecom.CallsManager.onCallFilteringComplete(CallsManager.java:771) at com.android.server.telecom.callfiltering.IncomingCallFilter$2.loggedRun(IncomingCallFilter.java:99) at android.telecom.Logging.Runnable$1.run(Runnable.java:37) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at com.android.server.SystemServer.run(SystemServer.java:572) at com.android.server.SystemServer.main(SystemServer.java:366) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)

bzark avatar Oct 28 '22 18:10 bzark

Seems installation or device-specific, where did you install the app from?

No, I already received a call since I made Dialer the default call ID app.

maybe try clearing data and reenabling the "Block calls from not stored contact". (always test bugs with the latest version of the app from Google Play or Fdroid as it might be already fixed)

naveensingh avatar Oct 28 '22 19:10 naveensingh

I checked version 5.15.5 and whitelisting works fine on my phone now. MIUI 13.5

wendig0x avatar Oct 29 '22 07:10 wendig0x