0

I have a list of apk paths and I want to deduce the names of all the apps which have Accessibility permissions.

Can anyone suggest an approach to fetch the same?

I am using the below sample code but it doesnt seem to work.

public boolean isAccessibilityEnabled(Context context, String id)
{
AccessibilityManager am = (AccessibilityManager) 
context.getSystemService(Context.ACCESSIBILITY_SERVICE);
            List<AccessibilityServiceInfo> runningServices = am.getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK);
for (AccessibilityServiceInfo service : runningServices)
{
if (id.equals(service.getId()))
{
return true;
}
}
return false;
}
  • "I have a list of apk paths" -- what is an "apk path"? "I want to deduce the names of all the apps which have Accessibility permissions" -- use `PackageManager` both to list the installed apps and to see what permissions each app requests. – CommonsWare Nov 06 '22 at 11:55
  • By apk path, I meant the path where the application is installed on the device. – user2515165 Nov 06 '22 at 23:40
  • "I meant the path where the application is installed on the device" -- AFAIK, that information will not be useful to you. – CommonsWare Nov 06 '22 at 23:41
  • OK, if I have the package name, can I know if that app has Accessibility permissions granted?? – user2515165 Nov 07 '22 at 02:39
  • Through `PackageManager`, you can know if accessibility permission was *requested*. I do not know of a way to determine if it was *granted*. – CommonsWare Nov 07 '22 at 11:53

0 Answers0