» After a reboot.
> But for the other cases (e.g. when Tasker has crashed and the accessibility service turned off), I did not found a similiar solution, because "Tasker" itself does not not show up in the selection screen for the trigger "Application launch" :-(
To detect if tasker has crashed you can use the context event / tasker / monitor start
I have been plagued by this for a while now. I resorted to making a tasker factory app that required accessibility settings and installing that. Then I added actions to my screen off task to disable then enable the accessibility settings for that app. So they basically get reset every time my screen goes off. Here is my screen off task.
Keyguard On2 (180)
A1: [X] Airplane Mode [ Set:On ] If [ %Power_saver ~ on ]
<reset accessibility settings>
A2: Secure Settings [ Configuration:Camera Files: et.dinglisch.android.tasker.MyAccessibilityServiceOld - Disabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 Continue Task After Error:On ]
A3: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A4: Secure Settings [ Configuration:Camera Files: et.dinglisch.android.tasker.MyAccessibilityServiceOld - Enabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 Continue Task After Error:On ]
A5: Stop [ With Error:Off Task: ] If [ %PACTIVE ~ *,Bed And Power,* ]
A6: Display Brightness [ Level:255 Disable Safeguard:Off Ignore Current Level:On Immediate Effect:On ]
A7: Secure Settings [ Configuration:Keyguard Enabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 Continue Task After Error:On ]
> I have been plagued by this for a while now. I resorted to making a tasker factory app that required accessibility settings and installing that. Then I added actions to my screen off task to disable then enable the accessibility settings for that app. So they basically get reset every time my screen goes off. Here is my screen off task.
Forgot to mention, the reason this works is because there is a android bug of some sort that if the accessibility settings are on for a app factory app then tasker will have accessibility rights even if tasker is not selected in the accessibility service. I know it sounds strange but this is the case on my device anyway.
> I have been plagued by this for a while now. I resorted to making a tasker factory app that required accessibility settings and installing that. Then I added actions to my screen off task to disable then enable the accessibility settings for that app. So they basically get reset every time my screen goes off. Here is my screen off task.Forgot to mention, the reason this works is because there is a android bug of some sort that if the accessibility settings are on for a app factory app then tasker will have accessibility rights even if tasker is not selected in the accessibility service. I know it sounds strange but this is the case on my device anyway.
> I'm surprised that this can be done in a single step. Could you post the action that you use?
It is in the task I posted above. I found I had to disable then enable to get it to work.
This works perfectly when tested in Tasker.
I am trying to implement this into a kid app to test if accessibility services are enabled for my app and go to the settings screen if not. I don't understand much java, so I have a couple questions:
1) This task is not working in my exported kid app, but works as expected when run from my project within Tasker. How do I debug? I can insert flashes to determine that the Perform Task action is the problem and %enabled is not set.
2) I expected to be able to check accessibility services for any package by changing the If condition at A9. The package name for my app is com.mypackage.appname so I thought I could use that in the If condition. When I look at the manifest for my app I still see net.dinglisch.android.taskerm.MyAccessibilityService.....do kid apps use Tasker's service_id? How can I distinguish between my app and tasker?
>
> I am trying to implement this into a kid app to test if accessibility services are enabled for my app
If your app is in the foreground when you want to test you can just use the %WIN value. IF %WIN ~ \%WIN then the accessibility setting are off.
That's a good idea. I can do that during initial setup, because my app is in the foreground. Typically it runs in the background though, and the screen is off (except the edge feed). When a notification is received, my app scrolls the edge to the notification feed.
If a user were to disable accessibility services for my app after they had set it up, that feature won't work...so I want my app to give a permanent notification that will take the user to accessibility settings to re-enable it. My app would not me in the foreground, in this case.
Forgot to mention, the reason this works is because there is a android bug of some sort that if the accessibility settings are on for a app factory app then tasker will have accessibility rights even if tasker is not selected in the accessibility service. I know it sounds strange but this is the case on my device anyway.
Take a look at this screenshot of the manifest for my kid app. I wonder if this is why tasker and kid accessibility is tied together.
So... the service_id for my app is:
com.myprocess.name/net.dinglisch.tasker./.MyAccessibilityService or something close to that.
If I disable all other apps from accessibility, then add my app, this java task works. If I then add other apps back to the list, this method still works.
If any other apps previously has accessibility services enabled, then I add my app as enabled, %service_id will be one of the previous apps.
If my app is the first app enabled, %service_id is always my app. This is true whether I run the talk from the project or from my app.
I need to figure out how to loop thru all the enabled apps.
Got it. Too simple, lol.
AC Accessibility Check (518)
A1: Java Function [ Return:(AccessibilityManager) manager Class Or Object:CONTEXT Function:getSystemService {Object} (String) Param:accessibility Param: Param: Param: Param: Param: Param: ]
A2: Java Function [ Return:%service_list Class Or Object:manager Function:getEnabledAccessibilityServiceList
{List} (int) Param:-1 Param: Param: Param: Param: Param: Param: ]
A3: Flash [ Text:True Long:Off ] If [ %service_list ~ *com.ruggedhunter.autococktail* ]