From 6526f6db14d20aa8f95f8761a15a885061c76873 Mon Sep 17 00:00:00 2001 From: chaviw Date: Tue, 26 Apr 2022 18:00:22 -0500 Subject: [PATCH] Set the magnification when setting SC initial properties When a WC stops being organized the SC is replaced to ensure the previous organizer no longer has control over the states. When this happens we need to set initial properties on the new SC. Currently any magnification set on the previous SC is lost. This change applies the magnification to the new SC This fixes the issue when one handed mode is toggled. Since the toggling cause the WC to stop being organized, we lose the magnification set on it since we recreate the SC Test: Toggle OHM from QS while magnified Fixes: 208334240 Change-Id: I7e432bc5a072c137653dbefe3bc71636c8e454be --- services/core/java/com/android/server/wm/WindowContainer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index 20183c586a620..00e534206c7e8 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -620,6 +620,9 @@ class WindowContainer extends ConfigurationContainer< } onSurfaceShown(getSyncTransaction()); updateSurfacePositionNonOrganized(); + if (mLastMagnificationSpec != null) { + applyMagnificationSpec(getSyncTransaction(), mLastMagnificationSpec); + } } /**