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

Commit 7bf91fbc authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Avoid Rect instantiation in NavigationBarController.Impl

This is a preparation to fix Bug 226566506.

There should be no behavior change in this CL.

Bug: 226566506
Test: presubmit
Change-Id: Ib4b8b1ce66bb64c0a710750af4ca95b5b2c9e9e8
parent f86c86cd
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@ final class NavigationBarController {

        private boolean mDrawLegacyNavigationBarBackground;

        private final Rect mTempRect = new Rect();

        Impl(@NonNull InputMethodService inputMethodService) {
            mService = inputMethodService;
        }
@@ -281,13 +283,12 @@ final class NavigationBarController {
                        touchableRegion.set(originalInsets.touchableRegion);
                        break;
                }
                final Rect navBarRect = new Rect(decor.getLeft(),
                        decor.getBottom() - systemInsets.bottom,
                mTempRect.set(decor.getLeft(), decor.getBottom() - systemInsets.bottom,
                        decor.getRight(), decor.getBottom());
                if (touchableRegion == null) {
                    touchableRegion = new Region(navBarRect);
                    touchableRegion = new Region(mTempRect);
                } else {
                    touchableRegion.union(navBarRect);
                    touchableRegion.union(mTempRect);
                }

                dest.touchableRegion.set(touchableRegion);