Flow not working correctly when screen turned off?

Post your questions and help other users.

Moderator: Martin

Post Reply
kosamja
Posts: 9
Joined: 30 Nov 2017 11:08

Flow not working correctly when screen turned off?

Post by kosamja » 24 Jun 2018 17:06

function getLaunchIntentForPackage fails when screen turned off, any reason why?

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

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

Re: Flow not working correctly when screen turned off?

Post by Desmanto » 25 Jun 2018 17:18

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.
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.

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

Re: Flow not working correctly when screen turned off?

Post by Martin » 25 Jun 2018 19:31

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

kosamja
Posts: 9
Joined: 30 Nov 2017 11:08

Re: Flow not working correctly when screen turned off?

Post by kosamja » 26 Jun 2018 13:28

it returns null when screen is off, but works when screen is on

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

Re: Flow not working correctly when screen turned off?

Post by Desmanto » 26 Jun 2018 15:54

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.
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.

Post Reply