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

Commit 76be3d05 authored by Tommy Nordgren's avatar Tommy Nordgren Committed by Mattias Nilsson
Browse files

Global scale must always be updated when size compat scale is changed

When an orientation change request that comes from the app differs
from the orientation for the current activity the UI layout is not
updated. This may lead to an un-intended layout size.

Solve this by updating Global scale when size compat scale is changed.

Test: run test apk
Bug: 286384732
Change-Id: I1b3d93337c7700d58be94f5731abff932ea1895b
parent 031de969
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -8225,7 +8225,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    private void clearSizeCompatModeAttributes() {
        mInSizeCompatModeForBounds = false;
        final float lastSizeCompatScale = mSizeCompatScale;
        mSizeCompatScale = 1f;
        if (mSizeCompatScale != lastSizeCompatScale) {
            forAllWindows(WindowState::updateGlobalScale, false /* traverseTopToBottom */);
        }
        mSizeCompatBounds = null;
        mCompatDisplayInsets = null;
        mLetterboxUiController.clearInheritedCompatDisplayInsets();
@@ -8233,11 +8237,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    @VisibleForTesting
    void clearSizeCompatMode() {
        final float lastSizeCompatScale = mSizeCompatScale;
        clearSizeCompatModeAttributes();
        if (mSizeCompatScale != lastSizeCompatScale) {
            forAllWindows(WindowState::updateGlobalScale, false /* traverseTopToBottom */);
        }
        // Clear config override in #updateCompatDisplayInsets().
        final int activityType = getActivityType();
        final Configuration overrideConfig = getRequestedOverrideConfiguration();