FileDocCategorySizeDatePackage
AccessibilityController.javaAPI DocAndroid 5.1 API56446Thu Mar 12 22:22:42 GMT 2015com.android.server.wm

AccessibilityController

public final class AccessibilityController extends Object
This class contains the accessibility related logic of the window manger.

Fields Summary
private final WindowManagerService
mWindowManagerService
private static final float[]
sTempFloats
private DisplayMagnifier
mDisplayMagnifier
private WindowsForAccessibilityObserver
mWindowsForAccessibilityObserver
Constructors Summary
public AccessibilityController(WindowManagerService service)


       
        mWindowManagerService = service;
    
Methods Summary
public voiddrawMagnifiedRegionBorderIfNeededLocked()
NOTE: This has to be called within a surface transaction.

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.drawMagnifiedRegionBorderIfNeededLocked();
        }
        // Not relevant for the window observer.
    
public android.view.MagnificationSpecgetMagnificationSpecForWindowLocked(WindowState windowState)

        if (mDisplayMagnifier != null) {
            return mDisplayMagnifier.getMagnificationSpecForWindowLocked(windowState);
        }
        return null;
    
public booleanhasCallbacksLocked()

        return (mDisplayMagnifier != null
                || mWindowsForAccessibilityObserver != null);
    
public voidonAppWindowTransitionLocked(WindowState windowState, int transition)

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.onAppWindowTransitionLocked(windowState, transition);
        }
        // Not relevant for the window observer.
    
public voidonRectangleOnScreenRequestedLocked(android.graphics.Rect rectangle)

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.onRectangleOnScreenRequestedLocked(rectangle);
        }
        // Not relevant for the window observer.
    
public voidonRotationChangedLocked(DisplayContent displayContent, int rotation)

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.onRotationChangedLocked(displayContent, rotation);
        }
        if (mWindowsForAccessibilityObserver != null) {
            mWindowsForAccessibilityObserver.scheduleComputeChangedWindowsLocked();
        }
    
public voidonSomeWindowResizedOrMovedLocked()

        // Not relevant for the display magnifier.

        if (mWindowsForAccessibilityObserver != null) {
            mWindowsForAccessibilityObserver.scheduleComputeChangedWindowsLocked();
        }
    
public voidonWindowFocusChangedNotLocked()

        // Not relevant for the display magnifier.

        WindowsForAccessibilityObserver observer = null;
        synchronized (mWindowManagerService) {
            observer = mWindowsForAccessibilityObserver;
        }
        if (observer != null) {
            observer.performComputeChangedWindowsNotLocked();
        }
    
public voidonWindowLayersChangedLocked()

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.onWindowLayersChangedLocked();
        }
        if (mWindowsForAccessibilityObserver != null) {
            mWindowsForAccessibilityObserver.scheduleComputeChangedWindowsLocked();
        }
    
public voidonWindowTransitionLocked(WindowState windowState, int transition)

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.onWindowTransitionLocked(windowState, transition);
        }
        if (mWindowsForAccessibilityObserver != null) {
            mWindowsForAccessibilityObserver.scheduleComputeChangedWindowsLocked();
        }
    
private static voidpopulateTransformationMatrixLocked(WindowState windowState, android.graphics.Matrix outMatrix)

        sTempFloats[Matrix.MSCALE_X] = windowState.mWinAnimator.mDsDx;
        sTempFloats[Matrix.MSKEW_Y] = windowState.mWinAnimator.mDtDx;
        sTempFloats[Matrix.MSKEW_X] = windowState.mWinAnimator.mDsDy;
        sTempFloats[Matrix.MSCALE_Y] = windowState.mWinAnimator.mDtDy;
        sTempFloats[Matrix.MTRANS_X] = windowState.mShownFrame.left;
        sTempFloats[Matrix.MTRANS_Y] = windowState.mShownFrame.top;
        sTempFloats[Matrix.MPERSP_0] = 0;
        sTempFloats[Matrix.MPERSP_1] = 0;
        sTempFloats[Matrix.MPERSP_2] = 1;
        outMatrix.setValues(sTempFloats);
    
public voidsetMagnificationCallbacksLocked(android.view.WindowManagerInternal.MagnificationCallbacks callbacks)

        if (callbacks != null) {
            if (mDisplayMagnifier != null) {
                throw new IllegalStateException("Magnification callbacks already set!");
            }
            mDisplayMagnifier = new DisplayMagnifier(mWindowManagerService, callbacks);
        } else {
            if  (mDisplayMagnifier == null) {
                throw new IllegalStateException("Magnification callbacks already cleared!");
            }
            mDisplayMagnifier.destroyLocked();
            mDisplayMagnifier = null;
        }
    
public voidsetMagnificationSpecLocked(android.view.MagnificationSpec spec)

        if (mDisplayMagnifier != null) {
            mDisplayMagnifier.setMagnificationSpecLocked(spec);
        }
        if (mWindowsForAccessibilityObserver != null) {
            mWindowsForAccessibilityObserver.scheduleComputeChangedWindowsLocked();
        }
    
public voidsetWindowsForAccessibilityCallback(android.view.WindowManagerInternal.WindowsForAccessibilityCallback callback)

        if (callback != null) {
            if (mWindowsForAccessibilityObserver != null) {
                throw new IllegalStateException(
                        "Windows for accessibility callback already set!");
            }
            mWindowsForAccessibilityObserver = new WindowsForAccessibilityObserver(
                    mWindowManagerService, callback);
        } else {
            if (mWindowsForAccessibilityObserver == null) {
                throw new IllegalStateException(
                        "Windows for accessibility callback already cleared!");
            }
            mWindowsForAccessibilityObserver = null;
        }