"Call end" Failure

579 views
Skip to first unread message

jdhe...@gmail.com

unread,
May 29, 2018, 9:17:49 PM5/29/18
to Automate
The following is a flow I developed and posted to the community:
The purpose of the flow is to hang up any incoming call for which the phone number is not in my contacts.

It used to work quite well prior until I upgraded my Nexus 6P to Oreo 8.1.  Now, it fails with the following:
  2018-05-29 16:46:15.231 FAIL 192@5: java.lang.SecurityException: MODIFY_PHONE_STATE permission required.
The failure above is with the 'End call' block in the flow.

My phone is rooted, and I have the following permissions on the flow:
    make phone calls and send SMS messages
    access SMS message, call log and phone state
    access contacts and calendars
I tried removing and then reinstalling the above, but the error still persists.

I do see that the End call block stipulates it isn't officially supported, so I'm presuming that has something to do with the failure I'm getting.

Is this something you can work around on your end, or is there something I can do within the flow?


Henrik "The Developer" Lindqvist

unread,
May 29, 2018, 10:44:55 PM5/29/18
to Automate
Seems like 8.1 secured the end call API. I'll make the block use root to work around it, for now.
When Automate targetSdkVersion >= 26 (Android 8.1), in a month or two, i can revert it back to not using root, as there's a new public API for it.

Henrik "The Developer" Lindqvist

unread,
May 29, 2018, 10:46:44 PM5/29/18
to Automate
Forgot. As a workaround, use the Notification posted block to find the "incoming call" notification, then the Notification interact block to simulate a click on the hang up button.



On Wednesday, May 30, 2018 at 3:17:49 AM UTC+2, jdhedden wrote:

jdhe...@gmail.com

unread,
May 30, 2018, 12:10:37 PM5/30/18
to Automate
I successfully implemented the workaround you suggested of interacting with the incoming call notification.  I also added the 'Ringer silence' block to the flow.
It works even better than before.  Thanks.

Fran T

unread,
Jun 15, 2018, 1:13:59 AM6/15/18
to Automate
It looks like that flow has been updated to this - well done! Thank you!

http://llamalab.com/automate/community/flows/22126

grzegorz1t...@gmail.com

unread,
Jun 15, 2018, 5:48:55 PM6/15/18
to Automate
I have the same problem with end call block but workaround with notification doesnt work for me. In my sgs7 dialer notification package is "com.samsung.android.incallui" but notification interact block do nothing with it. Is only solution for me to wait for new api?

Henrik "The Developer" Lindqvist

unread,
Jun 15, 2018, 8:48:00 PM6/15/18
to Automate
What does the incoming call notification look like?

grzegorz1t...@gmail.com

unread,
Jun 20, 2018, 5:38:49 PM6/20/18
to Automate
notification looks like this

the only action of the notification interact block that works is full screen and content. every other action does nothing.

Henrik "The Developer" Lindqvist

unread,
Jun 20, 2018, 9:13:24 PM6/20/18
to Automate
Thanks. Yes, it looks like a custom layout notification, which sadly don't work with the Notification interact block.

dsanf...@gmail.com

unread,
Jul 2, 2018, 3:24:27 PM7/2/18
to Automate
Hi I'm having the same problem. What do you mean by Notification interact block?

jdhe...@gmail.com

unread,
Jul 2, 2018, 3:32:50 PM7/2/18
to Automate

Toph

unread,
Sep 28, 2018, 4:17:08 PM9/28/18
to automa...@googlegroups.com
Hi Henrik,
You had said that "When Automate targetSdkVersion >= 26 (Android 8.1), in a month or two, i can revert it back to not using root, as there's a new public API for it.".
Looks like the "Call End" block still tries to use root.  Would you be able to update it to use the new android API?
Thanks!

Henrik "The Developer" Lindqvist

unread,
Sep 28, 2018, 5:17:19 PM9/28/18
to Automate
Automate is not targetSdkVersion=26 yet, working on it now.

Toph

unread,
Sep 28, 2018, 5:20:56 PM9/28/18
to Automate
Thanks much.  Forgot for a bit that you have to make other updates to be able to use this API.

Toph

