Page 1 of 1

Flow not working correctly when screen turned off?

Posted: 24 Jun 2018 17:06
by kosamja
function getLaunchIntentForPackage fails when screen turned off, any reason why?

http://automagic4android.com/flow.php?i ... b92a6bb987

Re: Flow not working correctly when screen turned off?

Posted: 25 Jun 2018 17:18
by Desmanto
I don't know much about java, very confusing especially when there is a nested function applied to the previous object. It seems you want to get the package name or app name. You can use Action Init Variable Package Info. See if there is something you can use there.

Re: Flow not working correctly when screen turned off?

Posted: 25 Jun 2018 19:31
by Martin
Hi,

I don't see why the function should fail and it seems to work on my device when screen is off. How does it fail on your device? What's the error message?

Regards,
Martin

Re: Flow not working correctly when screen turned off?

Posted: 26 Jun 2018 13:28
by kosamja
it returns null when screen is off, but works when screen is on

Re: Flow not working correctly when screen turned off?

Posted: 26 Jun 2018 15:54
by Desmanto
Probably Automagic is group into optimized battery list. You have to whitelist it from the battery optimization. Try to create a wakelock too to see if it is the cpu cycle problem. Create a blank flow, use action sleep 1 minute, keep awake, execute it manually (to create a wakelock for the next 1 minute). Trigger your display off flow and see if the function return a proper value.