Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-dev
diff --git a/quickstep/res/layout/predicted_hotseat_edu.xml b/quickstep/res/layout/predicted_hotseat_edu.xml
index e4e3956..f0c12f1 100644
--- a/quickstep/res/layout/predicted_hotseat_edu.xml
+++ b/quickstep/res/layout/predicted_hotseat_edu.xml
@@ -42,6 +42,7 @@
             android:paddingLeft="@dimen/bottom_sheet_edu_padding"
             android:paddingRight="@dimen/bottom_sheet_edu_padding"
             android:text="@string/hotseat_edu_title_migrate"
+            android:fontFamily="google-sans"
             android:textAlignment="center"
             android:textColor="@android:color/white"
             android:textSize="20sp" />
diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml
index 8deb58e..6b36b5a 100644
--- a/quickstep/res/values-ru/strings.xml
+++ b/quickstep/res/values-ru/strings.xml
@@ -76,8 +76,7 @@
     <string name="allset_title" msgid="5021126669778966707">"Готово!"</string>
     <string name="allset_hint" msgid="2384632994739392447">"Чтобы перейти на главный экран, проведите вверх."</string>
     <string name="allset_description" msgid="6350320429953234580">"Теперь вы можете использовать телефон."</string>
-    <!-- no translation found for allset_description_tablet (7332070270570039247) -->
-    <skip />
+    <string name="allset_description_tablet" msgid="7332070270570039247">"Теперь вы можете использовать планшет."</string>
     <string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Системные настройки навигации"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"Поделиться"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"Скриншот"</string>
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index 6f0f993..fe24c4b 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -33,6 +33,7 @@
 
 import android.animation.AnimatorSet;
 import android.animation.ValueAnimator;
+import android.app.ActivityManager;
 import android.app.ActivityOptions;
 import android.content.Context;
 import android.content.Intent;
@@ -325,6 +326,7 @@
                             config,
                             ProxyScreenStatusProvider.INSTANCE,
                             getSystemService(DeviceStateManager.class),
+                            getSystemService(ActivityManager.class),
                             getSystemService(SensorManager.class),
                             getMainThreadHandler(),
                             getMainExecutor(),
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index 7ab59b8..ca0767b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -194,8 +194,7 @@
                         && (flags & FLAG_SCREEN_PINNING_ACTIVE) == 0));
 
         mPropertyHolders.add(new StatePropertyHolder(mControllers.taskbarDragLayerController
-                .getKeyguardBgTaskbar(),
-                flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0));
+                .getKeyguardBgTaskbar(), flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0));
 
         // Force nav buttons (specifically back button) to be visible during setup wizard.
         boolean isInSetup = !mContext.isUserSetupComplete();
@@ -297,12 +296,14 @@
                 mNavButtonContainer.requestLayout();
             }
 
