summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-06-10 18:59:30 -0700
committerSvetoslav <svetoslavganov@google.com>2014-06-12 08:26:21 -0700
commit4604abc97d7dd757bb76ff9b7fcf343dc4a15212 (patch)
treee6dcea83ff38bc8b2afde5a1eef06b747cb88afd
parent006812acd20337b646454c3415172ebd369d2a04 (diff)
downloadframeworks_base-4604abc97d7dd757bb76ff9b7fcf343dc4a15212.zip
frameworks_base-4604abc97d7dd757bb76ff9b7fcf343dc4a15212.tar.gz
frameworks_base-4604abc97d7dd757bb76ff9b7fcf343dc4a15212.tar.bz2
Moving and resizing windows not reported propely for accessibility.
When the position and size of a window changes we have to report that to the accessibility layer if the window introspection is enabled. bug:15569915 Change-Id: I3f869e0a582592bfa5f3743d5c2133ee8cb39b34
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java22
-rw-r--r--services/core/java/com/android/server/wm/AccessibilityController.java9
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java8
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java8
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;