However the profile is not working as I want. The Tasker profile is detecting whether this app is in focus, not simply whether it is open.
I think detecting background apps using this method is nerfed in Android 8+ because ActivityManager.getRunningServices() was deprecated.
Reference: https://developer.android.com/reference/android/app/ActivityManager#getRunningServices(int)
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
When you selected the app did you turn on both "Activity" and "Services"?
On Tue, Jul 24, 2018 at 11:19 AM, Alan <alan....@gmail.com> wrote:
I'm using Nougat. Apparently access to running apps requires root on Nougat, based on the messages I get from KC Tasker Process Running. I've reverted from rooted Marshmallow to stock Nougat in hopes of getting Oreo OTA so I'm trying to avoid rooting for now. Tradeoffs....For now, I'm using the builtin Apps profile to detect what's in focus.
On Tuesday, July 24, 2018 at 12:10:48 PM UTC-4, Robert Ryan wrote:What Android version are you using? Are you trying to do this by using the services tab of an application context?I think detecting background apps using this method is nerfed in Android 8+ because ActivityManager.getRunningServices() was deprecated.
Reference: https://developer.android.com/reference/android/app/ActivityManager#getRunningServices(int)
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Yes that ought to be possible. But it requires root.
I'm still not sure how it can be available without root. I would think the locked bootloader + stock selinux would block access to settings from an app context. But maybe someone has tried it and can confirm otherwise.
But what happens if the app goes out of focus (starting the 900 sec timer) and then comes back into focus? I think the timer continues, and eventually sets the locking delay to 5 seconds even though the app is been back in focus at that time. There could even be multiple timers running due to coming in and out of focus. Seems like a problem.
Collisions
Sometimes a task needs to be executed of which a copy is already executing. This can happen quite often e.g. when a task widget button is pressed twice quickly, or a task contains a Wait action or shows a dialog.
The way in which a collision is resolved is specified by the user. There are 3 options:
the new task is ignored (the default)
the existing task is aborted and the new one starts from its first action. The current action of the previous task is finished if it is already being carried out.
both tasks run simultaneously
Note that the last option can lead to several copies of a task all running at once.
So, if there is a single instance of the 900 second timer running, and I'm using the app with it going into and out of focus in my normal pattern, I'll still get different results depending on whether the app happens to be in focus or out of focus at the moment the 900 second timer expires. Right?
On Saturday, July 28, 2018 at 2:46:30 PM UTC-4, Duck Redbeard wrote:From the user guide:Collisions
Sometimes a task needs to be executed of which a copy is already executing. This can happen quite often e.g. when a task widget button is pressed twice quickly, or a task contains a Wait action or shows a dialog.
The way in which a collision is resolved is specified by the user. There are 3 options:the new task is ignored (the default)
the existing task is aborted and the new one starts from its first action. The current action of the previous task is finished if it is already being carried out.
both tasks run simultaneously
Note that the last option can lead to several copies of a task all running at once.
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.