-            // Animate taskbar background when any of these flags are enabled
-            int flagsToShowBg = FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE
-                    | FLAG_NOTIFICATION_SHADE_EXPANDED;
+            // Animate taskbar background when either..
+            // notification shade expanded AND not on keyguard
+            // back is visible for bouncer
             mPropertyHolders.add(new StatePropertyHolder(
                     mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(),
-                    flags -> (flags & flagsToShowBg) != 0, AnimatedFloat.VALUE, 1, 0));
+                    flags -> ((flags & FLAG_NOTIFICATION_SHADE_EXPANDED) != 0
+                                && (flags & FLAG_KEYGUARD_VISIBLE) == 0)
+                            || (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
 
             // Rotation button
             RotationButton rotationButton = new RotationButtonImpl(
@@ -816,6 +817,10 @@
             this(alphaProperty, enableCondition, MultiValueAlpha.VALUE, 1, 0);
         }
 
+        StatePropertyHolder(AnimatedFloat animatedFloat, IntPredicate enableCondition) {
+            this(animatedFloat, enableCondition, AnimatedFloat.VALUE, 1, 0);
+        }
+
         <T> StatePropertyHolder(T target, IntPredicate enabledCondition,
                 Property<T, Float> property, float enabledValue, float disabledValue) {
             mEnableCondition = enabledCondition;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
index e2ab443..9ba4a65 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
@@ -36,6 +36,7 @@
 import android.view.SurfaceControl;
 import android.view.View;
 import android.view.ViewRootImpl;
+import android.window.SurfaceSyncer;
 
 import androidx.annotation.Nullable;
 
@@ -476,6 +477,7 @@
                 tx.setScale(dragSurface, scale, scale);
                 tx.setAlpha(dragSurface, alpha);
                 tx.apply();
+                tx.close();
             }
         });
         mReturnAnimator.addListener(new AnimatorListenerAdapter() {
@@ -499,12 +501,14 @@
                 maybeOnDragEnd();
                 // Synchronize removing the drag surface with the next draw after calling
                 // maybeOnDragEnd()
-                viewRoot.consumeNextDraw((transaction) -> {
-                    transaction.remove(dragSurface);
-                    transaction.apply();
-                    tx.close();
-                });
-                viewRoot.getView().invalidate();
+                SurfaceControl.Transaction transaction = new SurfaceControl.Transaction();
+                transaction.remove(dragSurface);
+                SurfaceSyncer syncer = new SurfaceSyncer();
+                int syncId = syncer.setupSync(transaction::close);
+                syncer.addToSync(syncId, viewRoot.getView());
+                syncer.addTransactionToSync(syncId, transaction);
+                syncer.markSyncReady(syncId);
+
                 mReturnAnimator = null;
             }
         });
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index 494d21e..8e31a74 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -19,10 +19,7 @@
 import static android.view.Display.DEFAULT_DISPLAY;
 import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
 
-import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
-import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
 import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
-import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS;
 
 import android.content.ComponentCallbacks;
 import android.content.Context;
@@ -120,19 +117,24 @@
                 int configsRequiringRecreate = ActivityInfo.CONFIG_ASSETS_PATHS
                         | ActivityInfo.CONFIG_LAYOUT_DIRECTION | ActivityInfo.CONFIG_UI_MODE
                         | ActivityInfo.CONFIG_DENSITY | ActivityInfo.CONFIG_SCREEN_SIZE;
