Update the last frames in relayout window
The frames are computed in relayout and the client also uses
it as the last state. It is unnecessary to request redraw by
a false alarm frame changes.
Fix: 144585233
Test: atest DisplaySizeTest
Test: 1. Launch an activity that doesn't handle density change.
2. Change density by shell command "wm density $value".
3. Check there won't be a black screen.
Change-Id: Ia9dbda66506ef11e5cbe811f635031756803742b
This commit is contained in:
@@ -2351,8 +2351,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
win.setLastReportedMergedConfiguration(mergedConfiguration);
|
||||
|
||||
// Update the last inset values here because the values are sent back to the client.
|
||||
// The last inset values represent the last client state.
|
||||
// Update the last frames and inset values here because the values are sent back to the
|
||||
// client. The last values represent the last client state.
|
||||
win.updateLastFrames();
|
||||
win.updateLastInsetValues();
|
||||
|
||||
win.getCompatFrame(outFrame);
|
||||
|
||||
@@ -1308,8 +1308,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
|
||||
// We update mLastFrame always rather than in the conditional with the last inset
|
||||
// variables, because mFrameSizeChanged only tracks the width and height changing.
|
||||
mWindowFrames.mLastFrame.set(mWindowFrames.mFrame);
|
||||
mWindowFrames.mLastRelFrame.set(mWindowFrames.mRelFrame);
|
||||
updateLastFrames();
|
||||
|
||||
if (didFrameInsetsChange
|
||||
|| winAnimator.mSurfaceResized
|
||||
@@ -4817,6 +4816,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
return mEmbeddedDisplayContents.remove(dc);
|
||||
}
|
||||
|
||||
/** Updates the last frames and relative frames to the current ones. */
|
||||
void updateLastFrames() {
|
||||
mWindowFrames.mLastFrame.set(mWindowFrames.mFrame);
|
||||
mWindowFrames.mLastRelFrame.set(mWindowFrames.mRelFrame);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the last inset values to the current ones.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user