Merge "Fix condition to dispatch config for visible window" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1cd69247c2
@@ -8482,6 +8482,10 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
if (mLocalSyncState != LOCAL_SYNC_NONE) {
|
if (mLocalSyncState != LOCAL_SYNC_NONE) {
|
||||||
writer.println(innerPrefix + "mLocalSyncState=" + mLocalSyncState);
|
writer.println(innerPrefix + "mLocalSyncState=" + mLocalSyncState);
|
||||||
}
|
}
|
||||||
|
writer.println(innerPrefix + "mLastReportedMergedConfiguration="
|
||||||
|
+ mLastReportedMergedConfiguration);
|
||||||
|
writer.println(innerPrefix + "mLastConfigurationFromResources="
|
||||||
|
+ mLastConfigurationFromResources);
|
||||||
writer.println(innerPrefix + "mIsAmbientMode=" + mIsAmbientMode);
|
writer.println(innerPrefix + "mIsAmbientMode=" + mIsAmbientMode);
|
||||||
writer.println(innerPrefix + "mUnbufferedInputSource="
|
writer.println(innerPrefix + "mUnbufferedInputSource="
|
||||||
+ Integer.toHexString(mUnbufferedInputSource));
|
+ Integer.toHexString(mUnbufferedInputSource));
|
||||||
|
|||||||
@@ -3869,7 +3869,7 @@ 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 && (!shouldCheckTokenVisibleRequested()
|
||||||
|| mToken.isVisibleRequested()))) {
|
|| mToken.isVisibleRequested()))) {
|
||||||
final Configuration globalConfig = getProcessGlobalConfiguration();
|
final Configuration globalConfig = getProcessGlobalConfiguration();
|
||||||
final Configuration overrideConfig = getMergedOverrideConfiguration();
|
final Configuration overrideConfig = getMergedOverrideConfiguration();
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import static com.android.server.wm.LetterboxConfiguration.LETTERBOX_BACKGROUND_
|
|||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
@@ -195,14 +196,25 @@ public class WindowManagerServiceTests extends WindowTestsBase {
|
|||||||
mWm.mWindowMap.put(win.mClient.asBinder(), win);
|
mWm.mWindowMap.put(win.mClient.asBinder(), win);
|
||||||
final int w = 100;
|
final int w = 100;
|
||||||
final int h = 200;
|
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,
|
mWm.relayoutWindow(win.mSession, win.mClient, win.mAttrs, w, h, View.GONE, 0, 0, 0,
|
||||||
new ClientWindowFrames(), new MergedConfiguration(), new SurfaceControl(),
|
outFrames, outConfig, outSurfaceControl, outInsetsState, outControls, outBundle);
|
||||||
new InsetsState(), new InsetsSourceControl[0], new Bundle());
|
|
||||||
// Because the window is already invisible, it doesn't need to apply exiting animation
|
// Because the window is already invisible, it doesn't need to apply exiting animation
|
||||||
// and WMS#tryStartExitingAnimation() will destroy the surface directly.
|
// and WMS#tryStartExitingAnimation() will destroy the surface directly.
|
||||||
assertFalse(win.mAnimatingExit);
|
assertFalse(win.mAnimatingExit);
|
||||||
assertFalse(win.mHasSurface);
|
assertFalse(win.mHasSurface);
|
||||||
assertNull(win.mWinAnimator.mSurfaceController);
|
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
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user