-                if ((configDiff & configsRequiringRecreate) != 0) {
-                    if ((configDiff & ActivityInfo.CONFIG_SCREEN_SIZE) != 0 &&
-                            mTaskbarActivityContext != null && dp != null) {
-                        DeviceProfile oldDp = mTaskbarActivityContext.getDeviceProfile();
-                        // Additional check since this callback gets fired multiple times w/o
-                        // screen size changing
-                        if (dp.widthPx != oldDp.widthPx || dp.heightPx != oldDp.heightPx) {
-                            recreateTaskbar();
-                        }
-                    } else {
-                        // Color has changed, recreate taskbar to reload background color & icons.
-                        recreateTaskbar();
+                boolean requiresRecreate = (configDiff & configsRequiringRecreate) != 0;
+                if ((configDiff & ActivityInfo.CONFIG_SCREEN_SIZE) != 0
+                        && mTaskbarActivityContext != null && dp != null) {
+                    // Additional check since this callback gets fired multiple times w/o
+                    // screen size changing, or when simply rotating the device.
+                    DeviceProfile oldDp = mTaskbarActivityContext.getDeviceProfile();
+                    boolean isOrientationChange =
+                            (configDiff & ActivityInfo.CONFIG_ORIENTATION) != 0;
+                    int oldWidth = isOrientationChange ? oldDp.heightPx : oldDp.widthPx;
+                    int oldHeight = isOrientationChange ? oldDp.widthPx : oldDp.heightPx;
+                    if (dp.widthPx == oldWidth && dp.heightPx == oldHeight) {
+                        configDiff &= ~ActivityInfo.CONFIG_SCREEN_SIZE;
+                        requiresRecreate = (configDiff & configsRequiringRecreate) != 0;
                     }
+                }
+
+                if (requiresRecreate) {
+                    recreateTaskbar();
                 } else {
                     // Config change might be handled without re-creating the taskbar
                     if (mTaskbarActivityContext != null) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index 0b537e2..8291475 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -28,6 +28,7 @@
 import androidx.annotation.LayoutRes;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.core.graphics.ColorUtils;
 
 import com.android.launcher3.BubbleTextView;
 import com.android.launcher3.Insettable;
@@ -35,6 +36,7 @@
 import com.android.launcher3.Utilities;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.icons.ThemedIconDrawable;
 import com.android.launcher3.model.data.FolderInfo;
 import com.android.launcher3.model.data.ItemInfo;
 import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -43,14 +45,17 @@
 import com.android.launcher3.util.LauncherBindableItemsContainer;
 import com.android.launcher3.views.ActivityContext;
 import com.android.launcher3.views.AllAppsButton;
+import com.android.launcher3.views.DoubleShadowBubbleTextView;
 
 /**
  * Hosts the Taskbar content such as Hotseat and Recent Apps. Drawn on top of other apps.
  */
 public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconParent, Insettable {
 
-    private final int[] mTempOutLocation = new int[2];
+    private static final float TASKBAR_BACKGROUND_LUMINANCE = 0.30f;
+    public int mThemeIconsBackground;
 
+    private final int[] mTempOutLocation = new int[2];
     private final Rect mIconLayoutBounds = new Rect();
     private final int mIconTouchSize;
     private final int mItemMarginLeftRight;
@@ -103,6 +108,8 @@
         // Needed to draw folder leave-behind when opening one.
         setWillNotDraw(false);
 
+        mThemeIconsBackground = calculateThemeIconsBackground();
+
         if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) {
             mAllAppsButton = new AllAppsButton(context);
             mAllAppsButton.setLayoutParams(
@@ -111,6 +118,21 @@
         }
     }
 
+    private int getColorWithGivenLuminance(int color, float luminance) {
+        float[] colorHSL = new float[3];
+        ColorUtils.colorToHSL(color, colorHSL);
+        colorHSL[2] = luminance;
+        return ColorUtils.HSLToColor(colorHSL);
+    }
+
+    private int calculateThemeIconsBackground() {
+        int color = ThemedIconDrawable.getColors(mContext)[0];
+        if (Utilities.isDarkTheme(mContext)) {
+            return getColorWithGivenLuminance(color, TASKBAR_BACKGROUND_LUMINANCE);
+        }
+        return color;
+    }
+
     protected void init(TaskbarViewController.TaskbarViewCallbacks callbacks) {
         mControllerCallbacks = callbacks;
         mIconClickListener = mControllerCallbacks.getIconOnClickListener();
@@ -219,6 +241,24 @@
             int index = Utilities.isRtl(getResources()) ? 0 : getChildCount();
             addView(mAllAppsButton, index);
         }
+
+        mThemeIconsBackground = calculateThemeIconsBackground();
+        setThemedIconsBackgroundColor(mThemeIconsBackground);
+    }
+
+    /**
+     * Traverse all the child views and change the background of themeIcons
+     **/
+    public void setThemedIconsBackgroundColor(int color) {
+        for (View icon : getIconViews()) {
+            if (icon instanceof DoubleShadowBubbleTextView) {
+                DoubleShadowBubbleTextView textView = ((DoubleShadowBubbleTextView) icon);
+                if (textView.getIcon() != null
+                        && textView.getIcon() instanceof ThemedIconDrawable) {
+                    ((ThemedIconDrawable) textView.getIcon()).changeBackgroundColor(color);
+                }
+            }
+        }
     }
 
     /**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index a89061b..f5c382d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -27,6 +27,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 
+import androidx.core.graphics.ColorUtils;
 import androidx.core.view.OneShotPreDrawListener;
 
 import com.android.launcher3.BubbleTextView;
@@ -37,6 +38,7 @@
 import com.android.launcher3.anim.PendingAnimation;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.icons.ThemedIconDrawable;
 import com.android.launcher3.model.data.ItemInfo;
 import com.android.launcher3.util.ItemInfoMatcher;
 import com.android.launcher3.util.LauncherBindableItemsContainer;
@@ -71,6 +73,9 @@
             this::updateTranslationY);
     private AnimatedFloat mTaskbarNavButtonTranslationY;
 
+    private final AnimatedFloat mThemeIconsBackground = new AnimatedFloat(
+            this::updateIconsBackground);
+
     private final TaskbarModelCallbacks mModelCallbacks;
 
     // Initialized in init.
@@ -81,6 +86,8 @@
     private AnimatorPlaybackController mIconAlignControllerLazy = null;
     private Runnable mOnControllerPreCreateCallback = NO_OP;
 
+    private int mThemeIconsColor;
+
     public TaskbarViewController(TaskbarActivityContext activity, TaskbarView taskbarView) {
         mActivity = activity;
         mTaskbarView = taskbarView;
@@ -93,6 +100,7 @@
         mControllers = controllers;
         mTaskbarView.init(new TaskbarViewCallbacks());
         mTaskbarView.getLayoutParams().height = mActivity.getDeviceProfile().taskbarSize;
+        mThemeIconsColor = ThemedIconDrawable.getColors(mTaskbarView.getContext())[0];
 
         mTaskbarIconScaleForStash.updateValue(1f);
 
@@ -182,6 +190,15 @@
                 + mTaskbarIconTranslationYForStash.value);
     }
 
+    private void updateIconsBackground() {
+        mTaskbarView.setThemedIconsBackgroundColor(
+                ColorUtils.blendARGB(
+                        mThemeIconsColor,
+                        mTaskbarView.mThemeIconsBackground,
+                        mThemeIconsBackground.value
+                ));
+    }
+
     /**
      * Sets the taskbar icon alignment relative to Launcher hotseat icons
      * @param alignmentRatio [0, 1]
@@ -217,6 +234,10 @@
         setter.setFloat(mTaskbarIconTranslationYForHome, VALUE, -offsetY, LINEAR);
         setter.setFloat(mTaskbarNavButtonTranslationY, VALUE, -offsetY, LINEAR);
 
+        if (Utilities.isDarkTheme(mTaskbarView.getContext())) {
+            setter.addFloat(mThemeIconsBackground, VALUE, 0f, 1f, LINEAR);
+        }
+
         int collapsedHeight = mActivity.getDefaultTaskbarWindowHeight();
         int expandedHeight = Math.max(collapsedHeight,
                 mActivity.getDeviceProfile().taskbarSize + offsetY);
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
index b502676..fe31f1d 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
@@ -145,6 +145,18 @@
         });
     }
 
+    @BinderThread
+    @Override
+    public boolean onSwitchToScreenshot(Runnable onFinished) {
+        Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
+            for (RecentsAnimationListener listener : getListeners()) {
+                if (listener.onSwitchToScreenshot(onFinished)) return;
+            }
+            onFinished.run();
+        });
+        return true;
+    }
+
     private final void onAnimationFinished(RecentsAnimationController controller) {
         Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
             for (RecentsAnimationListener listener : getListeners()) {
@@ -180,5 +192,12 @@
          * Callback made when a task started from the recents is ready for an app transition.
          */
         default void onTasksAppeared(@NonNull RemoteAnimationTargetCompat[] appearedTaskTarget) {}
+
+        /**
+         * @return whether this will call onFinished or not (onFinished should only be called once).
+         */
+        default boolean onSwitchToScreenshot(Runnable onFinished) {
+            return false;
+        }
     }
 }
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index 57b42f8..4bb2400 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -203,6 +203,24 @@
                     }
                 }
             }
