FileDocCategorySizeDatePackage
AccessibilityController.javaAPI DocAndroid 5.1 API3167Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar.policy

AccessibilityController

public class AccessibilityController extends Object implements AccessibilityManager.AccessibilityStateChangeListener, AccessibilityManager.TouchExplorationStateChangeListener

Fields Summary
private final ArrayList
mChangeCallbacks
private boolean
mAccessibilityEnabled
private boolean
mTouchExplorationEnabled
Constructors Summary
public AccessibilityController(android.content.Context context)


       
        AccessibilityManager am =
                (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
        am.addTouchExplorationStateChangeListener(this);
        am.addAccessibilityStateChangeListener(this);
        mAccessibilityEnabled = am.isEnabled();
        mTouchExplorationEnabled = am.isTouchExplorationEnabled();
    
Methods Summary
public voidaddStateChangedCallback(com.android.systemui.statusbar.policy.AccessibilityController$AccessibilityStateChangedCallback cb)

        mChangeCallbacks.add(cb);
        cb.onStateChanged(mAccessibilityEnabled, mTouchExplorationEnabled);
    
public voiddump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)

        pw.println("AccessibilityController state:");
        pw.print("  mAccessibilityEnabled="); pw.println(mAccessibilityEnabled);
        pw.print("  mTouchExplorationEnabled="); pw.println(mTouchExplorationEnabled);
    
private voidfireChanged()

        final int N = mChangeCallbacks.size();
        for (int i = 0; i < N; i++) {
            mChangeCallbacks.get(i).onStateChanged(mAccessibilityEnabled, mTouchExplorationEnabled);
        }
    
public booleanisAccessibilityEnabled()

        return mAccessibilityEnabled;
    
public booleanisTouchExplorationEnabled()

        return mTouchExplorationEnabled;
    
public voidonAccessibilityStateChanged(boolean enabled)

        mAccessibilityEnabled = enabled;
        fireChanged();
    
public voidonTouchExplorationStateChanged(boolean enabled)

        mTouchExplorationEnabled = enabled;
        fireChanged();
    
public voidremoveStateChangedCallback(com.android.systemui.statusbar.policy.AccessibilityController$AccessibilityStateChangedCallback cb)

        mChangeCallbacks.remove(cb);