Page 1 of 1

App task started triggered continues

Posted: 05 Oct 2018 13:54
by anuraag
My device recently upgraded to 8.1 and i am trying App task started trigger. It continuously getting triggered. Tried with both methods.

Re: App task started triggered continues

Posted: 05 Oct 2018 16:24
by Desmanto
It is possible something has changed at the accessibility level. Try to turn off the accessibility and turn it on again. Try also to change the feedback type.
What device and ROM do you use? If the ROM has some default accessibility app, try to disable that.

When the flow get triggered, what do you see in the log? A bunch of triggered events? Or maybe a loop in the flow itself?

Re: App task started triggered continues

Posted: 05 Oct 2018 22:34
by anuraag
I have Moto G5+ with stock rom. I tried changing Accessibility feedback type. Same results.

I have created simple flow to test it. App task started >> Debug Dialog. So there is only bunch of trigger in log.

Re: App task started triggered continues

Posted: 06 Oct 2018 05:21
by Desmanto
Which mean your flow will reach AES within seconds. Try to use other Flow execution policy to see if the problem continue. Skip is probably will stop it.

Does this happen to app task ended too? Try to check if it exhibit the same problem. It is possible then that the accessibility detect and not-detected the app launch several times after the app started. Hence triggering so many event of app task started and ended in the short period of time.

Try the other trigger, Activity started/ended too. If it still has the same problem, it seems you need to include your debug log for analysis.

Re: App task started triggered continues

Posted: 06 Oct 2018 13:05
by anuraag
I have removed debug dialog and added a script to count how many times flow getting triggered. Surprisingly its only 1 time.

So problem here is if i add a input dialog after trigger then Automagic/android os assumes that app has lost focus or went to background. So flow gets triggered again and again when input dialog closes.

It was working fine in 7.0

Re: App task started triggered continues

Posted: 06 Oct 2018 17:00
by Desmanto
All dialog actions : debug dialog, input dialog, message dialog and confirmation dialog will shift focus from current foreground app in Oreo 8.0+. After you close the dialog and return to the previous foreground app, it will trigger the App task started again. So it is default behaviour, not a bug. You can add sleep 1 second after the dialog, and set the FEP to Skip, to ensure the flow doesn't get triggered again after input/cancelling the dialog.

Other "strange behaviour" you should know in oreo 8.0+ : you are in app A as the current foreground app. You pull down the notification bar to check something, it will trigger App Task ended (lost focus). But after you close the notification bar, we expect that it will trigger App Task Started again (focus back to app A). Somehow, it won't trigger the App Task Started. But pressing recent menu and immediately back to app A, will trigger the App Task Started. I lost several minutes of learning session, not recorded to the log because of this behaviour. Fortunately i discovered it early, so I know I need to press recent menu first before back to the app (so it trigger the log first).

Re: App task started triggered continues

Posted: 06 Oct 2018 23:18
by anuraag
Thanks. That explains everything.