+
+            @Override
+            public boolean onSwitchToScreenshot(Runnable onFinished) {
+                if (!ENABLE_QUICKSTEP_LIVE_TILE.get() || !activityInterface.isInLiveTileMode()
+                        || activityInterface.getCreatedActivity() == null) {
+                    // No need to switch since tile is already a screenshot.
+                    onFinished.run();
+                } else {
+                    final RecentsView recentsView =
+                            activityInterface.getCreatedActivity().getOverviewPanel();
+                    if (recentsView != null) {
+                        recentsView.switchToScreenshot(onFinished);
+                    } else {
+                        onFinished.run();
+                    }
+                }
+                return true;
+            }
         });
         final long eventTime = gestureState.getSwipeUpStartTimeMs();
         mCallbacks.addListener(gestureState);
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index fe5e1d0..c13ab02 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -27,6 +27,7 @@
 import com.android.launcher3.anim.PendingAnimation;
 import com.android.launcher3.statemanager.StatefulActivity;
 import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.launcher3.util.SplitConfigurationOptions;
 import com.android.launcher3.views.BaseDragLayer;
 import com.android.quickstep.util.MultiValueUpdateListener;
 import com.android.quickstep.util.TaskCornerRadius;
@@ -53,6 +54,8 @@
     private final boolean mIsRtl;
     private final FullscreenDrawParams mFullscreenParams;
     private PagedOrientationHandler mOrientationHandler;