unread,
Dec 3, 2018, 12:17:44 AM12/3/18
to Automate
Hi Henrik,

So I believe version 1.16.3 is targetSdkVersion=26, but I noticed that the "Call End" block on Android 9 seems to generate a MODIFY_PHONE_STATE permission required error.
Is this supposed to work without root?  Confused because in this thread you mentioned that it should work without root using a new public API available in SDK 26.
But then in another recent thread you mention that 'The Call end block will require root on newer Android' although perhaps this was in reference to an older release.  Maybe I just haven't toggled the correct permission for it either within the app or in the android permission settings?

Thanks

Henrik "The Developer" Lindqvist

unread,
Dec 3, 2018, 5:40:04 PM12/3/18
to Automate
I got so many conflicting reports during the 1.16.* rollout that i must have fumbled in the end. I'll fix.
Message has been deleted

grzegorz1t...@gmail.com

unread,
Dec 3, 2018, 6:32:50 PM12/3/18
to Automate
after the last update, the call end block finally works (Android 8.0)

Toph

unread,
Dec 4, 2018, 1:12:56 AM12/4/18
to Automate
So there must be some difference between 8.0 and 9.0 that is responsible for the difference in behavior.

Henrik "The Developer" Lindqvist

unread,
Dec 4, 2018, 3:32:15 PM12/4/18
to Automate
We will see. Android 8.1 will continue to use the current hack, Android 9 the public API.

Toph

unread,
Jan 6, 2019, 5:31:28 PM1/6/19
to Automate
Hi Henrik,
Just following up on your message from 3-December.  I am using version 1.17.0 on Android 9.0 and although the Call End block doesn't generate an error now, it does not work.  It does nothing when it executes.  I am using the block to try to decline an unanswered incoming call.  Since it's related, has Automate been granted the exception by Google to use the Call Log (and SMS) permission groups without being set to the default handler for phone/sms/assistant?

Thanks

Henrik "The Developer" Lindqvist

unread,
Jan 6, 2019, 9:25:54 PM1/6/19
to Automate
It works in the Android 9 emulator. Either Google has patched it, or the "telecom" API installed on your device is crippled.
Please try it on an ongoing call as well.

Automate hasn't got an "exception" yet, but Tasker has so i expect it will.
However the Telephony and Costly extensions just got denied, odd since their only purpose is to improve privacy/security for pre-Android 6 users. I don't think the Google bots are smart enough to understand that. I'll have to try contacting them.

Toph

unread,
Jan 7, 2019, 5:05:18 PM1/7/19
to Automate
Actually I got it working by adding a delay.
So if I have these blocks in sequence:
1) Call incoming (proceed = when ringing) [and I do NOT answer/decline the call manually]
2) Delay 1 second (exact, wake device)
3) Call end

Then it works, meaning that block #3 will decline the incoming call.  But if I take out block #2 above (the delay), then the Call End block executes but does not actually decline the incoming call.

I am using a Pixel device with Android 9, security patch level: 5-December-2018
And it also works to end an ongoing call (if in this test flow I increase the delay to be long enough to answer the call before the call end block runs)

Hopefully the app gets the exception granted before they start blocking it.  Let us know if we can do anything to help beyond what you put in the "A call for action!" post

Henrik "The Developer" Lindqvist

unread,
Jan 7, 2019, 5:47:46 PM1/7/19
to Automate
I'll put notice in the doc about the possible delay requirement.

lateboomer88

unread,
Aug 13, 2019, 10:31:06 PM8/13/19
to automa...@googlegroups.com
Hi,

I am using Vivo phone and call end block doesn't work. It asked for MODIFY_PHONE_STATE permission to  be set. So I changed the flow to above Notification block design but it also didn't work.

There is a delay block before the Notification Posted block.

The error message is :
INFO 66@39: Notification posted? 
FAIL 66@39: java.lang.illegalStateException: Notification service not running
INFO 66@39: Stopped by failure

Henrik "The Developer" Lindqvist

unread,
Aug 13, 2019, 10:56:51 PM8/13/19
to Automate
Android has problems (re-)starting notification services due to bug. Try rebooting the device, and ensure that the "access notification..." privilege is granted.
Reply all
Reply to author
Forward
0 new messages