Example usage for android.view.accessibility AccessibilityManager getAccessibilityServiceList

List of usage examples for android.view.accessibility AccessibilityManager getAccessibilityServiceList

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityManager getAccessibilityServiceList.

Prototype

@Deprecated
public List<ServiceInfo> getAccessibilityServiceList() 

Source Link

Document

Returns the ServiceInfo s of the installed accessibility services.

Usage

From source file:com.aware.Aware_Preferences.java

/**
 * Check if the accessibility service for AWARE Aware is active
 * @return boolean isActive//from   w  ww  .  j av a 2s .  c  om
 */
private boolean isAccessibilityServiceActive() {
    AccessibilityManager accessibilityManager = (AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        List<ServiceInfo> accessibilityServices = accessibilityManager.getAccessibilityServiceList();
        for (ServiceInfo s : accessibilityServices) {
            if (s.name.equalsIgnoreCase("com.aware.Applications")
                    || s.name.equalsIgnoreCase("com.aware.ApplicationsJB")) {
                return true;
            }
        }
    }
    return false;
}