Tasker vs Galaxy S10+

76 views
Skip to first unread message

APurohit

unread,
Sep 1, 2021, 5:37:10 PMSep 1
to Tasker

Hello,

Long time Tasker user, but not very advanced so I apologize if this question is a repeat.

I have a new S10+ phone and I have tried multiple things to get it to work properly with Tasker. I have disabled battery optimizations, added location permissions, allowed draw-over, tried reliable alarms as "always" or "off", foreground is automatically enabled on this newer version, etc... but it still doesn't run my actions when the screen is sleeping or even when locked.

The task I have simply watches to see if it's after 8pm, and I have plugged in my phone - at which point it turns on DND (Do Not Disturb). I have a similar task to disable it during the day.

The tasks work, but not when the screen is off or locked. I can see that Tasker is running (I see the icon showing the lightning bolt, even on the lockscreen)... but the action doesn't happen until I unlock. What am I missing?

Note that all this worked on my old phone (LG V30 running Oreo) but I have heard that the Samsungs are notorious for killing tasks. That said, again, I don't think Tasker is being killed, because as soon as I unlock the action happens... but why can't it happen when the screen is off or the phone is locked (like it did on my old phone)?

ktmom

unread,
Sep 2, 2021, 7:21:22 AMSep 2
to Tasker

APurohit

unread,
Sep 2, 2021, 7:41:46 AMSep 2
to Tasker
Sorry, still getting used to this system/interface.

Yes I went through the FAQ and don't kill my app stuff. Some of the FAQ is out of date (there is no "foreground" option on the newer app version, as it's always foreground now, etc). Some of the DKMA is incorrect as those screens/options aren't on my phone.

I don't believe the app is being killed. As I said, it runs the action after the phone is unlocked. So, maybe it's being "frozen" or "held" in some way, but it's not killed because I can see the Tasker icon on the lockscreen, and the action happens when I unlock...

jmjc...@gmail.com

unread,
Sep 2, 2021, 11:14:04 PMSep 2
to Tasker
What you can do is to create a few more different profiles to see how if they work when your screen is off and locked. You already have a time profile. Try a few different contexts:

1. Notification
2. Wifi Near
3. Received Text

If ALL of them don't work, then it is a battery optimization issue. If some works and some don't, then it may be a Tasker setup issue. I had a S10 before and am using a S20 now, everything runs fine.

Is Tasker a device admin app? If not, make it one.

You can also "lock" Tasker in the app drawer. Long click on Tasker icon and select keep open.

APurohit

unread,
Sep 3, 2021, 6:58:23 AMSep 3
to Tasker
I will try the other contexts and report back.

I made it a device admin app now, so we'll see if that helps.

I don't see a "lock" feature on the app. I tried in Nova Launcher (my preferred launcher) and in the One UI 3.1 launcher as well... no "keep open" option in either?

APurohit

unread,
Sep 3, 2021, 12:47:47 PMSep 3
to Tasker
Excellent advice for the extra tests. I ran the 3rd one, to turn on DND when I get any text message. And even with the screen off, this works perfectly fine. Funny thing is that on my test messages, it worked before the message even made noise. But also during my testing, I had another text come from elsewhere and that one made a sound, then activated DND. Either way, I'm ok with this behavior and it is working. This also means that the app is not being killed, as I suspected. Note that this is after setting Device Admin as well, so maybe that fixed it (I'll find out tonight, haha).

So, the question is, what I am doing wrong with my desired task? It has:
Time (from 8pm to 6am)
+
Power: Any (ie, when it's plugged in at my nightstand)
+
Not WordTrek (when I'm not running a particular app, that I need audio for)

--> DND On (this is the action to turn on the DND)

This is the setup that won't work when I plug in at night. (I have a reverse process for the morning, but I figure if we fix this, then that one will work too).  I thought maybe I forgot to give app-access, but I checked and that is turned on, so that piece should work. Not sure whether "power: any" needs any special settings?

Note, again, this same setup worked on my previous phone without issue, I simply re-created it on this phone... (I didn't load a backup, and created it fresh).

APurohit

unread,
Sep 4, 2021, 8:50:11 AMSep 4
to Tasker
Some success - the issue appears to be related to the "Not WordTrek" part of the task. If I remove that, the task works properly.

FWIW, I also disabled Device Admin, and that doesn't break it, so that has no effect here and is not necessary. (Tasker's popup says device admin is only needed if you lock the screen from a task, which I am not doing anyway, so I'll leave it off).

So, I guess the question is, why "monitoring an app" is not working. As I mentioned before, Tasker has App Usage access. App Check Method is set as "App Usage Stats" by default. I tried changing that to "Accesibility" and gave Tasker Accessibility access. Neither works (again, until the phone is unlocked).

Any idea on how to get app-detection to work properly while the phone is locked/screen-off?

jmjc...@gmail.com

unread,
Sep 4, 2021, 11:47:33 PMSep 4
to Tasker
Yes, the Invert App doesn't always work when your phone is locked.

What you can try is:

1. Create an Application context for WorkTrek. Give it a name, e.g. WorkTrek

2. In your DND profile, delete the Not WorkTrek condition and add a Profile Active context, click Invert, using the profile created in #1. It will look something like:

Time (8pm to 6am)
+
Power Any
+
Not Profile Active WorkTrek

It should work.

But your profile will trigger even if your phone is unlocked, is it what you want? Seems like, from your first post, you want something that triggers when your phone is locked only.

APurohit

unread,
Sep 6, 2021, 5:07:46 AMSep 6
to Tasker
You identified the problem perfectly - that's what was happening. Your solution worked great as well, so thanks for the help on that! It's funny that the Invert-App worked fine on my previous phones, but not here. But this got me back on track.

To detail, for others who may run into this as well, I created an application context, as you noted - I named it "wordtrek" because apparently the PACTIVE doesn't always work with the default name, from what I read. I did have to create an action, for which I just used "STOP" since I didn't want it to really do anything. I then created the Not Profile Active... this required using the Profile Active action, and the command in there ended up being: %PACTIVE ~ *,wordtrek,*

This is working for me. And, yes, this will work all the time, even when unlocked. That's fine for my needs... I need it to work "always" but more-importantly, while the phone was locked (because I didn't want to have to unlock my phone to get the DND to happen).

Again, thanks for your help, this got me squared away!

jmjc...@gmail.com

unread,
Sep 6, 2021, 9:46:03 PMSep 6
to Tasker
You are welcome
Reply all
Reply to author
Forward
0 new messages