Merge changes from topic "presubmit-am-1f589f278e0b4cd4bdc898353c994c9d" into tm-mainline-prod

* changes:
  [automerge] Avoid Rect instantiation in NavigationBarController.Impl 2p: 7bf91fbc25
  Avoid Rect instantiation in NavigationBarController.Impl
This commit is contained in:
TreeHugger Robot
2022-04-07 04:49:38 +00:00
committed by Android (Google) Code Review

View File

@@ -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);