How can I block (doing) insistent calling

Post your questions and help other users.

Moderator: Martin

marcosnaka
Posts: 10
Joined: 19 Feb 2019 13:49

How can I block (doing) insistent calling

Post by marcosnaka » 29 Jul 2019 17:46

Hello
I come to ask for help that can save my family. My mother has a bad habit of calling her children insistently even without urgency. When we don't answer the phone, she turns to WhatsApp call and then video. Then she begins to do the same with her daughters-in-law.
I'll give her a new smartphone, and I entend to install Automagic programmed to:

1. She makes a call (by phone, WhatsApp voice or video) to a son or daughter-in-law.

2. She turns unable to call this couple for 15 minutes (by phone, WhatsApp voice or video).

3. If the son/daughter-in-law answer the phone or call back, the block is interrupted.


Please NOTE that AM should block the mobile from making insistent calling, not receiving

As the smartphone is MIUI, Control UI doesn't work well.

I'll appretiate any help.

Thanks a lot.

User avatar
Rafi4
Posts: 208
Joined: 01 Dec 2017 05:23

Re: How can I block (doing) insistent calling

Post by Rafi4 » 30 Jul 2019 00:36

hi macrosnaka
if you want to block outgoing calls for certain numbers.

trigger = outgoing calls (enter phone numbers list ,enable off hook)
action = sleep 1s
action = end call.

to block whatsapp simply create a custom widget resize the widget to your whole screen.
flow 1=trigger =app task started (select whatsapp)
action = show Custom Widget Overlay (use widget here)
flow 2= trigger = app task ended (select whatsapp here)
action = hide Custom Widget Overlay

Caution = Becareful while using overlay widgets this will block certain area of your device. first use the widget 100×100 size. after you got information about the widget. set it as your needs.

use periodic timer trigger to enable and disable the flow.
i hope this will fulfill your needs. Any doubts. please post

from record4
Samsung Galaxy j2 non rooted.
Android 5.1.1

marcosnaka
Posts: 10
Joined: 19 Feb 2019 13:49

Re: How can I block (doing) insistent calling

Post by marcosnaka » 30 Jul 2019 19:00

Thank you!

That idea of making widget is good, but won't solve the problem. I wish to block the smartphone of 1) making voice and video calls and 2) to a couple of contacts.

Hugs

User avatar
Desmanto
Posts: 1981
Joined: 21 Jul 2017 17:50

Re: How can I block (doing) insistent calling

Post by Desmanto » 01 Aug 2019 18:38

@marcosnaka : Hi,

I have a workmate whose mother also behave very similar like yours. She can call her daughter 20-30 consecutively persistently until my workmate pick it up. We already habituated hearing the ringtone singing for several minutes repeating all over again! Fortunately her mother doesn't know how to use Whatsapp call/video (only use feature phone). I told her about your post and she just thought that she is not alone.

I quite understand how you feel, although I don't experience it myself. This causing the children doesn't want to pick up the phone when actually it is emergency. It is bad habit, but sometimes we just can't help with it. The only way we can do is to reduce the impact on your side.

Below are only my ideas, I don't take any responsibililty for any damage that will happen if you act upon it. As blocking phone call can lead to unknown risk. Continue reading with your own risk!

There are several choices you can do, and Automagic can help you in most cases :
1. At your mother's phone, setup exactly just like Rafi4 pointed, block all outgoing call to certain number. For whatsapp you have to use UI Event and Control UI to end the call/video call for those number. You shouldn't block all call. But this is not effective. If I am your mother, once I found out this, I will try to uninstall AutomagiC. I will rant to you that this phone is bad, can't make a call, buy me another phone. Or other circumstance, she just call from another phone.

2. At all the children's phone, block the call from that number. If it doesn't have call blocking function, use Automagic to end the call. For whatsapp, also do the same. End the call immediately after called from mother's number. Downside are this will create many notification and still disturb the children's phones. And it require all recepient to have the Automagic. Your mother also might ask you to buy other phone, same as point 1.

3. Same as point 2, but only silent the ringing and back to the home/previous app. You don't reject the call, but simply let it ring without picking it up. You can still continue doing stuff. And your mother only know that you don't pick up, so won't think that the phone is not working. But again the same downside, and added that other maybe can't call you during the call.

4. The best solution I can think is plausible deniability method and misdirection. You only need to install Automagic at your mother phone and set it up. There are still many variations of what you can do. The main point is to make your mother think the call is in progress, but actually have ended. So the recepient won't have any distraction at all.

