Search in sources :

Example 6 with AccessibilityWindowInfo

use of android.view.accessibility.AccessibilityWindowInfo in project android_frameworks_base by crdroidandroid.

the class AccessibilityManagerService method dump.

@Override
public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) {
    mSecurityPolicy.enforceCallingPermission(Manifest.permission.DUMP, FUNCTION_DUMP);
    synchronized (mLock) {
        pw.println("ACCESSIBILITY MANAGER (dumpsys accessibility)");
        pw.println();
        final int userCount = mUserStates.size();
        for (int i = 0; i < userCount; i++) {
            UserState userState = mUserStates.valueAt(i);
            pw.append("User state[attributes:{id=" + userState.mUserId);
            pw.append(", currentUser=" + (userState.mUserId == mCurrentUserId));
            pw.append(", touchExplorationEnabled=" + userState.mIsTouchExplorationEnabled);
            pw.append(", displayMagnificationEnabled=" + userState.mIsDisplayMagnificationEnabled);
            pw.append(", autoclickEnabled=" + userState.mIsAutoclickEnabled);
            if (userState.mUiAutomationService != null) {
                pw.append(", ");
                userState.mUiAutomationService.dump(fd, pw, args);
                pw.println();
            }
            pw.append("}");
            pw.println();
            pw.append("           services:{");
            final int serviceCount = userState.mBoundServices.size();
            for (int j = 0; j < serviceCount; j++) {
                if (j > 0) {
                    pw.append(", ");
                    pw.println();
                    pw.append("                     ");
                }
                Service service = userState.mBoundServices.get(j);
                service.dump(fd, pw, args);
            }
            pw.println("}]");
            pw.println();
        }
        if (mSecurityPolicy.mWindows != null) {
            final int windowCount = mSecurityPolicy.mWindows.size();
            for (int j = 0; j < windowCount; j++) {
                if (j > 0) {
                    pw.append(',');
                    pw.println();
                }
                pw.append("Window[");
                AccessibilityWindowInfo window = mSecurityPolicy.mWindows.get(j);
                pw.append(window.toString());
                pw.append(']');
            }
        }
    }
}
Also used : AccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo) AccessibilityService(android.accessibilityservice.AccessibilityService) Point(android.graphics.Point)

Example 7 with AccessibilityWindowInfo

use of android.view.accessibility.AccessibilityWindowInfo in project android_frameworks_base by DirtyUnicorns.

the class AccessibilityManagerService method dump.

@Override
public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) {
    mSecurityPolicy.enforceCallingPermission(Manifest.permission.DUMP, FUNCTION_DUMP);
    synchronized (mLock) {
        pw.println("ACCESSIBILITY MANAGER (dumpsys accessibility)");
        pw.println();
        final int userCount = mUserStates.size();
        for (int i = 0; i < userCount; i++) {
            UserState userState = mUserStates.valueAt(i);
            pw.append("User state[attributes:{id=" + userState.mUserId);
            pw.append(", currentUser=" + (userState.mUserId == mCurrentUserId));
            pw.append(", touchExplorationEnabled=" + userState.mIsTouchExplorationEnabled);
            pw.append(", displayMagnificationEnabled=" + userState.mIsDisplayMagnificationEnabled);
            pw.append(", autoclickEnabled=" + userState.mIsAutoclickEnabled);
            if (userState.mUiAutomationService != null) {
                pw.append(", ");
                userState.mUiAutomationService.dump(fd, pw, args);
                pw.println();
            }
            pw.append("}");
            pw.println();
            pw.append("           services:{");
            final int serviceCount = userState.mBoundServices.size();
            for (int j = 0; j < serviceCount; j++) {
                if (j > 0) {
                    pw.append(", ");
                    pw.println();
                    pw.append("                     ");
                }
                Service service = userState.mBoundServices.get(j);
                service.dump(fd, pw, args);
            }
            pw.println("}]");
            pw.println();
        }
        if (mSecurityPolicy.mWindows != null) {
            final int windowCount = mSecurityPolicy.mWindows.size();
            for (int j = 0; j < windowCount; j++) {
                if (j > 0) {
                    pw.append(',');
                    pw.println();
                }
                pw.append("Window[");
                AccessibilityWindowInfo window = mSecurityPolicy.mWindows.get(j);
                pw.append(window.toString());
                pw.append(']');
            }
        }
    }
}
Also used : AccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo) AccessibilityService(android.accessibilityservice.AccessibilityService) Point(android.graphics.Point)

Example 8 with AccessibilityWindowInfo

use of android.view.accessibility.AccessibilityWindowInfo in project robolectric by robolectric.

