Kill App not working

Post your questions and help other users.

Moderator: Martin

vertigo
Posts: 110
Joined: 28 Oct 2018 00:28

Re: Kill App not working

Post by vertigo » 21 May 2020 05:22

Well, I don't know if it was Google or Motorola, but whoever designed the missed calls notification system on this phone should look for a different line of work. I finally gave up after wasting far too much time with it, after first realizing that simply opening the stock dialer isn't enough, at least not always (it seems inconsistent), to reset the counter, and then having it work (or at least I'm pretty sure it did) to open the stock dialer and switch to the call log tab, but then that didn't work, so after switching tabs I backed out of the dialer, which worked at least once, but after setting up the flow to do it, it didn't work, even manually. It was just a nightmare. No matter what I tried, I couldn't get it to consistently work, which makes me wonder how the heck they designed it and if it even works right when just using the stock dialer and not using any third-party ones.

So then I had the idea that, since having Automagic clear the notification resets it, I could just clear it right away and replace it with one from Automagic. And doing that, it doesn't even matter if the counter is reset, since I won't be seeing it anymore. So on the first missed call, it just gets the phone number and displays it in its own notification, replacing the stock one, along with the date and time, and on subsequent missed calls it appends those and replaces the notification to show all missed calls since the notification was last manually removed. So now, it shows all numbers (before it would only show the first one, and if there were more than one missed call, it wouldn't show any) as well as the date and time of the calls. And I set a second trigger for selecting the notification, since that normally launches Automagic, to open the third-party dialer. It ended up being a much simpler flow and working much better.

Here's the flow, in case anyone else is looking to do the same:

Missed Calls Notification

I left one detached script block in there for later reference but I'd also like your input on it. I was trying to take the number in format 1234567890 and convert it to format (123) 456-7890. I ended up not needing to do that since I changed how I got the number as I went, but it did lead to spending quite a bit of time and trial and error trying to use numberformat to do it. I tried things like:

var = "{number_var,numberformat,(000)000-0000}"
var = "{number_var,numberformat,(###)###-####}"
var = "{number_var,numberformat,000-000-0000}"

and so on, but nothing worked. I'm guessing it's not possible, but it seems like that should be something the numberformat function should be able to do. Would that be a reasonable feature request? Or is it possible and I just wasn't doing it right?

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

Re: Kill App not working

Post by Desmanto » 23 May 2020 20:05

@vertigo : Don't know if you still need it. You can try to find the activity using my Windows Recognizer flow : viewtopic.php?f=3&t=6898
That flow is kinda old (one of the early flow I started to share), I might one day update it to be the same as secure setting logger one.
After you find the activity, use that in the start activity, in the class name.

To split add the phone number, you can't use numberformat, since those are not valid numberformat pattern separator. You can use regex pattern replace to split and replace add symbol in between. But you need to specify first, how many codes to split. I take example of 3 area code, split by another 3 and the rest.

Code: Select all

var = "1234567890";
showvar = replaceAll('1234567890', '(\\d{3})(\\d{3})(\\d+)', '($1) $2-$3'); //(123) 456-7890
You can also use split number and concatenate the parts one by one. But I always try to use regex whenever possible, to strengthen my regex skill.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

vertigo
Posts: 110
Joined: 28 Oct 2018 00:28

Re: Kill App not working

Post by vertigo » 26 May 2020 11:11

Ah, regex. Yeah, that would've been a good way to go. I have a love/hate relationship with it. I love how powerful and useful it is, but hate how complex it can be, especially since it seems every program that uses it has its own implementation of it with different syntax, so I can't just learn and practice one "language." I really wish it were standardized.

Post Reply