- You will need to take various screenshot of the call menu and whatsapp call/video and crop it to fit into widget.
- When your mother call certain number, use show widget to show the fake screenshot that the call is still in progress.
- End the call immediately, but still create sound to replace the calling tone. Make it as long as the usual calling time before auto terminated (usually around 30-45 seconds), then stop the sound and hide the widget to go back to the previous menu.
- At the widget, add another action around the end button, so if she press that, it will hide the widget immediately (call already ended before).
- You can perfectly block the phone call without any missed call notif at the recepient, as the call is ended before the recepient began ringing.

Whatsapp call/video
- For Whatsapp, almost similar method. Once call is made, ended it and replace with fake screenshot. But the problem is you still have the missed call notif in the recepient.
- You can use transparent widget method to overlay over the call/video call button, and use it to trigger the fake screenshot of calling. This way, no call is being made, but it behaves almost like calling.
- The transparent widget only shown when you are viewing certain profile. You need to make a lot of those, as you have multiple ways to call via Whatsapp. From the profile, call menu, tapping the profile photo or from the chat.
- Since it is difficult to create all those widget, maybe it is better to misdirect only after the call is being made (you still have the notif missed call)
- Video call is harder, as it need to show live stream of the front camera. I don't know how to block this, so better misdirect the button to make the same whatsapp call. (pressing the video call will make fake whatsapp call instead).
- Other specific method of blocking any call/video call from whatsapp is to disable the internet. You can turn off the wifi or mobile data (might require root if set system setting is not working).
- Or you can install another app : adguard. Then use automagic to tell adguard to block Whatsapp internet connection when call is being made to any of the specified contacts. This happen in background, so nothing is visible, the wifi/mobile data is still on, making a silent blocking. But you still have the notif of misses call. At least it won't bother you all day long, only the split moment of missed call.

MIUI is fine with Accessibility (UI event & Control UI), as long as you grant the permission, exclude Automagic from the kill list and turn off MIUI optimization. Most of these solution require you to work with Trigger UI Event and Action Control UI. As both of these are very phone specific feature (the parameter needed is different in each different phone), you have to figure it out how to use it by yourself. It require many trial and error. So, sometimes we just think is it worth the trouble to create all those?

But yeah, modern problem require modern solution. If you are OK and want to continue with it, I can guide as you create the flow. You can take a look at my Control UI tutorial : viewtopic.php?f=6&t=7320
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190829, Pie 9.0, Rooted.

marcosnaka
Posts: 10
Joined: 19 Feb 2019 13:49

Re: How can I block (doing) insistent calling

Post by marcosnaka » 09 Aug 2019 20:56

Desmanto,
(I’m sorry for this late reply, I spent the time figuring out the flows)
I really appreciate your empathy and enthusiasm in creating solutions for us! Besides, I must say your solution was very funny.
Family relationships are quite diverse, and in my case I will save a lot of time because it isn't necessary to "fool" my mother. She knows she's misbehaving, she had many troubles already, so it's ok if AM just end the calls and shows a screen notification about pacience.
So, I think I have 5 situations:
1. She makes a call that enables block flow for 20 minutes.
-
1.png
1.png (116.33 KiB) Viewed 720 times
2. She makes other calls wich are instantly blocked.
2.png
2.png (148.71 KiB) Viewed 720 times
3. 20 minutes after the first call, the block flow is disabled.
4. If I answer the first call, stop and disable block flow.
5. If I call back, stop and disable block flow.
4.png
4.png (134.96 KiB) Viewed 720 times
- All of this must happen with telephone and WhatsApp by voice and video
- All of this must happen with 2 couples. A and B, C and D. So when she calls A, she turns blocked to call A or B. If B calls back, she turns able to call A or B again.

Unfortunately It's very primitive yet.
I'd appretiate your help.

User avatar
Desmanto
Posts: 1981
Joined: 21 Jul 2017 17:50

Re: How can I block (doing) insistent calling

Post by Desmanto » 10 Aug 2019 16:39

Oh, if she already know about it, then no need to hide it anymore. Simply put a gentle (or hard) message on it when she started to misbehave.

If I go thru your flow logic, do you allow the first call to pass thru? I mean the first call can be succesful, but after that the blocker flow is activated and subsequent call will be hanged up immediately. Is that right?
Or the first call directly get blocked? If all call are blocked immediately, why need to wait for 15 or 20 minutes again? Simply just hang up every call. And if all call are blocked, it also doesn't have to splitted into 2 groups of A and B, C and D.

Simplest method
If you log the calling method of Whatsapp, using debug dialog or my variable logger flow : viewtopic.php?f=3&t=7285
You can see that all outgoing call, {notification_text} is

Code: Select all

Amy
Calling…
When call has reached recipient, and it is online, it will changed to ringing

Code: Select all

