Merge "Override statusBar top inset in Launcher" into tm-dev am: f9aa367324

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17570025

Change-Id: I511079bf3e9d9c3cac1ab605719151e910ce3941
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/launcher3/util/window/WindowManagerProxy.java b/src/com/android/launcher3/util/window/WindowManagerProxy.java
index 2fd0a7e..5aaa275 100644
--- a/src/com/android/launcher3/util/window/WindowManagerProxy.java
+++ b/src/com/android/launcher3/util/window/WindowManagerProxy.java
@@ -165,6 +165,17 @@
         insetsBuilder.setInsets(WindowInsets.Type.navigationBars(), newNavInsets);
         insetsBuilder.setInsetsIgnoringVisibility(WindowInsets.Type.navigationBars(), newNavInsets);
 
+        Insets statusBarInsets = oldInsets.getInsets(WindowInsets.Type.statusBars());
+        int statusBarHeight = getDimenByName("status_bar_height", systemRes, 0);
+        Insets newStatusBarInsets = Insets.of(
+                statusBarInsets.left,
+                Math.max(statusBarInsets.top, statusBarHeight),
+                statusBarInsets.right,
+                statusBarInsets.bottom);
+        insetsBuilder.setInsets(WindowInsets.Type.statusBars(), newStatusBarInsets);
+        insetsBuilder.setInsetsIgnoringVisibility(
+                WindowInsets.Type.statusBars(), newStatusBarInsets);
+
         // Override the tappable insets to be 0 on the bottom for gesture nav (otherwise taskbar
         // would count towards it). This is used for the bottom protection in All Apps for example.
         if (isGesture) {