Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c29c7a7 authored by Winson Chung's avatar Winson Chung
Browse files

Ensure accessibility updates during the recents animation

- There is no focused window (only the input consumer) during the
  recents animation so depending on when the window changes are
  computed for accessibility, it is possible that accessibility will
  not updated to reflect Launcher being visible.  In these cases
  where we are swiping up to home, we already prevent input from
  going to the app (via the input consumer) and the home app should
  be considered for accessibility.

Bug: 183238051
Test: Enable live tile, swipe up to enter Overview repeatedly
Change-Id: I2503010c9e5dd1898f9c21ff9a9ee91c1be0d16f
parent 45d9b3b7
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -1511,10 +1511,15 @@ final class AccessibilityController {
            IBinder topFocusedWindowToken = null;
            IBinder topFocusedWindowToken = null;


            synchronized (mService.mGlobalLock) {
            synchronized (mService.mGlobalLock) {
                // Do not send the windows if there is no top focus as
                // If there is a recents animation running, then use the animation target as the
                // the window manager is still looking for where to put it.
                // top window state. Otherwise,do not send the windows if there is no top focus as
                // We will do the work when we get a focus change callback.
                // the window manager is still looking for where to put it. We will do the work when
                final WindowState topFocusedWindowState = getTopFocusWindow();
                // we get a focus change callback.
                final RecentsAnimationController controller =
                        mService.getRecentsAnimationController();
                final WindowState topFocusedWindowState = controller != null
                        ? controller.getTargetAppMainWindow()
                        : getTopFocusWindow();
                if (topFocusedWindowState == null) {
                if (topFocusedWindowState == null) {
                    if (DEBUG) {
                    if (DEBUG) {
                        Slog.d(LOG_TAG, "top focused window is null, compute it again later");
                        Slog.d(LOG_TAG, "top focused window is null, compute it again later");
+11 −5
Original line number Original line Diff line number Diff line
@@ -568,8 +568,9 @@ public class RecentsAnimationController implements DeathRecipient {
                            ? mMinimizedHomeBounds
                            ? mMinimizedHomeBounds
                            : null;
                            : null;
            final Rect contentInsets;
            final Rect contentInsets;
            if (mTargetActivityRecord != null && mTargetActivityRecord.findMainWindow() != null) {
            final WindowState targetAppMainWindow = getTargetAppMainWindow();
                contentInsets = mTargetActivityRecord.findMainWindow()
            if (targetAppMainWindow != null) {
                contentInsets = targetAppMainWindow
                        .getInsetsStateWithVisibilityOverride()
                        .getInsetsStateWithVisibilityOverride()
                        .calculateInsets(mTargetActivityRecord.getBounds(), Type.systemBars(),
                        .calculateInsets(mTargetActivityRecord.getBounds(), Type.systemBars(),
                                false /* ignoreVisibility */);
                                false /* ignoreVisibility */);
@@ -1004,9 +1005,7 @@ public class RecentsAnimationController implements DeathRecipient {


    boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle) {
    boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle) {
        // Update the input consumer touchable region to match the target app main window
        // Update the input consumer touchable region to match the target app main window
        final WindowState targetAppMainWindow = mTargetActivityRecord != null
        final WindowState targetAppMainWindow = getTargetAppMainWindow();
                ? mTargetActivityRecord.findMainWindow()
                : null;
        if (targetAppMainWindow != null) {
        if (targetAppMainWindow != null) {
            targetAppMainWindow.getBounds(mTmpRect);
            targetAppMainWindow.getBounds(mTmpRect);
            inputWindowHandle.touchableRegion.set(mTmpRect);
            inputWindowHandle.touchableRegion.set(mTmpRect);
@@ -1026,6 +1025,13 @@ public class RecentsAnimationController implements DeathRecipient {
        return mTargetActivityRecord.windowsCanBeWallpaperTarget();
        return mTargetActivityRecord.windowsCanBeWallpaperTarget();
    }
    }


    WindowState getTargetAppMainWindow() {
        if (mTargetActivityRecord == null) {
            return null;
        }
        return mTargetActivityRecord.findMainWindow();
    }

    boolean isAnimatingTask(Task task) {
    boolean isAnimatingTask(Task task) {
        for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
        for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
            if (task == mPendingAnimations.get(i).mTask) {
            if (task == mPendingAnimations.get(i).mTask) {