Accessibility Service becomes disabled

3,444 views
Skip to first unread message

UncleMike

unread,
Aug 14, 2011, 3:09:03 PM8/14/11
to tas...@googlegroups.com
My Missed Notification Reminder profiles rely on Tasker's Accessibility Service.  I've noticed recently that the service occasionally becomes disabled - the check box in the settings page in Android is no longer checked.  I've been running the same ROM (Simply Stunning 5.4) for about 10 weeks, but only noticed this behavior in the past two weeks or so.  Has anyone else experienced this?

Pent

unread,
Aug 15, 2011, 2:56:02 AM8/15/11
to Tasker
You mean after a reinstall or at other times too ?

Pent

UncleMike

unread,
Aug 15, 2011, 6:46:06 PM8/15/11
to tas...@googlegroups.com
I'm not quite sure, but the last update didn't result in it being disabled, and it hasn't happened since.

brandall

unread,
Aug 15, 2011, 7:46:28 PM8/15/11
to Tasker
> I'm not quite sure, but the last update didn't result in it being disabled,
> and it hasn't happened since.

+1

It happened a lot when updating between beta versions. Each time
discovered in the same way with %NTITLE no longer functioning.

Eric Gingell

unread,
Mar 6, 2013, 6:37:10 PM3/6/13
to tas...@googlegroups.com
» After a reboot.

Eric Gingell

unread,
Mar 7, 2013, 8:55:58 AM3/7/13
to tas...@googlegroups.com
» Doesn't happen with "Run in foreground" enabled. Problem is, it puts an item on my already cluttered status bar. There are plenty of apps that use Accessibility Service that don't need to have a persistent notification in order to keep their Accessibility Service. I have no problem allowing Tasker to run in the foreground, but I would like the option to not have the notification on my status bar.

On Wednesday, March 6, 2013 4:37:10 PM UTC-7, Eric Gingell wrote:
» After a reboot.

Adamx

unread,
May 15, 2013, 1:14:23 PM5/15/13
to tas...@googlegroups.com
I have "Run in foreground" enabled, but for Tasker 4.0u1m, I'm still finding Tasker - JB accessibility service turned off. I don't know how often it happens, but it is still an issue for me. Could have something to do with updates to Cyanogenmod; next time I update I will have to see if that's when it gets turned off or if it's something else.

Cptnodegard

unread,
May 15, 2013, 1:26:10 PM5/15/13
to tas...@googlegroups.com
every time tasker crashes ( = a lot) the accessibility setting becomes disabled, but there seems to be an issue with other apps too, so I doubt it's tasker's fault

Stefan Hofmeister

unread,
Mar 31, 2015, 3:45:04 PM3/31/15
to tas...@googlegroups.com
I can confirm that the "Accessibility Service becomes disabled" problem still occurs very often, I've tested it on two running devices running the latest availavble stock ROM JellyBean v4.1.1 (PadFone 1 from ASUS and Ascend Y300 from HUAWEI ).

