Merge "Adding myself as an owner of test directories" into ub-launcher3-qt-dev
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/RecentsRootView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/RecentsRootView.java
index 09d323e..1820729 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/RecentsRootView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/RecentsRootView.java
@@ -20,7 +20,6 @@
 import android.graphics.Point;
 import android.graphics.Rect;
 import android.util.AttributeSet;
-import android.view.WindowInsets;
 
 import com.android.launcher3.BaseActivity;
 import com.android.launcher3.R;
@@ -71,7 +70,7 @@
         // Update device profile before notifying the children.
         mActivity.getDeviceProfile().updateInsets(insets);
         setInsets(insets);
-        return true; // I'll take it from here
+        return false; // Let children get the full insets
     }
 
     @Override
@@ -89,10 +88,4 @@
         mActivity.getDeviceProfile().updateInsets(mInsets);
         super.setInsets(mInsets);
     }
-
-    @Override
-    public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) {
-        updateTouchExcludeRegion(insets);
-        return super.dispatchApplyWindowInsets(insets);
-    }
 }
\ No newline at end of file
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java
index 20eec05..49b380b 100644
--- a/src/com/android/launcher3/LauncherRootView.java
+++ b/src/com/android/launcher3/LauncherRootView.java
@@ -14,7 +14,6 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewDebug;
-import android.view.WindowInsets;
 
 import java.util.Collections;
 import java.util.List;
@@ -101,7 +100,7 @@
             mLauncher.getStateManager().reapplyState(true /* cancelCurrentAnimation */);
         }
 
-        return true; // I'll take it from here
+        return false; // Let children get the full insets
     }
 
     @Override
@@ -157,12 +156,6 @@
     }
 
     @Override
-    public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) {
-        mLauncher.getDragLayer().updateTouchExcludeRegion(insets);
-        return super.dispatchApplyWindowInsets(insets);
-    }
-
-    @Override
     protected void onLayout(boolean changed, int l, int t, int r, int b) {
         super.onLayout(changed, l, t, r, b);
         SYSTEM_GESTURE_EXCLUSION_RECT.get(0).set(l, t, r, b);
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index d8094ea..053c570 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -31,6 +31,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.WindowInsets;
 
 import com.android.launcher3.AppInfo;
 import com.android.launcher3.DeviceProfile;
@@ -321,13 +322,22 @@
         }
         setLayoutParams(mlp);
 
-        mNavBarScrimHeight = insets.bottom;
         InsettableFrameLayout.dispatchInsets(this, insets);
         mLauncher.getAllAppsController()
                 .setScrollRangeDelta(mSearchUiManager.getScrollRangeDelta(insets));
     }
 
     @Override
+    public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) {
+        if (Utilities.ATLEAST_Q) {
+            mNavBarScrimHeight = insets.getTappableElementInsets().bottom;
+        } else {
+            mNavBarScrimHeight = insets.getStableInsetBottom();
+        }
+        return super.dispatchApplyWindowInsets(insets);
+    }
+
+    @Override
     protected void dispatchDraw(Canvas canvas) {
         super.dispatchDraw(canvas);
 
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java
index 9d46cf2..d1bd2db 100644
--- a/src/com/android/launcher3/dragndrop/DragView.java
+++ b/src/com/android/launcher3/dragndrop/DragView.java
@@ -44,6 +44,7 @@
 import com.android.launcher3.FastBitmapDrawable;
 import com.android.launcher3.ItemInfo;
 import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherModel;
 import com.android.launcher3.LauncherSettings;
 import com.android.launcher3.LauncherState;
 import com.android.launcher3.LauncherStateManager;
@@ -54,7 +55,6 @@
 import com.android.launcher3.icons.LauncherIcons;
 import com.android.launcher3.util.Themes;
 import com.android.launcher3.util.Thunk;
-import com.android.launcher3.util.UiThreadHelper;
 
 import java.util.Arrays;
 
@@ -210,7 +210,7 @@
             return;
         }
         // Load the adaptive icon on a background thread and add the view in ui thread.
-        new Handler(UiThreadHelper.getBackgroundLooper()).postAtFrontOfQueue(new Runnable() {
+        new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(new Runnable() {
             @Override
             public void run() {
                 Object[] outObj = new Object[1];
diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java
index 001951a..939b0f2 100644
--- a/src/com/android/launcher3/views/BaseDragLayer.java
+++ b/src/com/android/launcher3/views/BaseDragLayer.java
@@ -496,12 +496,14 @@
         }
     }
 
+    @Override
     @TargetApi(Build.VERSION_CODES.Q)
-    public void updateTouchExcludeRegion(WindowInsets insets) {
+    public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) {
         if (Utilities.ATLEAST_Q) {
             Insets gestureInsets = insets.getMandatorySystemGestureInsets();
             mSystemGestureRegion.set(gestureInsets.left, gestureInsets.top,
                     gestureInsets.right, gestureInsets.bottom);
         }
+        return super.dispatchApplyWindowInsets(insets);
     }
 }
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index f63bcdd..f4a3822 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -40,7 +40,6 @@
 import android.os.Build;
 import android.os.CancellationSignal;
 import android.os.Handler;
-import android.os.Looper;
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
@@ -63,7 +62,6 @@
 import com.android.launcher3.icons.LauncherIcons;
 import com.android.launcher3.popup.SystemShortcut;
 import com.android.launcher3.shortcuts.DeepShortcutView;
-import com.android.launcher3.util.UiThreadHelper;
 
 import androidx.annotation.Nullable;
 import androidx.annotation.WorkerThread;
@@ -642,7 +640,7 @@
                 originalView.setVisibility(INVISIBLE);
             };
             CancellationSignal loadIconSignal = view.mLoadIconSignal;
-            new Handler(UiThreadHelper.getBackgroundLooper()).postAtFrontOfQueue(() -> {
+            new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(() -> {
                 view.getIcon(originalView, (ItemInfo) originalView.getTag(), isOpening,
                         onIconLoaded, loadIconSignal);
             });