4

When targeting Android SDK (31), google play requires us to specify the isAccessibilityTool attribute in our app, if the app is not an accessibility tool then you have to declare that in your app, but where to?

If we haven't declared that in you the app google presume that you are using AccessibilityService API

If you have not declared your app to be an accessibility tool but use the AccessibilityService API, i.e. you have not set the isAccessibilityTool flag in your accessibility service’s metadata file, you will be required to complete an accessibility declaration in Play Console. source

Google Play Console now requires me to fill a form of why I am using AccessibilityService (which my app does not use) when I am targeting Android 12.

To give more details to the issue here are some images from Google Console: 1 2

I tried to create a service of AccessibilityService and in metadata to set isAccessibilityTool to false, but still google won't let me update the app till I fill the Accessibility services form:


class MyAccessibilityService: AccessibilityService() {
    override fun onAccessibilityEvent(event: AccessibilityEvent?) {}
    override fun onInterrupt() {}
}

Here is the service declaration in the AndroidManifest file:

<service
  android:name=".MyAccessibilityService"
  android:exported="true">
  <intent-filter>
     <action android:name="android.accessibilityservice.AccessibilityService" />
  </intent-filter>
  <meta-data
     android:name="android.accessibilityservice"
     android:resource="@xml/serviceconfig" />
</service>

Here is the content of serviceconfig file:

<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:isAccessibilityTool="false"
    android:packageNames="com.example.my_package"
    tools:targetApi="s" />

Am I missing out on something? Where or How to declare the isAccessibilityTool attribute to till the Console this is the app not use the AccessibilityService API?

Update

I tried to include the service metadata directly in the application tag:

<application
   ...>
<meta-data
     android:name="android.accessibilityservice"
     android:resource="@xml/serviceconfig" />
</application>

Also, I tried to use the isAccessibilityTool attribute directly in the application tag:

<application
....
 tools:targetApi="s"
 android:isAccessibilityTool="false">
</application>

non of the above worked for me

Final update

I checked the merged manifest and one of the services contains this permission:

android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"

I only removed this line and worked (thanks to Snorlax for his answer google play no more is asking me tool fill the form why I'm using AccessibilityService API.

Abed
  • 3,999
  • 1
  • 17
  • 28

2 Answers2

4

You can declare that in the manifest file's application tag of your Accessibility service

 <application...
 ...
 android:isAccessibilityTool="false"
 ...
 .. >

 ... />

OR

as an attribute to your service, your code will be

<service
 android:name=".MyAccessibilityService"
 android:exported="true"
 android:isAccessibilityTool="false">
 <intent-filter>
 <action android:name="android.accessibilityservice.AccessibilityService" 
 />
 </intent-filter>
 <meta-data
 android:name="android.accessibilityservice"
 android:resource="@xml/serviceconfig" />
 </service>

If you set isAccessibilityTool="false", but still use the service, you would need to complete the declaration on google play conbsole.

Check this for more details Declaration for apps that are NOT accessibility tools

Gouse Mohiddin
  • 420
  • 2
  • 7
3

Can you check the merged AndroidManifest? Maybe it's a library or module accessing the AccessibilityService API, you have to remove the following lines if they exist in your app AndroidManifest, if don't want to fill the Google Play usage accessibility form:

<intent-filter>
     <action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>

Also, check that you're not requesting permission for an accessibility service by accident in one of your services in the AndroidManifest:

android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"

and probably you don't need to use the isAccessibilityTool attribute.

Abed
  • 3,999
  • 1
  • 17
  • 28
Arda Kazancı
  • 8,341
  • 4
  • 28
  • 50
  • Thanks but I'm not trying to create an AccessibilityService, I only need to mark my app as not an AccessibilityTool so I google accept my update, I updated the question please read it again and take a look at the source link – Abed Dec 13 '21 at 09:01
  • In fact, if you read the question carefully you can see that I already tried to create an accessibility service – Abed Dec 13 '21 at 09:03
  • 1
    Can you check the merged manifest? Maybe it's using a library. – Arda Kazancı Dec 13 '21 at 10:01
  • Snorlax that did work I checked my app and of the services has android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" I didn't notice it was there until you said to check the merged manifest – Abed Dec 13 '21 at 19:09
  • Thank you. I think I deserve the point. I updated my answer. :) It will be enough to add it to the relevant service. android:isAccessibilityTool="false" – Arda Kazancı Dec 13 '21 at 19:17
  • Yep, you deserve the points, but your answer generally is describing how to create an accessibility service while this is irrelevant to the question. – Abed Dec 13 '21 at 19:37
  • One more thing for being transparent, adding to the service ```android:isAccessibilityTool="false"``` didn't work google still requires me to fill form why I need AccessibilityTool. – Abed Dec 13 '21 at 19:39
  • the only thing that worked is removing this line from the service ```android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"``` Please update your answer to contain only the relevant info. – Abed Dec 13 '21 at 19:42