Amy
Ringing…
And Incoming call, {notification_text} is

Code: Select all

Amy
Incoming voice call
If you simply use block all outgoing and no waiting 15 or 20 minutes, then there is no need to unblock. All incoming call appear normal. You simply need to block outgoing. That is just simple one flow with trigger notif on statusbar, filter for

Code: Select all

Calling…
Remember it is ellipsis symbol, not 3 dots. You can copy from above.

After that is a simple regex script to find the called name. Then check this name in the list of the blacklisted. If yes, then use perfom notif, press the hang up button immediately.

Code: Select all

find = findAll(notification_text, '(.*)\\nCalling…', true);
called = find[0][1];

blacklist = newList("Amy", "Bob", "Christina", "Dennis");
block = containsElement(blacklist, called);
The next expression, check for block value

Code: Select all

block
True, perform the hang up. False do nothing.

This is by far, the simplest method to block the outgoing call. No time waiting block/unblock, no need to check incoming call. It only require 1 trigger, 2 action and 1 expression.

Using Blocker method
By blocking subsequent call, if you mean to hang up all the call, then it won't work. It behaves the same just like the simple flow above. The better method is preventing her from accessing the whatsapp again with the timer block.

When the call has been made, enable the blocker. The blocker can comes in several method, example a simple trigger App Task Started : Whatsapp, then use Control UI : home(). So everytime she open Whatsapp during this timeframe, it will exit back to home screen all over again. Once the waiting is over, the flow disabled and she can open whatsapp normally again. Or you can implement a full screen transparent widget with clickable ticked. Show it everytime it opens whatsapp. She can see the Whatsapp, but can't tap any button, since it is covered secretly by the widget. She can still press home or back, to exit out from whatsapp, which will then trigger App Task Ended, to hide the transparent widget. So once exited from Whatsapp, touchscreen can be used again. Widget method require 2 triggers, while Control UI : home() require only 1 trigger.

If you choose to use the time blocker, then you have to prepare for the incoming call check too. Similar to outoing above, check the incoming name, if in whitelist, disable the blocker flow. But I won't confused you first, since maybe you are good with the simplest method.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190829, Pie 9.0, Rooted.

marcosnaka
Posts: 10
Joined: 19 Feb 2019 13:49

Re: How can I block (doing) insistent calling

Post by marcosnaka » 12 Aug 2019 18:49

Hello!
Thanks again! I'll study your codes.
Yes, she can call but will be blocked for 20 minutes after that. Blocking WhatsApp isn't good because if it's really important she'll need to text or send audio. ;)

I'll come back when have learned this lesson.

Thanks!

marcosnaka
Posts: 10
Joined: 19 Feb 2019 13:49

Re: How can I block (doing) insistent calling

Post by marcosnaka » 12 Aug 2019 20:25

Well...
I have failed already. :cry:
the error message is at the end of this post.

But is it possible without script? For me it would be easier. The images I attached earlier are so big it's difficult to understand, so I'll try to explain better:

TRIGGER: Notificatoin on statusbar displayed
Package name = com.whatsapp
Content title - contains text
"Bob" or "Anne" <- I couldn't do using OR. Is it possible?

Then...

CONDITION: if notification_ticker_text are "voice call received" or "video call received" (I used your Variable Logger to discover this), it means that it's an incoming call, then she'll be unblocked.
I made an Expression:

Code: Select all

notification_ticker_text == "voice call received" OR "video call received"
But I got an error message "Could not convert value X to boolean" :cry: How can I fix it?

Then...

If it's true: unblock mom, cause I called her.
If it's false: Click button "reject"

This would solve the main problem.

Here is the error from your script:
error.jpg
error.jpg (43.09 KiB) Viewed 665 times

User avatar
Rafi4
Posts: 208
Joined: 01 Dec 2017 05:23

Re: How can I block (doing) insistent calling

Post by Rafi4 » 12 Aug 2019 22:05

Hi marcosnaka
Use init notification on Statusbar action example default variable "notifications".
Check all notification_title,
notification_text,notification_ticker_text etc
Expression code as

contains(notifications,insert your needs here example as title or ticker text etc="insert your needs here notification_text or notification_ticker_text etc "
Example code as finally

Code: Select all

contains(notifications,title="Mp3 is running")
From record4
Samsung Galaxy j2 non rooted.
Android 5.1.1

marcosnaka
Posts: 10
Joined: 19 Feb 2019 13:49

Re: How can I block (doing) insistent calling

Post by marcosnaka » 13 Aug 2019 13:02

Thanks, Rafi4

How can I use OR? This didn't work:

Code: Select all

contains (notifications,notification_ticker_text="Voice call received" OR "Video call received")

Post Reply