Merge "Add AccessibilityTracing and trace AccessibilityController." into sc-dev
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -724,8 +724,7 @@ public class AppTransitionController {
|
||||
final AccessibilityController accessibilityController =
|
||||
mDisplayContent.mWmService.mAccessibilityController;
|
||||
if (accessibilityController != null) {
|
||||
accessibilityController.onAppWindowTransitionLocked(
|
||||
mDisplayContent.getDisplayId(), transit);
|
||||
accessibilityController.onAppWindowTransition(mDisplayContent.getDisplayId(), transit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1226,7 +1226,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
final int prevDisplayId = prevDc != null ? prevDc.getDisplayId() : INVALID_DISPLAY;
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(prevDisplayId,
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(prevDisplayId,
|
||||
getDisplayId());
|
||||
}
|
||||
}
|
||||
@@ -1850,7 +1850,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
}
|
||||
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onRotationChangedLocked(this);
|
||||
mWmService.mAccessibilityController.onRotationChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3400,7 +3400,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
}
|
||||
|
||||
void updateAccessibilityOnWindowFocusChanged(AccessibilityController accessibilityController) {
|
||||
accessibilityController.onWindowFocusChangedNotLocked(getDisplayId());
|
||||
accessibilityController.onWindowFocusChangedNot(getDisplayId());
|
||||
}
|
||||
|
||||
private static void onWindowFocusChanged(WindowState oldFocus, WindowState newFocus) {
|
||||
@@ -4963,7 +4963,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
if (!mLocationInParentWindow.equals(x, y)) {
|
||||
mLocationInParentWindow.set(x, y);
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(mDisplayId);
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(mDisplayId);
|
||||
}
|
||||
notifyLocationInParentDisplayChanged();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class DockedStackDividerController {
|
||||
mTouchRegion.set(touchRegion);
|
||||
// We need to report touchable region changes to accessibility.
|
||||
if (mDisplayContent.mWmService.mAccessibilityController != null) {
|
||||
mDisplayContent.mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(
|
||||
mDisplayContent.mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(
|
||||
mDisplayContent.getDisplayId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class ShellRoot {
|
||||
}
|
||||
}
|
||||
if (mDisplayContent.mWmService.mAccessibilityController != null) {
|
||||
mDisplayContent.mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(
|
||||
mDisplayContent.mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(
|
||||
mDisplayContent.getDisplayId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class WindowAnimator {
|
||||
|
||||
dc.checkAppWindowsReadyToShow();
|
||||
if (accessibilityController != null) {
|
||||
accessibilityController.drawMagnifiedRegionBorderIfNeededLocked(displayId,
|
||||
accessibilityController.drawMagnifiedRegionBorderIfNeeded(displayId,
|
||||
mTransaction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,41 @@ import java.util.List;
|
||||
*/
|
||||
public abstract class WindowManagerInternal {
|
||||
|
||||
/**
|
||||
* Interface for accessibility features implemented by AccessibilityController inside
|
||||
* WindowManager.
|
||||
*/
|
||||
public interface AccessibilityControllerInternal {
|
||||
/**
|
||||
* Enable the accessibility trace logging.
|
||||
*/
|
||||
void startTrace();
|
||||
|
||||
/**
|
||||
* Disable the accessibility trace logging.
|
||||
*/
|
||||
void stopTrace();
|
||||
|
||||
/**
|
||||
* Is trace enabled or not.
|
||||
*/
|
||||
boolean isEnabled();
|
||||
|
||||
/**
|
||||
* Add an accessibility trace entry.
|
||||
*
|
||||
* @param where A string to identify this log entry, which can be used to filter/search
|
||||
* through the tracing file.
|
||||
* @param callingParams The parameters for the method to be logged.
|
||||
* @param a11yDump The proto byte array for a11y state when the entry is generated.
|
||||
* @param callingUid The calling uid.
|
||||
* @param stackTrace The stack trace, null if not needed.
|
||||
*/
|
||||
void logTrace(
|
||||
String where, String callingParams, byte[] a11yDump, int callingUid,
|
||||
StackTraceElement[] stackTrace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface to receive a callback when the windows reported for
|
||||
* accessibility changed.
|
||||
@@ -223,6 +258,11 @@ public abstract class WindowManagerInternal {
|
||||
default void postCancelDragAndDrop() {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request the interface to access features implemented by AccessibilityController.
|
||||
*/
|
||||
public abstract AccessibilityControllerInternal getAccessibilityController();
|
||||
|
||||
/**
|
||||
* Request that the window manager call
|
||||
* {@link DisplayManagerInternal#performTraversalInTransactionFromWindowManager}
|
||||
|
||||
@@ -2176,6 +2176,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
void setInsetsWindow(Session session, IWindow client, int touchableInsets, Rect contentInsets,
|
||||
Rect visibleInsets, Region touchableRegion) {
|
||||
int uid = Binder.getCallingUid();
|
||||
final long origId = Binder.clearCallingIdentity();
|
||||
try {
|
||||
synchronized (mGlobalLock) {
|
||||
@@ -2201,8 +2202,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
// We need to report touchable region changes to accessibility.
|
||||
if (mAccessibilityController != null) {
|
||||
mAccessibilityController.onSomeWindowResizedOrMovedLocked(
|
||||
w.getDisplayContent().getDisplayId());
|
||||
mAccessibilityController.onSomeWindowResizedOrMovedWithCallingUid(
|
||||
uid, w.getDisplayContent().getDisplayId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2216,7 +2217,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
if (mAccessibilityController != null) {
|
||||
WindowState window = mWindowMap.get(token);
|
||||
if (window != null) {
|
||||
mAccessibilityController.onRectangleOnScreenRequestedLocked(
|
||||
mAccessibilityController.onRectangleOnScreenRequested(
|
||||
window.getDisplayId(), rectangle);
|
||||
}
|
||||
}
|
||||
@@ -2319,8 +2320,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
if (((attrChanges & LayoutParams.ACCESSIBILITY_TITLE_CHANGED) != 0)
|
||||
&& (mAccessibilityController != null)) {
|
||||
// No move or resize, but the controller checks for title changes as well
|
||||
mAccessibilityController.onSomeWindowResizedOrMovedLocked(
|
||||
win.getDisplayContent().getDisplayId());
|
||||
mAccessibilityController.onSomeWindowResizedOrMovedWithCallingUid(
|
||||
uid, win.getDisplayContent().getDisplayId());
|
||||
}
|
||||
|
||||
if ((privateFlagChanges & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != 0) {
|
||||
@@ -2620,7 +2621,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
win.destroySurface(false, stopped);
|
||||
}
|
||||
if (mAccessibilityController != null) {
|
||||
mAccessibilityController.onWindowTransitionLocked(win, transit);
|
||||
mAccessibilityController.onWindowTransition(win, transit);
|
||||
}
|
||||
|
||||
return focusMayChange;
|
||||
@@ -7151,6 +7152,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
checkCallerOwnsDisplay(displayId);
|
||||
|
||||
synchronized (mGlobalLock) {
|
||||
int uid = Binder.getCallingUid();
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
final WindowState win = windowForClientLocked(null, client, false);
|
||||
@@ -7162,8 +7164,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
// Notifies AccessibilityController to re-compute the window observer of
|
||||
// this embedded display
|
||||
if (mAccessibilityController != null) {
|
||||
mAccessibilityController.handleWindowObserverOfEmbeddedDisplayLocked(displayId,
|
||||
win);
|
||||
mAccessibilityController.handleWindowObserverOfEmbeddedDisplay(
|
||||
displayId, win, uid);
|
||||
}
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(token);
|
||||
@@ -7528,6 +7530,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
private final class LocalService extends WindowManagerInternal {
|
||||
|
||||
@Override
|
||||
public AccessibilityControllerInternal getAccessibilityController() {
|
||||
return AccessibilityController.getAccessibilityControllerInternal(
|
||||
WindowManagerService.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSnapshotCache() {
|
||||
synchronized (mGlobalLock) {
|
||||
@@ -7546,7 +7554,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
public void setMagnificationSpec(int displayId, MagnificationSpec spec) {
|
||||
synchronized (mGlobalLock) {
|
||||
if (mAccessibilityController != null) {
|
||||
mAccessibilityController.setMagnificationSpecLocked(displayId, spec);
|
||||
mAccessibilityController.setMagnificationSpec(displayId, spec);
|
||||
} else {
|
||||
throw new IllegalStateException("Magnification callbacks not set!");
|
||||
}
|
||||
@@ -7557,7 +7565,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
public void setForceShowMagnifiableBounds(int displayId, boolean show) {
|
||||
synchronized (mGlobalLock) {
|
||||
if (mAccessibilityController != null) {
|
||||
mAccessibilityController.setForceShowMagnifiableBoundsLocked(displayId, show);
|
||||
mAccessibilityController.setForceShowMagnifiableBounds(displayId, show);
|
||||
} else {
|
||||
throw new IllegalStateException("Magnification callbacks not set!");
|
||||
}
|
||||
@@ -7568,8 +7576,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
public void getMagnificationRegion(int displayId, @NonNull Region magnificationRegion) {
|
||||
synchronized (mGlobalLock) {
|
||||
if (mAccessibilityController != null) {
|
||||
mAccessibilityController.getMagnificationRegionLocked(displayId,
|
||||
magnificationRegion);
|
||||
mAccessibilityController.getMagnificationRegion(displayId, magnificationRegion);
|
||||
} else {
|
||||
throw new IllegalStateException("Magnification callbacks not set!");
|
||||
}
|
||||
@@ -7585,7 +7592,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
MagnificationSpec spec = null;
|
||||
if (mAccessibilityController != null) {
|
||||
spec = mAccessibilityController.getMagnificationSpecForWindowLocked(windowState);
|
||||
spec = mAccessibilityController.getMagnificationSpecForWindow(windowState);
|
||||
}
|
||||
if ((spec == null || spec.isNop()) && windowState.mGlobalScale == 1.0f) {
|
||||
return null;
|
||||
@@ -7607,9 +7614,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
mAccessibilityController = new AccessibilityController(
|
||||
WindowManagerService.this);
|
||||
}
|
||||
boolean result = mAccessibilityController.setMagnificationCallbacksLocked(
|
||||
boolean result = mAccessibilityController.setMagnificationCallbacks(
|
||||
displayId, callbacks);
|
||||
if (!mAccessibilityController.hasCallbacksLocked()) {
|
||||
if (!mAccessibilityController.hasCallbacks()) {
|
||||
mAccessibilityController = null;
|
||||
}
|
||||
return result;
|
||||
@@ -7625,9 +7632,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
WindowManagerService.this);
|
||||
}
|
||||
final boolean result =
|
||||
mAccessibilityController.setWindowsForAccessibilityCallbackLocked(
|
||||
mAccessibilityController.setWindowsForAccessibilityCallback(
|
||||
displayId, callback);
|
||||
if (!mAccessibilityController.hasCallbacksLocked()) {
|
||||
if (!mAccessibilityController.hasCallbacks()) {
|
||||
mAccessibilityController = null;
|
||||
}
|
||||
return result;
|
||||
@@ -7825,7 +7832,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
accessibilityController = mAccessibilityController;
|
||||
}
|
||||
if (accessibilityController != null) {
|
||||
accessibilityController.performComputeChangedWindowsNotLocked(displayId, true);
|
||||
accessibilityController.performComputeChangedWindowsNot(displayId, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2020,7 +2020,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
final int winTransit = TRANSIT_EXIT;
|
||||
mWinAnimator.applyAnimationLocked(winTransit, false /* isEntrance */);
|
||||
if (accessibilityController != null) {
|
||||
accessibilityController.onWindowTransitionLocked(this, winTransit);
|
||||
accessibilityController.onWindowTransition(this, winTransit);
|
||||
}
|
||||
}
|
||||
setDisplayLayoutNeeded();
|
||||
@@ -2034,7 +2034,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
if (isVisibleNow()) {
|
||||
mWinAnimator.applyAnimationLocked(TRANSIT_EXIT, false);
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onWindowTransitionLocked(this, TRANSIT_EXIT);
|
||||
mWmService.mAccessibilityController.onWindowTransition(this, TRANSIT_EXIT);
|
||||
}
|
||||
changed = true;
|
||||
if (displayContent != null) {
|
||||
@@ -2112,7 +2112,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
}
|
||||
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(getDisplayId());
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(getDisplayId());
|
||||
}
|
||||
updateLocationInParentDisplayIfNeeded();
|
||||
|
||||
@@ -2345,7 +2345,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
mWmService.requestTraversal();
|
||||
}
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onWindowTransitionLocked(this, transit);
|
||||
mWmService.mAccessibilityController.onWindowTransition(this, transit);
|
||||
}
|
||||
}
|
||||
final boolean isAnimating = mAnimatingExit || isAnimating(TRANSITION | PARENTS,
|
||||
@@ -3672,7 +3672,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
displayId);
|
||||
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(displayId);
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(displayId);
|
||||
}
|
||||
updateLocationInParentDisplayIfNeeded();
|
||||
} catch (RemoteException e) {
|
||||
@@ -4775,7 +4775,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
return;
|
||||
}
|
||||
if (mWmService.mAccessibilityController != null) {
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(getDisplayId());
|
||||
mWmService.mAccessibilityController.onSomeWindowResizedOrMoved(getDisplayId());
|
||||
}
|
||||
|
||||
if (!isSelfOrAncestorWindowAnimatingExit()) {
|
||||
|
||||
@@ -817,7 +817,7 @@ class WindowStateAnimator {
|
||||
}
|
||||
|
||||
if (mService.mAccessibilityController != null) {
|
||||
mService.mAccessibilityController.onWindowTransitionLocked(mWin, transit);
|
||||
mService.mAccessibilityController.onWindowTransition(mWin, transit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user