Remove the usage of givenContentInsets for non-IME windows
Currently, no insets is calculated based on contentInsets and other fields set in WindowState when the InsetsFrameProvider is given. It is safe to remove the calculation for windows other than IME. The fields in WindowState, including touchableAreaInsets, visibleInsets, contentInsets is a description of the window itself, instead of the insets it providing to other windows. Such that, we can remove the consideration of those fields for most cases. Bug: 202360061 Test: DisplayPolicyInsetsTests Change-Id: Ie127f4655ed923545dede16ebc615dbf8384d34a
This commit is contained in:
@@ -31,6 +31,10 @@ import java.util.Objects;
|
||||
*
|
||||
* The insets frame will by default as the window frame size. If the providers are set, the
|
||||
* calculation result based on the source size will be used as the insets frame.
|
||||
*
|
||||
* The InsetsFrameProvider should be self-contained. Nothing describing the window itself, such as
|
||||
* contentInsets, visibleInsets, etc. won't affect the insets providing to other windows when this
|
||||
* is set.
|
||||
* @hide
|
||||
*/
|
||||
public class InsetsFrameProvider implements Parcelable {
|
||||
|
||||
@@ -1203,7 +1203,6 @@ public class DisplayPolicy {
|
||||
return null;
|
||||
}
|
||||
return (displayFrames, windowContainer, inOutFrame) -> {
|
||||
inOutFrame.inset(win.mGivenContentInsets);
|
||||
final LayoutParams lp = win.mAttrs.forRotation(displayFrames.mRotation);
|
||||
final InsetsFrameProvider ifp = lp.providedInsets[index];
|
||||
InsetsFrameProvider.calculateInsetsFrame(displayFrames.mUnrestricted,
|
||||
|
||||
Reference in New Issue
Block a user