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

Commit bfc5bb40 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Only consider to keep activity config if invisible requested" into tm-qpr-dev am: 38657089

parents 38e61c9f 38657089
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3869,8 +3869,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // configuration update when the window has requested to be hidden. Doing so can lead to
        // configuration update when the window has requested to be hidden. Doing so can lead to
        // the client erroneously accepting a configuration that would have otherwise caused an
        // the client erroneously accepting a configuration that would have otherwise caused an
        // activity restart. We instead hand back the last reported {@link MergedConfiguration}.
        // activity restart. We instead hand back the last reported {@link MergedConfiguration}.
        if (useLatestConfig || (relayoutVisible && (!shouldCheckTokenVisibleRequested()
        if (useLatestConfig || (relayoutVisible && (mActivityRecord == null
                || mToken.isVisibleRequested()))) {
                || mActivityRecord.mVisibleRequested))) {
            final Configuration globalConfig = getProcessGlobalConfiguration();
            final Configuration globalConfig = getProcessGlobalConfiguration();
            final Configuration overrideConfig = getMergedOverrideConfiguration();
            final Configuration overrideConfig = getMergedOverrideConfiguration();
            outMergedConfiguration.setConfiguration(globalConfig, overrideConfig);
            outMergedConfiguration.setConfiguration(globalConfig, overrideConfig);
+6 −0
Original line number Original line Diff line number Diff line
@@ -215,6 +215,12 @@ public class WindowManagerServiceTests extends WindowTestsBase {
        mWm.relayoutWindow(win.mSession, win.mClient, win.mAttrs, w, h, View.VISIBLE, 0, 0, 0,
        mWm.relayoutWindow(win.mSession, win.mClient, win.mAttrs, w, h, View.VISIBLE, 0, 0, 0,
                outFrames, outConfig, outSurfaceControl, outInsetsState, outControls, outBundle);
                outFrames, outConfig, outSurfaceControl, outInsetsState, outControls, outBundle);
        assertEquals(0, outConfig.getMergedConfiguration().densityDpi);
        assertEquals(0, outConfig.getMergedConfiguration().densityDpi);
        // Non activity window can still get the last config.
        win.mActivityRecord = null;
        win.fillClientWindowFramesAndConfiguration(outFrames, outConfig,
                false /* useLatestConfig */, true /* relayoutVisible */);
        assertEquals(win.getConfiguration().densityDpi,
                outConfig.getMergedConfiguration().densityDpi);
    }
    }


    @Test
    @Test