Merge "Only consider to keep activity config if invisible requested" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3865708949
@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user