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

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

Avoid applying window config from updating persistent config

The changed global configuration will also apply to default
display. When the display is rotating, the transition will be
disturbed if the given configuration contains stale window
configuration (e.g. bounds and rotation).

Because persistent configuration only includes locale and font
scale, clear the window configuration to avoid the noise.

Bug: 196313047
Test: Back from a landscape activity to a portrait activity.
      The portrait app activity calls LocalePicker#updateLocale
      in onResume. The transition should not be flickering.
Change-Id: Ib1bea1b752eb695e26b8b0622bcf06ec01cce3e6
parent 08774f2f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4066,6 +4066,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        final long origId = Binder.clearCallingIdentity();
        try {
            synchronized (mGlobalLock) {
                // Window configuration is unrelated to persistent configuration (e.g. font scale,
                // locale). Unset it to avoid affecting the current display configuration.
                values.windowConfiguration.setToDefaults();
                updateConfigurationLocked(values, null, false, true, userId,
                        false /* deferResume */);
            }
+2 −1
Original line number Diff line number Diff line
@@ -5693,7 +5693,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        final Configuration currOverrideConfig = getRequestedOverrideConfiguration();
        final int currRotation = currOverrideConfig.windowConfiguration.getRotation();
        final int overrideRotation = overrideConfiguration.windowConfiguration.getRotation();
        if (currRotation != ROTATION_UNDEFINED && currRotation != overrideRotation) {
        if (currRotation != ROTATION_UNDEFINED && overrideRotation != ROTATION_UNDEFINED
                && currRotation != overrideRotation) {
            applyRotationAndFinishFixedRotation(currRotation, overrideRotation);
        }
        mCurrentOverrideConfigurationChanges = currOverrideConfig.diff(overrideConfiguration);