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

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

Merge "Fix condition to dispatch config for visible window" into tm-qpr-dev...

Merge "Fix condition to dispatch config for visible window" into tm-qpr-dev am: 1cd69247 am: 7aed9ed9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20108254



Change-Id: I29d1080dc710c52514e188598b1070d64bda75a8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0ef28c78 7aed9ed9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -8540,6 +8540,10 @@ public final class ViewRootImpl implements ViewParent,
        if (mLocalSyncState != LOCAL_SYNC_NONE) {
            writer.println(innerPrefix + "mLocalSyncState=" + mLocalSyncState);
        }
        writer.println(innerPrefix + "mLastReportedMergedConfiguration="
                + mLastReportedMergedConfiguration);
        writer.println(innerPrefix + "mLastConfigurationFromResources="
                + mLastConfigurationFromResources);
        writer.println(innerPrefix + "mIsAmbientMode="  + mIsAmbientMode);
        writer.println(innerPrefix + "mUnbufferedInputSource="
                + Integer.toHexString(mUnbufferedInputSource));
+1 −1
Original line number Diff line number Diff line
@@ -3868,7 +3868,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        // 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
        // activity restart. We instead hand back the last reported {@link MergedConfiguration}.
        if (useLatestConfig || (relayoutVisible && (shouldCheckTokenVisibleRequested()
        if (useLatestConfig || (relayoutVisible && (!shouldCheckTokenVisibleRequested()
                || mToken.isVisibleRequested()))) {
            final Configuration globalConfig = getProcessGlobalConfiguration();
            final Configuration overrideConfig = getMergedOverrideConfiguration();
+13 −2
Original line number Diff line number Diff line
@@ -198,14 +198,25 @@ public class WindowManagerServiceTests extends WindowTestsBase {
        mWm.mWindowMap.put(win.mClient.asBinder(), win);
        final int w = 100;
        final int h = 200;
        final ClientWindowFrames outFrames = new ClientWindowFrames();
        final MergedConfiguration outConfig = new MergedConfiguration();
        final SurfaceControl outSurfaceControl = new SurfaceControl();
        final InsetsState outInsetsState = new InsetsState();
        final InsetsSourceControl[] outControls = new InsetsSourceControl[0];
        final Bundle outBundle = new Bundle();
        mWm.relayoutWindow(win.mSession, win.mClient, win.mAttrs, w, h, View.GONE, 0, 0, 0,
                new ClientWindowFrames(), new MergedConfiguration(), new SurfaceControl(),
                new InsetsState(), new InsetsSourceControl[0], new Bundle());
                outFrames, outConfig, outSurfaceControl, outInsetsState, outControls, outBundle);
        // Because the window is already invisible, it doesn't need to apply exiting animation
        // and WMS#tryStartExitingAnimation() will destroy the surface directly.
        assertFalse(win.mAnimatingExit);
        assertFalse(win.mHasSurface);
        assertNull(win.mWinAnimator.mSurfaceController);

        doReturn(mSystemServicesTestRule.mTransaction).when(SurfaceControl::getGlobalTransaction);
        // Invisible requested activity should not get the last config even if its view is visible.
        mWm.relayoutWindow(win.mSession, win.mClient, win.mAttrs, w, h, View.VISIBLE, 0, 0, 0,
                outFrames, outConfig, outSurfaceControl, outInsetsState, outControls, outBundle);
        assertEquals(0, outConfig.getMergedConfiguration().densityDpi);
    }

    @Test