This is really annoying, cause I have a lot of profiles with contexts regarding the value of the variable %WIN, which requires "Accessibility Service" for "Tasker" to be enabled :-(

Sometimes after the devices' reboot, the previously enabled option becomes disabled - I've found a "work-around" by adding a tasker profile that is triggered by the event "Device Boot" and uses the plugin "Secure Settings" to re-enable it again.
But for the other cases (e.g. when Tasker has crashed and the accessibility service turned off), I did not found a similiar solution... Unfortunat
Message has been deleted

Stefan Hofmeister

unread,
Mar 31, 2015, 3:56:35 PM3/31/15
to tas...@googlegroups.com
I can confirm that the "Accessibility Service becomes disabled" problem still occurs very often, I've tested it on two running devices running the latest availavble stock ROM JellyBean v4.1.1 (PadFone 1 from ASUS and Ascend Y300 from HUAWEI ).

This is really annoying, cause I have a lot of profiles with contexts regarding the value of the variable %WIN, which requires "Accessibility Service" for "Tasker" to be enabled :-(

Sometimes after the devices' reboot, the previously enabled option becomes disabled - I've found a "work-around" by adding a tasker profile that is triggered by the event "Device Boot" and uses the plugin "Secure Settings" to re-enable it again.
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" :-(

Could you please add such an option or a "work-around"?


Am Sonntag, 14. August 2011 21:09:03 UTC+2 schrieb UncleMike:

Rich D

unread,
Mar 31, 2015, 4:22:00 PM3/31/15
to Tasker Google Groups Post

> 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 ]

  

Rich D

unread,
Mar 31, 2015, 5:00:04 PM3/31/15
to Tasker Google Groups Post


> 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.  

Stefan Hofmeister

unread,
Mar 31, 2015, 9:12:55 PM3/31/15
to tas...@googlegroups.com


Am Dienstag, 31. März 2015 23:00:04 UTC+2 schrieb Rich D:


> 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.  

Thank you very much for these hints - I've tried it with the context "Monitor start", and it worked!

If it is the case that the problem exists with other occasions on my devices, too, I will reconsider adapting your screen off task.


 

Robert Ryan

unread,
Apr 1, 2015, 3:30:34 AM4/1/15
to tas...@googlegroups.com
This subroutine will return true if Tasker's accessibility service is enabled and false if it is not.

Accessibility Enabled (68)
A1: Java Function [ Return:(AccessibilityManager) manager Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:accessibility Param: Param: Param: Param: ]
A2: Java Function [ Return:service_list Class Or Object:manager Function:getEnabledAccessibilityServiceList
{List} (int) Param:-1 Param: Param: Param: Param: ]
A3: Java Function [ Return:list_iterator Class Or Object:service_list Function:listIterator
{ListIterator} () Param: Param: Param: Param: Param: ]
<Search>
A4: Anchor
A5: Java Function [ Return:%has_next Class Or Object:list_iterator Function:hasNext
{boolean} () Param: Param: Param: Param: Param: ]
A6: Goto [ Type:Action Label Number:1 Label:Not Found ] If [ %has_next ~ false ]
A7: Java Function [ Return:( AccessibilityServiceInfo) service Class Or Object:list_iterator Function:next
{Object} () Param: Param: Param: Param: Param: ]
A8: Java Function [ Return:%service_id Class Or Object:service Function:getId
{String} () Param: Param: Param: Param: Param: ]
A9: Return [ Value:true Stop:On ] If [ %service_id ~ net.dinglisch.android.taskerm* ]
A10: Goto [ Type:Action Label Number:1 Label:Search ]
<Not Found>
A11: Anchor
A12: Return [ Value:false Stop:On ]

Test code:

Test Accessibility (71)
A1: Perform Task [ Name:Accessibility Enabled Priority:%priority+1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable:%enabled Stop:Off ]
A2: Flash [ Text:%enabled Long:Off ]

Dale Smith

unread,
Apr 1, 2015, 8:02:28 AM4/1/15
to tas...@googlegroups.com
I got an error message after a restart but the accessibility was on in Android settings.

Wietse van Buitenen

unread,
Apr 1, 2015, 2:50:52 PM4/1/15
to tas...@googlegroups.com
I also noticed that Accessibility Services doesn't work properly anymore after a Tasker crash.
I added a Task with Java that starts on Tasker Monitor Start that ill check if the accessibility works properly or not and show a fixed notification when it isn't working properly.
When I then check the Accessibility Settings, Tasker is still enabled there.
If I run the Task again it still shows as not working, when I disabled Tasker Accessibility Service and enable it again and run the Task then everything is ok..

not sure what is causing this but since I have a notification it's ok for me..

Duck Redbeard

unread,
Apr 1, 2015, 3:59:07 PM4/1/15
to tas...@googlegroups.com
I have a workaround that has made this a non issue for me. I have added a step to several tasks that re-enable the accessibility service. My phone is always in one of 4 modes (home, car, work, silent) triggered by NFC, BT, WiFi, location, time, or manually through a widget. Every time the mode changes, accessibility is enabled. No issues since adding the step. You could also set it up to enable periodically on a time context.

Robert Ryan

unread,
Apr 1, 2015, 4:22:45 PM4/1/15
to tas...@googlegroups.com


On April 1, 2015 1:59:07 PM MDT, Duck Redbeard <duckre...@gmail.com> wrote:
>I have added
>a step to several tasks that re-enable the accessibility service.

I'm surprised that this can be done in a single step. Could you post the action that you use?
Message has been deleted

Duck Redbeard

unread,
Apr 1, 2015, 4:37:43 PM4/1/15
to tas...@googlegroups.com
Tried uploading video to youtube but it keeps crashing. Dropbox link is a screen video of the task.

Duck Redbeard

unread,
Apr 1, 2015, 4:41:36 PM4/1/15
to tas...@googlegroups.com

Rich D

unread,
Apr 1, 2015, 5:21:11 PM4/1/15
to Tasker Google Groups Post


> 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. 

Jeremy Harris

unread,
Feb 1, 2016, 11:25:00 AM2/1/16
to Tasker
You would use the Secure Settings plugin.

Jeremy Harris

unread,
Feb 1, 2016, 11:42:37 AM2/1/16
to Tasker
Thank you for sharing this!

Jeremy Harris

unread,
Feb 1, 2016, 3:54:30 PM2/1/16
to tas...@googlegroups.com

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?

Thank you for sharing this!

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/mJfahPrdK1M/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Rich D

unread,
Feb 1, 2016, 4:10:05 PM2/1/16
to Tasker Google Groups Post

>
> 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. 

Jeremy Harris

unread,
Feb 1, 2016, 4:18:13 PM2/1/16
to tas...@googlegroups.com

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.

Jeremy Harris

unread,
Feb 1, 2016, 5:18:02 PM2/1/16
to tas...@googlegroups.com

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.

Screenshot_2016-02-01-17-13-16.png

Jeremy Harris

unread,
Feb 1, 2016, 9:21:50 PM2/1/16
to tas...@googlegroups.com

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.

Jeremy Harris

unread,
Feb 1, 2016, 10:03:03 PM2/1/16
to tas...@googlegroups.com

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* ]

dori waldman

unread,
Jan 15, 2017, 2:21:49 AM1/15/17
to Tasker
I read all comments and I have question 

My device is Not Rooted 

Accessibility Service in android is managed by OS , 

In my app I have am using Accessibility Service But OS can kill it , usually when I kill apps from cache, or reboot device, or after few days ...

Is there a way to make this service run all time ? re-enable it without user interaction ? 
Reply all
Reply to author
Forward
0 new messages