Switch off Wifi, 3G, GPS when calling
Posted: 27 May 2014 23:45
Hi I am not a programmer and my English is not good, so please be patient! 
I want to create a rule that switch off Wifi, 3G and GPS on incoming and outgoing calls.
I've created a flow but it does not work, I know why but I do not know how to solve the problem.
The flow is (only for wifi, I think for 3G and GPS it is the same):
1. Incoming and outgoing call state ringing/off-hook
2. If wifi is enabled
3. Disable wifi
4. if call state is idle
5. Enable wifi
It works only up to 3, but, I know it is correct, it does not work on 4 and 5 because the flow is running when I am speaking on the phone, so it is not idle.
I think I need a cycle or something similar, so the 4th condition has to be something similar "until the call has off-hook do nothing, when the call is idle re-enable wifi".
But, as I just said, I am not been able to create such code.
Any advice?
Thank's to everybody!

I want to create a rule that switch off Wifi, 3G and GPS on incoming and outgoing calls.
I've created a flow but it does not work, I know why but I do not know how to solve the problem.
The flow is (only for wifi, I think for 3G and GPS it is the same):
1. Incoming and outgoing call state ringing/off-hook
2. If wifi is enabled
3. Disable wifi
4. if call state is idle
5. Enable wifi
It works only up to 3, but, I know it is correct, it does not work on 4 and 5 because the flow is running when I am speaking on the phone, so it is not idle.
I think I need a cycle or something similar, so the 4th condition has to be something similar "until the call has off-hook do nothing, when the call is idle re-enable wifi".
But, as I just said, I am not been able to create such code.
Any advice?

Thank's to everybody!