How to enable Accessibility service in Android management api (Work profile )?

1.9k views Asked by At

I recently developed an app with Android Management API. This app has Accessibility service MyAccessibilityService.

I granted accessibility service permission from enterprise policy from enterprises.policies as

{
....
"permittedAccessibilityServices": {
"packageNames": [
"com.trackify.management.access.MyAccessibilityService",
]
}
....
}

From this doc

Specifies permitted accessibility services. If the field is not set, any accessibility service can be used. If the field is set, only the accessibility services in this list and the system's built-in accessibility service can be used. In particular, if the field is set to empty, only the system's built-in accessibility servicess can be used.

When i check app in work profile , app has not auto granted the accessibility permission and navigate to accessibility setting page where i can't find any downloaded services of my package name.

This app works on personal profile.

I think this accessibility permission should be automatically granted when i mentioned permittedAccessibilityServices object in enterprise policy.

Again i tried on both work and personal profile, Now i can't do enable accessibility and it's disable by default . when i try to enable it shows dialog with

can't enable . please contact your admin

Can someone please help me to solve this.

1

There are 1 answers

1
Kevin On

For devices running on work profile mode, the app needs to be installed in the personal profile to be able to use it.

There is an open feature request with the Android team to remove the requirement to have the app installed in the primary profile in order to be able to grant accessibility services but there’s no timeline for if, or when, that will be implemented.