diff options
4 files changed, 41 insertions, 6 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index eca1bc1..faa0c57 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -1640,6 +1640,17 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { pw.println("}]"); pw.println(); } + 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(']'); + } } } @@ -3283,7 +3294,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (mTouchInteractionInProgress && activeWindowGone) { - mActiveWindowId = INVALID_WINDOW_ID; + mActiveWindowId = mFocusedWindowId; } // Focused window may change the active one, so set the @@ -3336,10 +3347,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // The active window also determined events from which // windows are delivered. synchronized (mLock) { - mFocusedWindowId = getFocusedWindowId(); - if (mWindowsForAccessibilityCallback == null - && windowId == mFocusedWindowId) { - mActiveWindowId = windowId; + if (mWindowsForAccessibilityCallback == null) { + mFocusedWindowId = getFocusedWindowId(); + if (windowId == mFocusedWindowId) { + mActiveWindowId = windowId; + } } } } break; diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index cfd09e5..95cfa24 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -166,6 +166,15 @@ final class AccessibilityController { } } + + public void onSomeWindowResizedOrMoved() { + // Not relevant for the display magnifier. + + if (mWindowsForAccessibilityObserver != null) { + mWindowsForAccessibilityObserver.computeChangedWindows(); + } + } + /** NOTE: This has to be called within a surface transaction. */ public void drawMagnifiedRegionBorderIfNeededLocked() { if (mDisplayMagnifier != null) { diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index c5d7a54..93a763a 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -151,7 +151,6 @@ import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -9228,6 +9227,13 @@ public class WindowManagerService extends IWindowManager.Stub winAnimator.setAnimation(a); winAnimator.mAnimDw = w.mLastFrame.left - w.mFrame.left; winAnimator.mAnimDh = w.mLastFrame.top - w.mFrame.top; + + //TODO (multidisplay): Accessibility supported only for the default display. + if (mAccessibilityController != null + && displayId == Display.DEFAULT_DISPLAY) { + mAccessibilityController.onSomeWindowResizedOrMoved(); + } + try { w.mClient.moved(w.mFrame.left, w.mFrame.top); } catch (RemoteException e) { diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 4a80e3e..fe771dc 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -36,6 +36,7 @@ import android.os.Debug; import android.os.RemoteCallbackList; import android.os.SystemClock; import android.util.TimeUtils; +import android.view.Display; import android.view.IWindowFocusObserver; import android.view.IWindowId; import com.android.server.input.InputWindowHandle; @@ -1359,6 +1360,13 @@ final class WindowState implements WindowManagerPolicy.WindowState { mClient.resized(frame, overscanInsets, contentInsets, visibleInsets, reportDraw, newConfig); } + + //TODO (multidisplay): Accessibility supported only for the default display. + if (mService.mAccessibilityController != null + && getDisplayId() == Display.DEFAULT_DISPLAY) { + mService.mAccessibilityController.onSomeWindowResizedOrMoved(); + } + mOverscanInsetsChanged = false; mContentInsetsChanged = false; mVisibleInsetsChanged = false; |
