Remove nonOverlappingTaskarInsets

- Override our insets in LauncherRootView to explicitly only care about nav bar size, ignoring any insets due to taskbar.
- Previously we used nonOverlappingTaskbarInsets to belatedly subtract from measurements in e.g. DeviceProfile, but now we can revert most of those calculations since we effectively subtract taskbar insets at the root.

Test: visual in different orientations and navigation modes, and testPressHomeOnAllAppsContextMenu to ensure REQUEST_WINDOW_INSETS still works for automated tests
Fixes: 200607741
Change-Id: I8de5a268c686a1354b4beaa30e101bab6bed5af9
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java
index 28afc57..7de2ee4 100644
--- a/src/com/android/launcher3/LauncherRootView.java
+++ b/src/com/android/launcher3/LauncherRootView.java
@@ -47,15 +47,8 @@
     }
 
     private void handleSystemWindowInsets(Rect insets) {
-        DeviceProfile dp = mActivity.getDeviceProfile();
-
-        // Taskbar provides insets, but we don't want that for most Launcher elements so remove it.
-        mTempRect.set(insets);
-        insets = mTempRect;
-        insets.bottom = Math.max(0, insets.bottom - dp.nonOverlappingTaskbarInset);
-
         // Update device profile before notifying the children.
-        dp.updateInsets(insets);
+        mActivity.getDeviceProfile().updateInsets(insets);
         boolean resetState = !insets.equals(mInsets);
         setInsets(insets);
 
@@ -86,10 +79,6 @@
      * get its insets, we calculate them ourselves so they are stable regardless of whether taskbar
      * is currently attached.
      *
-     * TODO(b/198798034): Currently we always calculate nav insets as taskbarSize, but then we
-     * subtract nonOverlappingTaskbarInset in handleSystemWindowInsets(). Instead, we should just
-     * calculate the normal nav bar height here, and remove nonOverlappingTaskbarInset altogether.
-     *
      * @param oldInsets The system-provided insets, which we are modifying.
      * @return The updated insets.
      */
@@ -108,10 +97,8 @@
         Insets oldNavInsets = oldInsets.getInsets(WindowInsets.Type.navigationBars());
         Rect newNavInsets = new Rect(oldNavInsets.left, oldNavInsets.top, oldNavInsets.right,
                 oldNavInsets.bottom);
-        if (dp.isTaskbarPresent) {
-            // TODO (see javadoc): Remove this block and fall into the next one instead.
-            newNavInsets.bottom = dp.taskbarSize;
-        } else if (dp.isLandscape) {
+
+        if (dp.isLandscape) {
             if (dp.isTablet) {
                 newNavInsets.bottom = ResourceUtils.getNavbarSize(
                         "navigation_bar_height_landscape", resources);