+    @SplitConfigurationOptions.StagePosition
+    private int mStagePosition;
 
     public FloatingTaskView(Context context) {
         this(context, null);
@@ -95,6 +98,7 @@
 
         RecentsView recentsView = launcher.getOverviewPanel();
         mOrientationHandler = recentsView.getPagedOrientationHandler();
+        mStagePosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition();
         mSplitPlaceholderView.setIcon(icon,
                 mContext.getResources().getDimensionPixelSize(R.dimen.split_placeholder_icon_size));
         mSplitPlaceholderView.getIconView().setRotation(mOrientationHandler.getDegreesRotated());
@@ -215,7 +219,7 @@
         transitionAnimator.addUpdateListener(listener);
     }
 
-    public void drawRoundedRect(Canvas canvas, Paint paint) {
+    void drawRoundedRect(Canvas canvas, Paint paint) {
         if (mFullscreenParams == null) {
             return;
         }
@@ -226,12 +230,21 @@
                 paint);
     }
 
-    public float getFullscreenScaleX() {
-        return mFullscreenParams.mScaleX;
-    }
-
-    public float getFullscreenScaleY() {
-        return mFullscreenParams.mScaleY;
+    /**
+     * When a split is staged, center the icon in the staging area. Accounts for device insets.
+     * @param iconView The icon that should be centered.
+     * @param onScreenRectCenterX The x-center of the on-screen staging area (most of the Rect is
+     *                        offscreen).
+     * @param onScreenRectCenterY The y-center of the on-screen staging area (most of the Rect is
+     *                        offscreen).
+     */
+    void centerIconView(IconView iconView, float onScreenRectCenterX, float onScreenRectCenterY) {
+        FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) iconView.getLayoutParams();
+        mOrientationHandler.updateStagedSplitIconParams(params, onScreenRectCenterX,
+                onScreenRectCenterY, mFullscreenParams.mScaleX, mFullscreenParams.mScaleY,
+                iconView.getDrawableWidth(), iconView.getDrawableHeight(),
+                mActivity.getDeviceProfile(), mStagePosition);
+        iconView.setLayoutParams(params);
     }
 
     private static class SplitOverlayProperties {
diff --git a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
index 7444217..28080d4 100644
--- a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
+++ b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java
@@ -68,13 +68,7 @@
             // Center the icon view in the visible area.
             getLocalVisibleRect(mTempRect);
             FloatingTaskView parent = (FloatingTaskView) getParent();
-            FrameLayout.LayoutParams params =
-                    (FrameLayout.LayoutParams) mIconView.getLayoutParams();
-            params.leftMargin = Math.round(mTempRect.centerX() / parent.getFullscreenScaleX()
-                    - 1.0f * mIconView.getDrawableWidth() / 2);
-            params.topMargin = Math.round(mTempRect.centerY() / parent.getFullscreenScaleY()
-                    - 1.0f * mIconView.getDrawableHeight() / 2);
-            mIconView.setLayoutParams(params);
+            parent.centerIconView(mIconView, mTempRect.centerX(), mTempRect.centerY());
         }
     }
 
