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

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

Change-Id: I3c06f364df683b70cdff8b744d6b1fd1cd3eab08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-10-12 14:06:28 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 2 deletions

View File

@@ -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);

View File

@@ -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