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

Commit afc54cf3 authored by chaviw's avatar chaviw
Browse files

Notify Accessibilty about rotation in applyRotation

There were multiple places where WM could notify accessibility about
rotation. This was causing issues where some edge cases would prevent WM
from notifying accessibility. Instead, just notify accessibility when
the rotation is getting applied regardless of what animation ran or
didn't. This makes it clear that accessibility will be notified after
any rotation occurs on WM side.

Bug: 152537982
Bug: 152610840
Test: 1. Go to an app and turn on magnification bounds
      2. Rotate the screen to landscape
      3. Lock the screen
      4. Unlock the screen. App should be back in portrait
      5. Press magnify button
Change-Id: If6019b1e9be178774f0c22a30657e6c3bae27d61
parent 0cdc03a7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1620,9 +1620,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            }
        }

        // Announce rotation only if we will not animate as we already have the
        // windows in final state. Otherwise, we make this call at the rotation end.
        if (screenRotationAnimation == null && mWmService.mAccessibilityController != null) {
        if (mWmService.mAccessibilityController != null) {
            mWmService.mAccessibilityController.onRotationChangedLocked(this);
        }
    }
+0 −7
Original line number Diff line number Diff line
@@ -732,13 +732,6 @@ class ScreenRotationAnimation {
                mService.mAnimator.mBulkUpdateParams |= WindowSurfacePlacer.SET_UPDATE_ROTATION;
                kill();
                mService.updateRotation(false, false);
                AccessibilityController accessibilityController = mService.mAccessibilityController;

                if (accessibilityController != null) {
                    // We just finished rotation animation which means we did not
                    // announce the rotation and waited for it to end, announce now.
                    accessibilityController.onRotationChangedLocked(mDisplayContent);
                }
            }
        }