Hi Manu,
I think the command for the regular PSM mode on a Samsung 4.4.2 ROM was
Execute Root Command: service call power 29 i32 1 resp.
Execute Root Command: service call power 29 i32 0, but I might be wrong and can't verify anymore.
Working with the lock screen can be quite frustrating since this area of Android is quite buggy and manufacturers like Samsung sometimes even manage to make it worse.
Following actions could work to unlock the screen:
-action
Dismiss Slide to Unlock Keyguard
-action
Set Keyguard State: Off (later turn it on again using the opposite action)
-action
Execute Root Command: input keyevent MENU (often not working on Samsung devices)
The script language in general is documented within the help page of action Script. Here's the online version:
Script.
The pattern to use in the function click() depends on the 'label' of the button which can be invisible in the case of the quick settings toggles. The quick settings toggles are especially nasty to get the values for since the quick settings are usually displayed above all other apps. Anyway, you can find the values like this:
-open an action
Control UI
-press
Show Overlay Control (note the red buttons at the top of the screen)
(pressing
INFO shows green borders around the controls of the current screen, pressing
back closes the overlay with the green borders. A touch within the green border shows the functions that potentially work for the selected control.)
-expand the quick settings area
-press
INFO (note that the overlay with the green borders is displayed behind the quick settings toggles)
-press back to close the quick settings area
-now you see the overlay with green borders superimposed on the screen
-press one of the green rectangles to show the available functions
-select one of the click-functions to copy the function to the clipboard
-press
back to close the overlay with the green borders
-paste the text in the text area with the script
Here are a few examples of quick settings toggle names:
Wi-Fi is on.,
Location is on.,
Mobile data is off. (tested on a S5 with Lollipop).
So it seems that Samsung in general uses the name of the setting with suffix "is on." or "is off.", therefore you can use click("Power saving mode is*"); to toggle the setting to the opposite value.
You could also use an action
Launch App to start the settings page of your choice and click on a toggle button or radio button within the settings page. This will also allow to change settings that are not available as a quick settings tile.
Regards,
Martin