Switch off Wifi, 3G, GPS when calling

Post your questions and help other users.

Moderator: Martin

Post Reply
HarryCustom
Posts: 13
Joined: 27 May 2014 23:33

Switch off Wifi, 3G, GPS when calling

Post by HarryCustom » 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!

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Switch off Wifi, 3G, GPS when calling

Post by MURTUMA » 28 May 2014 07:15

Stop the flow to step three. Then create a new flow with trigger incoming/out going call: ended and continue to disable WiFi.

Your flow doesn't work because conditions doesn't run continuously to monitor something. They only check if something is true or false at the moment they run and then continue accordingly to true or false path.

HarryCustom
Posts: 13
Joined: 27 May 2014 23:33

Re: Switch off Wifi, 3G, GPS when calling

Post by HarryCustom » 28 May 2014 11:12

Ok, but this is the same end I've obtaineid with other app.
If I do another flow that check if the call is ended I ALWAYS switch on WIFI, GPS and 3G, and this is not what I want.

My objective is to renable one, two or three service, not only switch on all of them.

So, for example, if I am receiving a call and GPS and 3G are active, I want to switch on only GPS and 3G when the call ends and not also WIFI.

I don't know if it is clear.

An app do this thing it is called Sanity, but now it does not work with KitKat, it is only able to switch off Wifi. :)

tschaedl
Posts: 45
Joined: 28 Feb 2013 22:17

Re: Switch off Wifi, 3G, GPS when calling

Post by tschaedl » 28 May 2014 11:37

So remember in first flow which items you switch off (e.g. store it in a global variable)
In second flow check the variable first before switching on the item.

BTW what is the reason to disable gps, wifi etc. if you are calling??

Regards,
Thomas

HarryCustom
Posts: 13
Joined: 27 May 2014 23:33

Re: Switch off Wifi, 3G, GPS when calling

Post by HarryCustom » 28 May 2014 13:26

I would like to reduce electromagnetic emissions when I speak.
Nothing is known about the effects of electromagnetic fields, but why risk it?
I do not know if it's a suggestion, but especially when the wifi is turned on, I feel ear discomfort.
Perhaps it will serve little what I'm doing, but it's become something of a challenge! :)

As I just said this app do exactly this thing (and many other): https://play.google.com/store/apps/deta ... cri.sanity, I used it for years, but now it does not work anymore... :)

I will try using a global variable.
But also I was thinking if it is possible to use a while cycle in a single flow, I will try both possible solution.

Thanks! :)

Post Reply