Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a374ad6a authored by Tiger's avatar Tiger
Browse files

Prevent creating the redundant WindowInsets object

This CL only calls WindowInsets#inset while any of the arguments is
greater than zero.

Bug: 346772491
Flag: NA
Test: run WindowPolicyTests#testWindowInsets during fixed-rotation
Change-Id: I6bcd97d02b7740eec91ffa5eabc8bb7bfbfae669
parent 7c02512c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,10 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
                    requestApplyInsets();
                }
            }
            if (insets != null) {
            if (insets != null && (consumedLeft > 0
                    || consumedTop > 0
                    || consumedRight > 0
                    || consumedBottom > 0)) {
                insets = insets.inset(consumedLeft, consumedTop, consumedRight, consumedBottom);
            }
        }