the class ShadowAccessibilityWindowInfo method obtain.

@Implementation
public static AccessibilityWindowInfo obtain() {
    final AccessibilityWindowInfo obtainedInstance = ReflectionHelpers.callConstructor(AccessibilityWindowInfo.class);
    StrictEqualityWindowWrapper wrapper = new StrictEqualityWindowWrapper(obtainedInstance);
    obtainedInstances.put(wrapper, Thread.currentThread().getStackTrace());
    return obtainedInstance;
}
Also used : AccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo) Implementation(org.robolectric.annotation.Implementation)

Example 9 with AccessibilityWindowInfo

use of android.view.accessibility.AccessibilityWindowInfo in project robolectric by robolectric.

the class ShadowAccessibilityWindowInfo method equals.

@Override
@Implementation
public boolean equals(Object object) {
    if (!(object instanceof AccessibilityWindowInfo)) {
        return false;
    }
    final AccessibilityWindowInfo window = (AccessibilityWindowInfo) object;
    final ShadowAccessibilityWindowInfo otherShadow = (ShadowAccessibilityWindowInfo) ShadowExtractor.extract(window);
    boolean areEqual = (type == otherShadow.getType());
    areEqual &= (parent == otherShadow.getParent());
    areEqual &= (rootNode == otherShadow.getRoot());
    areEqual &= (layer == otherShadow.getLayer());
    areEqual &= (id == otherShadow.getId());
    areEqual &= (isAccessibilityFocused == otherShadow.isAccessibilityFocused());
    areEqual &= (isActive == otherShadow.isActive());
    areEqual &= (isFocused == otherShadow.isFocused());
    Rect anotherBounds = new Rect();
    otherShadow.getBoundsInScreen(anotherBounds);
    areEqual &= (boundsInScreen.equals(anotherBounds));
    return areEqual;
}
Also used : Rect(android.graphics.Rect) AccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo) Implementation(org.robolectric.annotation.Implementation)

Example 10 with AccessibilityWindowInfo

use of android.view.accessibility.AccessibilityWindowInfo in project android_frameworks_base by ResurrectionRemix.

the class AccessibilityManagerService method dump.

@Override
public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) {
    mSecurityPolicy.enforceCallingPermission(Manifest.permission.DUMP, FUNCTION_DUMP);
    synchronized (mLock) {
        pw.println("ACCESSIBILITY MANAGER (dumpsys accessibility)");
        pw.println();
        final int userCount = mUserStates.size();
        for (int i = 0; i < userCount; i++) {
            UserState userState = mUserStates.valueAt(i);
            pw.append("User state[attributes:{id=" + userState.mUserId);
            pw.append(", currentUser=" + (userState.mUserId == mCurrentUserId));
            pw.append(", touchExplorationEnabled=" + userState.mIsTouchExplorationEnabled);
            pw.append(", displayMagnificationEnabled=" + userState.mIsDisplayMagnificationEnabled);
            pw.append(", autoclickEnabled=" + userState.mIsAutoclickEnabled);
            if (userState.mUiAutomationService != null) {
                pw.append(", ");
                userState.mUiAutomationService.dump(fd, pw, args);
                pw.println();
            }
            pw.append("}");
            pw.println();
            pw.append("           services:{");
            final int serviceCount = userState.mBoundServices.size();
            for (int j = 0; j < serviceCount; j++) {
                if (j > 0) {
                    pw.append(", ");
                    pw.println();
                    pw.append("                     ");
                }
                Service service = userState.mBoundServices.get(j);
                service.dump(fd, pw, args);
            }
            pw.println("}]");
            pw.println();
        }
        if (mSecurityPolicy.mWindows != null) {
            final int windowCount = mSecurityPolicy.mWindows.size();
            for (int j = 0; j < windowCount; j++) {
                if (j > 0) {
                    pw.append(',');
                    pw.println();
                }
                pw.append("Window[");
                AccessibilityWindowInfo window = mSecurityPolicy.mWindows.get(j);
                pw.append(window.toString());
                pw.append(']');
            }
        }
    }
}
Also used : AccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo) AccessibilityService(android.accessibilityservice.AccessibilityService) Point(android.graphics.Point)

Aggregations

AccessibilityWindowInfo (android.view.accessibility.AccessibilityWindowInfo)10 AccessibilityService (android.accessibilityservice.AccessibilityService)5 Point (android.graphics.Point)5 Implementation (org.robolectric.annotation.Implementation)3 Rect (android.graphics.Rect)2 Test (org.junit.Test)1 Config (org.robolectric.annotation.Config)1