Page 1 of 1

Hangouts Flow

Posted: 15 Apr 2016 04:35
by jarid
Hi--I am using a Nexus 6P, Android v6.0.1, Build number MHC19Q, unrooted cellphone...trying to create a script to work with Hangouts. I need to enable or disable the Incoming Phone Calls toggle. I did a search and the locale GV is no longer functional and there seems to be nothing with Tasker or Automagic.

The steps are:
  • Open Hangouts
  • Select Menu
  • Select Settings
  • Select SMS Account Settings account
  • Enable/Disable Incoming Phone Calls
I looked at the Control UI action, but can't figure out how to do this. (I was able to do so for picking the keyboard, etc.)

Any assistance/sample flows would be appreciated.

Re: Hangouts Flow

Posted: 15 Apr 2016 08:09
by mbirth
You might want to check out the "AutoInput" plugin by joaomgcd from the Play Store.

Re: Hangouts Flow

Posted: 15 Apr 2016 20:00
by Martin
Hi,

You can start Hangouts with an action Launch App and then execute action Control UI with a script like this:

Code: Select all

sleep(2000);
click("Navigation menu");
sleep(1000);
click("Settings");
sleep(2000);
click("SMS");
I did not find the Enable/Disable Incoming Phone Calls option in my version of Hangouts so the script is not complete.
You can find the commands to execute by using the button Show Overlay Control in action Control UI. Selecting the Info-button on a screen marks the control elements in green, clicking within a green rectangle shows a few possible commands like click(...) or focus(...) etc. Selecting an entry in the dialog copies the command to the clipboard so you can paste it in action Control UI later.
The sleeps in between the commands are required since it takes some time to execute the commands and the animations on screen have to finish before the next command can be executed.

Regards,
Martin

Re: Hangouts Flow

Posted: 15 Apr 2016 20:08
by jarid
Hi--you need to install the Hangouts Dialer (a free add-on)...you still run Hangouts, but this allows out/in coming calls via the program.

Re: Hangouts Flow

Posted: 16 Apr 2016 00:35
by jarid
Okay, the "show overlay control" is a cool tool. I now have a question, in reference to the screen shots, there are two slider switches to enable/disable: 1) "Incoming phone calls" and 2) "Messages". How do I determine the state of the slider for the "Incoming phone calls" so I can enable or disable depending on my requirements?

Re: Hangouts Flow

Posted: 18 Apr 2016 18:34
by Martin
You can click on the toggle element on the right side of the setting which should support the functions isChecked, check and uncheck with coordinates. Unfortunately the toggle itself and only be addressed with direct coordinates.

You can write a script that checks the condition and then either checks or unchecks the control element:
if (isChecked(1301, 2011))
{
uncheck(1301, 2011);
}
else
{
check(1301, 2011);
}