diff --git a/res/color-v31/overview_scrim_dark.xml b/res/color-v31/overview_scrim_dark.xml
index 2ab8ecd..487b9f8 100644
--- a/res/color-v31/overview_scrim_dark.xml
+++ b/res/color-v31/overview_scrim_dark.xml
@@ -14,5 +14,5 @@
      limitations under the License.
 -->
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-  <item android:color="@android:color/system_neutral1_500" android:lStar="35" />
+  <item android:color="@android:color/system_neutral1_500" android:lStar="15" />
 </selector>
diff --git a/src/com/android/launcher3/settings/NotificationDotsPreference.java b/src/com/android/launcher3/settings/NotificationDotsPreference.java
index 0ee2744..f2a052d 100644
--- a/src/com/android/launcher3/settings/NotificationDotsPreference.java
+++ b/src/com/android/launcher3/settings/NotificationDotsPreference.java
@@ -89,7 +89,8 @@
         // Update intent
         Bundle extras = new Bundle();
         extras.putString(EXTRA_FRAGMENT_ARG_KEY, "notification_badging");
-        setIntent(new Intent("android.settings.NOTIFICATION_SETTINGS")
+
+        setIntent(new Intent("android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY")
                 .putExtra(EXTRA_SHOW_FRAGMENT_ARGS, extras));
     }
 
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 4fcba18..88a4d66 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -399,7 +399,8 @@
         // In fake land/seascape, the placeholder always needs to go to the "top" of the device,
         // which is the same bounds as 0 rotation.
         int width = dp.widthPx;
-        out.set(0, 0, width, placeholderHeight);
+        int insetThickness = dp.getInsets().top;
+        out.set(0, 0, width, placeholderHeight + insetThickness);
         out.inset(placeholderInset, 0);
 
         // Adjust the top to account for content off screen. This will help to animate the view in
@@ -412,6 +413,19 @@
     }
 
     @Override
