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

Commit 1df82b36 authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Need config resolution before getting dispAreaInfo

DisplayAreaInfo calculation relies on DisplayContent's
full configuration being in its latest state; i.e. config
resolution should have taken place by that time.
Generally, this is carried out by sendNewConfiguration()
triggered up DeferredDisplayUpdater's display info updates.

However in some cases (e.g. when a remote rotation happens
right before physical display size change remote display change
is sent to Shell), sendNewConfiguration can be short-circuited
meaning no configuration resolution would have taken place after
the recent mInitialDisplayWidth/Height updates.

One Solution to this:
Enforce config resolution to be done by
DC#updateDisplayOverrideConfigurationLocked()
if reconfigureDisplayLocked -> sendNewConfiguration() doesn't
actually resolve new config and send it.

Bug: 432725672
Flag: EXEMPT bugfix
Test: manually repro the steps in the bug
Change-Id: Ie3ae5488d1e928702d6914f72548ed7562626897
parent 758f4dc9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1647,7 +1647,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                // Update new size for the rotated activities, if any.
                applyFixedRotationForNonTopVisibleActivityIfNeeded();
            }
            sendNewConfiguration();
            if (!sendNewConfiguration()) {
                // If config resolution didn't take place and the new config wasn't sent, at least,
                // make sure that full config is resolved; this is important cause display change
                // signals sent to Shell could rely on the new config for the latest updates.
                updateDisplayOverrideConfigurationLocked(mTmpConfiguration,
                        null /* starting */, true /* deferResume */);
            }
        }

        mWmService.mWindowPlacerLocked.performSurfacePlacement();