Notification count

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
unlink
Posts: 5
Joined: 01 Mar 2014 14:19

Notification count

Post by unlink » 01 Mar 2014 14:28

Hi!
I'm enjoying your Automagic app, and I especially love the "alternative" airplane mode, which is the reason why I switched from Tasker :)

Now, the questions :) : can you have a "notification count" variable or something like that? I'm trying to make a flow to turn on the notification led if there are active notifications in the taskbar, but I can't find a way of keeping track of them. I can set some variable when they show up, but then how do I know if they've been cleaned or not?

Thanks!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Notification count

Post by Martin » 02 Mar 2014 12:53

Hi,

Thanks :D

The next version of Automagic will introduce a new trigger to execute a flow when a statusbar notification is cleared/removed (Android 4.3+ only). There will also be a new condition to check if notifications are currently displayed on the statusbar (also Android 4.3+ only) which should make it possible to create the flow you are looking for.

Regards,
Martin

unlink
Posts: 5
Joined: 01 Mar 2014 14:19

Re: Notification count

Post by unlink » 03 Mar 2014 07:13

Awesome! Thanks, looking forward to the next version :)

Vilo
Posts: 7
Joined: 22 May 2013 09:51

Re: Notification count

Post by Vilo » 04 Jun 2014 06:42

Hi Martin,

I'm switching from 4.4 custom ROM to 4.2 stock ROM because I'm fed up with stability issues, and now I'm facing a problem with a flow that is dealing with notifications (namely a "periodic reminder").

Under 4.4, you have introduce a couple of triggers to detect notification being displayed and removed.
It works great but only under 4.4.
Under 4.2 I have no way to detect that a certain notification has been removed from statusbar, and thus I have to use "User Present" trigger to stop my reminder, and that is not a good way to do that.

My point is : I don't understand the "4.4 mandatory" limitation, because there is hundreds of APK that use android accessibility service to detect notification arrival and dismissal ...
Could you explain to me why those triggers cannot be somehow back-ported to 4.2 and even older platforms ?

Tks ;)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Notification count

Post by Martin » 04 Jun 2014 18:50

Hi Vilo,

To my knowledge Android only sends an accessibility event when a new notification is posted but not when one is removed. Maybe there are some hacks to detect when a notification is clicked and thus removed but I think the system does not send anything when a notification is removed by an app from the background.
The next version of Automagic introduces a new trigger UI Event to execute flows on more accessibility events so you might be able to build a workaround with the next version iff the system sends an event.
Maybe you could also Execute Root Command: dumpsys notification and check whether the output contains the notification you are looking for.

The triggers you have used depend on the new notification listener feature that was introduced with Android 4.3 so the new notification triggers and conditions should also work with Android 4.3.

Regards,
Martin

Vilo
Posts: 7
Joined: 22 May 2013 09:51

Re: Notification count

Post by Vilo » 05 Jun 2014 06:39

Thanks Martin for your answer.

The obvious workaround, indeed, would be to monitor Statusbar with your command "Execute Root Command: dumpsys notification", but I had preferred doing this in a synchronous manner.
The only solution I found that is reliable is to generate a notification with an ID when reminder starts, and stop the reminder when it is clicked.

By the way this is not a very bad thing, since KK update is about to arrive on my phone.
Keep going with this wonderful tool ;-)

Post Reply