+    public void updateStagedSplitIconParams(FrameLayout.LayoutParams out, float onScreenRectCenterX,
+            float onScreenRectCenterY, float fullscreenScaleX, float fullscreenScaleY,
+            int drawableWidth, int drawableHeight, DeviceProfile dp,
+            @StagePosition int stagePosition) {
+        float inset = dp.getInsets().top;
+        out.leftMargin = Math.round(onScreenRectCenterX / fullscreenScaleX
+                - 1.0f * drawableWidth / 2);
+        out.topMargin = Math.round((onScreenRectCenterY + (inset / 2f)) / fullscreenScaleY
+                - 1.0f * drawableHeight / 2);
+
+    }
+
+    @Override
     public void getFinalSplitPlaceholderBounds(int splitDividerSize, DeviceProfile dp,
             @StagePosition int stagePosition, Rect out1, Rect out2) {
         // In fake land/seascape, the window bounds are always top and bottom half
diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java
index 850eaaf..510a728 100644
--- a/src/com/android/launcher3/touch/PagedOrientationHandler.java
+++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java
@@ -116,6 +116,25 @@
             DeviceProfile dp, @StagePosition int stagePosition, Rect out);
 
     /**
+     * Centers an icon in the split staging area, accounting for insets.
+     * @param out The LayoutParams of the icon that needs to be centered.
+     * @param onScreenRectCenterX The x-center of the on-screen staging area (most of the Rect is
+     *                        offscreen).
+     * @param onScreenRectCenterY The y-center of the on-screen staging area (most of the Rect is
+     *                        offscreen).
+     * @param fullscreenScaleX A x-scaling factor used to convert coordinates back into pixels.
+     * @param fullscreenScaleY A y-scaling factor used to convert coordinates back into pixels.
+     * @param drawableWidth The icon's drawable (final) width.
+     * @param drawableHeight The icon's drawable (final) height.
+     * @param dp The device profile, used to report rotation and hardware insets.
+     * @param stagePosition 0 if the staging area is pinned to top/left, 1 for bottom/right.
+     */
+    void updateStagedSplitIconParams(FrameLayout.LayoutParams out, float onScreenRectCenterX,
+            float onScreenRectCenterY, float fullscreenScaleX, float fullscreenScaleY,
+            int drawableWidth, int drawableHeight, DeviceProfile dp,
+            @StagePosition int stagePosition);
+
+    /**
      * @param splitDividerSize height of split screen drag handle in portrait, width in landscape
      * @param stagePosition the split position option (top/left, bottom/right) of the first
      *                           task selected for entering split
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index d132901..d88656c 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -440,7 +440,14 @@
             DeviceProfile dp, @StagePosition int stagePosition, Rect out) {
         int screenWidth = dp.widthPx;
         int screenHeight = dp.heightPx;
-        out.set(0, 0, screenWidth, placeholderHeight);
+        boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
+        int insetThickness;
+        if (!dp.isLandscape) {
+            insetThickness = dp.getInsets().top;
+        } else {
+            insetThickness = pinToRight ? dp.getInsets().right : dp.getInsets().left;
+        }
+        out.set(0, 0, screenWidth, placeholderHeight + insetThickness);
         if (!dp.isLandscape) {
             // portrait, phone or tablet - spans width of screen, nothing else to do
             out.inset(placeholderInset, 0);
@@ -454,7 +461,6 @@
         }
 
         // Now we rotate the portrait rect depending on what side we want pinned
-        boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
 
         float postRotateScale = (float) screenHeight / screenWidth;
         mTmpMatrix.reset();
@@ -481,6 +487,33 @@
     }
 
     @Override
+    public void updateStagedSplitIconParams(FrameLayout.LayoutParams out, float onScreenRectCenterX,
+            float onScreenRectCenterY, float fullscreenScaleX, float fullscreenScaleY,
+            int drawableWidth, int drawableHeight, DeviceProfile dp,
+            @StagePosition int stagePosition) {
+        boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
+        if (!dp.isLandscape) {
+            float inset = dp.getInsets().top;
+            out.leftMargin = Math.round(onScreenRectCenterX / fullscreenScaleX
+                    - 1.0f * drawableWidth / 2);
+            out.topMargin = Math.round((onScreenRectCenterY + (inset / 2f)) / fullscreenScaleY
+                    - 1.0f * drawableHeight / 2);
+        } else {
+            if (pinToRight) {
+                float inset = dp.getInsets().right;
+                out.leftMargin = Math.round((onScreenRectCenterX - (inset / 2f)) / fullscreenScaleX
+                        - 1.0f * drawableWidth / 2);
+            } else {
+                float inset = dp.getInsets().left;
+                out.leftMargin = Math.round((onScreenRectCenterX + (inset / 2f)) / fullscreenScaleX
+                        - 1.0f * drawableWidth / 2);
+            }
+            out.topMargin = Math.round(onScreenRectCenterY / fullscreenScaleY
+                    - 1.0f * drawableHeight / 2);
+        }
+    }
+
+    @Override
     public void getFinalSplitPlaceholderBounds(int splitDividerSize, DeviceProfile dp,
             @StagePosition int stagePosition, Rect out1, Rect out2) {
         int screenHeight = dp.heightPx;