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

Commit f64e1343 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Update the last frame in the first layout

The original purpose of commit 2652da82 is to avoid an
unnecessary resize after activity relaunched. So it
would be more accurate to only update the last frames
when the window is performing the first layout instead
of every relayout. And in this case the position for
the windows in an embedded display should also be updated
as the initialization.

Bug: 144585233
Fix: 145715291
Test: atest DisplaySizeTest
            AccessibilityEmbeddedDisplayTest

Change-Id: Ibf38933099cc73f6f6d3ea8c2afb7070a86a6edc
parent 35fc4484
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -669,10 +669,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            getDisplayPolicy().layoutWindowLw(w, null, mDisplayFrames);
            w.mLayoutSeq = mLayoutSeq;

            // If this is the first layout, we need to initialize the last inset values as
            // otherwise we'd immediately cause an unnecessary resize.
            // If this is the first layout, we need to initialize the last frames and inset values,
            // as otherwise we'd immediately cause an unnecessary resize.
            if (firstLayout) {
                w.updateLastFrames();
                w.updateLastInsetValues();
                w.updateLocationInParentDisplayIfNeeded();
            }

            if (w.mActivityRecord != null) {
+2 −3
Original line number Diff line number Diff line
@@ -2337,9 +2337,8 @@ public class WindowManagerService extends IWindowManager.Stub

            win.setLastReportedMergedConfiguration(mergedConfiguration);

            // Update the last frames and inset values here because the values are sent back to the
            // client. The last values represent the last client state.
            win.updateLastFrames();
            // Update the last inset values here because the values are sent back to the client.
            // The last inset values represent the last client state
            win.updateLastInsetValues();

            win.getCompatFrame(outFrame);