Page 1 of 1

Turn Screen On is not working

Posted: 05 Dec 2018 16:44
by regissg
I have a widget showing a full screen clock.

I want to show this widget when the tablet is going to standby

My flow is as followed:

Trigger: Display State Off
Action: Turn Screen On
Action: Show custom widget Clock

The screen does not turn on when the tablet is going to standby even though the flow is executed (the clock is visible when I exit standby by pressing the home or power key). Any idea why?

I have tried to add a sleep delay before the Turn Screen On action but it does not help.

I am using an un-rooted Samsung Galaxy Tab S2 with Automagic V 1.36.0

Re: Turn Screen On is not working

Posted: 07 Dec 2018 20:57
by Martin
That's strange. This action uses an official API and should be supported on all devices. Maybe it's simply not properly supported on this device. What Android version are you using?
Are you using any apps that could prevent wake locks from working (usually requires a rooted device)?

Maybe as a workaround you could use action Input Dialog with option Turn screen on and maybe with option Show when locked and a short timeout to see if this could work.

Regards,
Martin

Re: Turn Screen On is not working

Posted: 09 Dec 2018 17:34
by Desmanto
Try to make sure you have granted Automagic the device administrator permission. It is related to lock security, but probably somehow the ROM need it.

Re: Turn Screen On is not working

Posted: 06 Sep 2019 18:10
by docb
Hi, sorry to bring up this old topic, but I have the same issue. It worked all the time but i think it was the Oreo 8.1 update which damaged that.
I have all rights set and your workaround with InputDialog works - but does not look so cool when having a dialog on the screen for a second for no reason ;-) (although I put the timeout on 101ms, the diaolog is shown for about 1 sek.
Is there any other more "not visible" workaround?
Best

Re: Turn Screen On is not working

Posted: 07 Sep 2019 04:23
by Desmanto
What is your phone model and ROM type? You need to try to grant device admin. Check the notification permission too, make sure all are granted.

Do you have root? If yes, then you can try action Execute root Command : input keyevent WAKEUP

Re: Turn Screen On is not working

Posted: 07 Sep 2019 06:46
by docb
I have a Samsung Galaxy Tab A (2016) SM-T580 with Android 8.1.0 Original Rom (M1AJQ.T580XXXU4CSA1) and Automagic has all permissions. Unfortunately no root.
And my second device Samsung Galaxy Tab A SM-T555 with Android 7.1.1 Original Rom

Re: Turn Screen On is not working

Posted: 07 Sep 2019 14:45
by Desmanto
So the Oreo one have problem but the nougat one has no problem with the turn screen on?

It can be limitation on samsung ROM. Maybe there is additional setting deep down somewhere that can be toggled to solve it. But you have to try to find it. Maybe looking at the developer option.

The other workaround beside timeout, is to use no timeout at all (or you can just leave it there). Add another control UI parallel to the input dialog, so they executed at the same time (both input dialog and CUI connected directly to the same previous element). Depends on your input dialog type, it can have cancel button or not. Just use Single Choice, then use this CUI script.

Code: Select all

timer = 0;
while(!existsElementById("android:id/button2") AND sleep(50) AND timer <= 3000)
  timer = timer + 50;

clickById("android:id/button2");
When the input dialog executed, the CUI will be executed at the same time. It sleeps for 50 ms in loop, waiting for the dialog to appear and then click the cancel button. It should be much faster than using timeout. But you still can spot the blink of the input dialog, it is just much faster only. Accessibility services must be enabled for Automagic.

This is my latest method to wait loop for certain element. It consist elementId checking (for the element we are waiting); sleep(), which always return true and another timer to make sure it doesn't loop forever (10000 loop).

Re: Turn Screen On is not working

Posted: 07 Sep 2019 19:07
by docb
Thansks for all the help. I just rooted both. Now the T580 is working fine, unfortunately the T555 still does not want.
Did i get your trick right - cause that does not work either:
Execute root commandline - and as a command i put: input keyevent WAKEUP

Ha - Forget it - it works - the I of input was a capital letter. Perfect, this way I get it working!
Thank you so much!