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

Skip to content
Snippets Groups Projects
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
Branches
No related tags found
No related merge requests found
...@@ -3271,7 +3271,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo ...@@ -3271,7 +3271,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
} }
private void updateImeParent() { 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) { if (newParent != null) {
mPendingTransaction.reparent(mImeWindowsContainers.mSurfaceControl, newParent); mPendingTransaction.reparent(mImeWindowsContainers.mSurfaceControl, newParent);
scheduleAnimation(); scheduleAnimation();
...@@ -4683,6 +4687,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo ...@@ -4683,6 +4687,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
} else { } else {
mMagnificationSpec = null; mMagnificationSpec = null;
} }
// Re-parent IME's SurfaceControl when MagnificationSpec changed.
updateImeParent();
applyMagnificationSpec(getPendingTransaction(), spec); applyMagnificationSpec(getPendingTransaction(), spec);
getPendingTransaction().apply(); getPendingTransaction().apply();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment