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

Commit 818c3f1e authored by Jackal Guo's avatar Jackal Guo
Browse files

Re-parent IME back to display when magnifying

IME is now re-parent its SurfaceControl onto the app when app is
fullscreen. WindowManager would magnfiy the screen via surface so
the IME and app are both magnified. Re-parent IME back to display
when WindowManager tries to applyMagnificationSpec.

Bug: 127827134
Test: A11y CTS & unit tests
Test: atest WmTests
Test: manual
      1. Settings > Accessibility > Magnification > Magnify with Button > On
      2. Open any app with an EditText, tap it to bring up the IME
      3. Tap the accessibility button, then the magnification region
      4. The app with an EditText should be magnified, but not IME
      and
      1. Settings > Accessibility > Magnification > Magnify with Button > On
      2. Open any app with an EditText
      3. Tap the accessibility button, then the magnification region
      4. Tap the EditText to bring up the IME when magnifying
      5. The app with an EditText should be magnified, but not IME
Change-Id: I06330362de026aa8f0f92d4004e22958900a36cc
parent fd1672a5
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3271,7 +3271,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    }

    private void updateImeParent() {
        final SurfaceControl newParent = computeImeParent();
        // Force attaching IME to the display when magnifying, or it would be magnified with
        // target app together.
        final boolean shouldAttachToDisplay = (mMagnificationSpec != null);
        final SurfaceControl newParent =
                shouldAttachToDisplay ? mWindowingLayer : computeImeParent();
        if (newParent != null) {
            mPendingTransaction.reparent(mImeWindowsContainers.mSurfaceControl, newParent);
            scheduleAnimation();
@@ -4683,6 +4687,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        } else {
            mMagnificationSpec = null;
        }
        // Re-parent IME's SurfaceControl when MagnificationSpec changed.
        updateImeParent();

        applyMagnificationSpec(getPendingTransaction(), spec);
        getPendingTransaction().apply();