Issue with flow_name

Post your questions and help other users.

Moderator: Martin

Post Reply
Jos
Posts: 4
Joined: 07 Dec 2018 04:07

Issue with flow_name

Post by Jos » 08 Dec 2018 10:38

Hi,
I searched for it in the forum, but did not find any report or solution.

Flow A logs the value of flow_name, calls flow B and logs the value of flow_name again.
Scenario 1: The flow B is called with "wait"=true and "return values"=false. The result is, as expected: "A A".
Scenario 2: The flow B is called with "wait"=true and "return values"=true. The result is, as unexpected: "A B".

Am I missing something?
Thanks

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

Re: Issue with flow_name

Post by Desmanto » 09 Dec 2018 17:24

It is working as expected. If you set return value = true, any value from the flow B will be returned to A. In everytime you call a flow, the flow_name will be changed to the current running flow (called flow, flow B). So flow_name has been changed to "flow B". If you don't return value, the var flow_name is not returned to flow A, hence flow_name in flow A stay. But if you return the value, the flow_name which contains Flow B now, is returned to A and hence flow_name in flow A after returned become 'flow B". You have to save the flow name to some other variable first, so it won't changed.

Similar topic here : viewtopic.php?f=4&t=7011
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.

Jos
Posts: 4
Joined: 07 Dec 2018 04:07

Re: Issue with flow_name

Post by Jos » 04 Jul 2019 06:21

Thanks, Desmanto!
Is there any way to get the current flow name in any place in the flow, no matter which other sub flows were called previously inside this flow?

Pepy
Posts: 76
Joined: 31 Oct 2018 10:53
Location: Canada

Re: Issue with flow_name

Post by Pepy » 04 Jul 2019 20:17

@Jon
The best and easiest way to do this is like Desmanto said:
Desmanto wrote:
09 Dec 2018 17:24
You have to save the flow name to some other variable first, so it won't changed.
Hope my post was helpful :D
Device: OnePlus 5T running crDroid, rooted with Magisk 8-)

Post Reply