2

I want to create a simple test application for further use later on. In this app I have an activity with a list in. I want to populate this list with the used accessibility options on the device, such as:

  • TalkBack
  • Captions
  • Magification gestures
  • Large Text
  • Power button
  • Auto-rotate screen
  • Speak passwords
  • Accessibility shortcut
  • (Text-to-speech output)
  • Touch & Hold delay

in other words, every single option I ca find and switch on in the Accessibility menu in System Settings.

I have watched this question and its answers and it contains some answers but no working soloutions when I try to implement it, chack particular acc-service

When trying out the answers, Andrews solution itself seems hack'ish and not the way to go, I can get information about TalkBack but that's the only service I can get information about. I want a list of all acessibility-services in use.

The code I've been trying out:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    listView = (ListView) findViewById(R.id.acc_list);
    ArrayAdapter<String> listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);

    ArrayList<String> serviceIds = new ArrayList<String>();
    AccessibilityManager am = (AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE);

    List<AccessibilityServiceInfo> runningServices = am.getInstalledAccessibilityServiceList();
    serviceIds.add("installed services:");
    for(AccessibilityServiceInfo asi: runningServices) {
        serviceIds.add(asi.getId());
        Log.d("APP", "service registered: " + asi.getSettingsActivityName());
    }

    List<AccessibilityServiceInfo> enabledAccList = am.getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK);
    serviceIds.add("enabled services:");
    for(AccessibilityServiceInfo asi: enabledAccList) {
        serviceIds.add(asi.getId());
        Log.d("APP", "service registered: " + asi.getSettingsActivityName());
    }

    listAdapter.addAll(serviceIds);
    listView.setAdapter(listAdapter);
}

The only result I get is below "installed services:" in the list there is "com.google.android.marvin.talkback/.talBackService".

(I am unsure about the flag in getEnabledAccessibilityServiceList(int flag), have tried different flags, still no result)

I have just about every accessibility option available turned on, how do I detect these?

Community
  • 1
  • 1
Yokich
  • 1,247
  • 1
  • 17
  • 31
  • 1
    Many of these settings are not meant to be observed by apps and cannot be accessed via public (stable) APIs. Some may not exist on OEM-customized versions of Android or they may have incompatible implementations. – alanv Oct 07 '14 at 00:32
  • Aw, that's dissapointing. It would really help me as a developer when designing for, in this case, visually impaired. Well, at least I have found out how to detect TalkBack- which was the most important for me – Yokich Oct 07 '14 at 14:18

0 Answers0