Fix preview image overlaps a call button during video call
If a device supports hiding the navigation bar and it is enabled,
preview image overlaps a call button during video call. Because the
preview layout doesn't care about the visibility of the navigation bar.
To fix the problem, use APIs of WindowInsets that care about the
visibility of the navigation bar.
Bug: 80376182
Test: manual - Checked the preview image doesn't overlap a call button
when the navigation bar is not visible.
Change-Id: I72c9d504f0485c24a6be09a50869a8248745623f
diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java
index 634af2b..8203c6a 100644
--- a/java/com/android/incallui/video/impl/VideoCallFragment.java
+++ b/java/com/android/incallui/video/impl/VideoCallFragment.java
@@ -541,13 +541,13 @@
return new Point();
}
if (isLandscape()) {
- int stableInsetEnd =
+ int systemWindowInsetEnd =
getView().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL
- ? getView().getRootWindowInsets().getStableInsetLeft()
- : -getView().getRootWindowInsets().getStableInsetRight();
- return new Point(stableInsetEnd, 0);
+ ? getView().getRootWindowInsets().getSystemWindowInsetLeft()
+ : -getView().getRootWindowInsets().getSystemWindowInsetRight();
+ return new Point(systemWindowInsetEnd, 0);
} else {
- return new Point(0, -getView().getRootWindowInsets().getStableInsetBottom());
+ return new Point(0, -getView().getRootWindowInsets().getSystemWindowInsetBottom());
}
}