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

Commit 78bc76ce authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Override on WindowToken if necessary

Override the screen size in Configuration on WindowToken level instead
of WindowState. This will make sure the override is applied when there
are registered change listeners attached to the WindowToken. The
WindowState override is no longer needed as the parent resolved
configuration will be used instead.

Test: Install legacy IME apps, check the Configuration size
Bug: 372592558
Flag: EXEMPT bugfix
Change-Id: I0e1161f2bd376aa73bc4d51373e65e7702c11bb4
parent c79e8f97
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -2989,15 +2989,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        return (mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0;
    }

    @Override
    void resolveOverrideConfiguration(Configuration newParentConfig) {
        super.resolveOverrideConfiguration(newParentConfig);
        if (mActivityRecord != null) {
            // Let the activity decide whether to apply the size override.
            return;
        }
        final Configuration resolvedConfig = getResolvedOverrideConfiguration();
        resolvedConfig.seq = newParentConfig.seq;
    void applySizeOverride(Configuration newParentConfig, Configuration resolvedConfig) {
        applySizeOverrideIfNeeded(
                getDisplayContent(),
                mSession.mProcess.mInfo,
+9 −0
Original line number Diff line number Diff line
@@ -672,6 +672,15 @@ class WindowToken extends WindowContainer<WindowState> {
            getResolvedOverrideConfiguration().updateFrom(
                    mFixedRotationTransformState.mRotatedOverrideConfiguration);
        }
        if (asActivityRecord() == null) {
            // Let ActivityRecord override the config if there is one. Otherwise, override here.
            // Resolve WindowToken's configuration by the latest window.
            final WindowState win = getTopChild();
            if (win != null) {
                final Configuration resolvedConfig = getResolvedOverrideConfiguration();
                win.applySizeOverride(newParentConfig, resolvedConfig);
            }
        }
    }

    @Override