Merge "Changed assistant debug flag to global" into ub-launcher3-master
diff --git a/Android.bp b/Android.bp
index c583244..5688407 100644
--- a/Android.bp
+++ b/Android.bp
@@ -13,19 +13,54 @@
 // limitations under the License.
 
 java_library_static {
+    name: "launcher-log-proto-nano",
+    proto: {
+        type: "nano",
+	output_params: [
+	    "store_unknown_fields=true",
+	    "enum_style=java",
+	],
+	local_include_dirs: [
+	    "protos",
+	    "proto_overrides",
+	],
+    },
+    srcs: [
+        "protos/**/*.proto",
+        "proto_overrides/**/*.proto",
+    ],
+}
+
+android_library{
     name: "launcher-aosp-tapl",
     static_libs: [
         "androidx.annotation_annotation",
+        "androidx.dynamicanimation_dynamicanimation",
+        "androidx.recyclerview_recyclerview",
+        "androidx.preference_preference",
         "androidx.test.runner",
         "androidx.test.rules",
         "androidx.test.uiautomator_uiautomator",
+        "iconloader_base",
+        "launcher-log-proto-nano",
+        "launcherprotosnano",
         "SystemUISharedLib",
     ],
     srcs: [
         "tests/tapl/**/*.java",
-        "quickstep/src/com/android/quickstep/SwipeUpSetting.java",
-        "src/com/android/launcher3/util/SecureSettingsObserver.java",
-        "src/com/android/launcher3/TestProtocol.java",
+        "quickstep/src/**/*.java",
+        "quickstep/recents_ui_overrides/src/**/*.java",
+        "src/**/*.java",
+        "src_build_config/**/*.java",
+        "src_flags/**/*.java",
+        "src_plugins/**/*.java",
+        "src_shortcuts_overrides/**/*.java",
+    ],
+    dxflags: ["--multi-dex"],
+    resource_dirs: [
+        "res",
+        "quickstep/res",
+        "quickstep/recents_ui_overrides/res",
     ],
     platform_apis: true,
 }
diff --git a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
index 76abe8d..96b0a9e 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
@@ -48,7 +48,7 @@
     private ShadowGenerator mShadowGenerator;
 
     private Drawable mWrapperIcon;
-    private int mWrapperBackgroundColor;
+    private int mWrapperBackgroundColor = DEFAULT_WRAPPER_BACKGROUND;
 
     protected BaseIconFactory(Context context, int fillResIconDpi, int iconBitmapSize) {
         mContext = context.getApplicationContext();
diff --git a/quickstep/recents_ui_overrides/res/layout/hint.xml b/quickstep/recents_ui_overrides/res/layout/hint.xml
deleted file mode 100644
index 7e2d6af..0000000
--- a/quickstep/recents_ui_overrides/res/layout/hint.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2019 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<com.android.quickstep.hints.HintView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="@dimen/chip_hint_height"
-    android:layout_gravity="center_horizontal|bottom"
-    android:paddingStart="@dimen/chip_hint_start_padding"
-    android:paddingEnd="@dimen/chip_hint_end_padding"
-    android:background="@drawable/chip_hint_background_light"
-    android:gravity="center"
-    android:layout_marginHorizontal="@dimen/chip_hint_horizontal_margin"
-    android:orientation="horizontal"
-    android:elevation="@dimen/chip_hint_elevation"
-    android:layoutDirection="ltr">
-
-    <ImageView
-        android:id="@+id/icon"
-        android:layout_width="@dimen/chip_icon_size"
-        android:layout_height="@dimen/chip_icon_size"
-        android:visibility="gone"
-        android:scaleType="fitCenter"
-        android:adjustViewBounds="true"
-        android:contentDescription="@null"/>
-
-    <TextView
-        android:id="@+id/label"
-        android:layout_width="wrap_content"
-        android:layout_height="@dimen/chip_text_height"
-        android:paddingTop="@dimen/chip_text_top_padding"
-        android:paddingStart="@dimen/chip_text_start_padding"
-        android:fontFamily="google-sans-medium"
-        android:textAlignment="textStart"
-        android:singleLine="true"
-        android:textColor="@color/chip_hint_foreground_color"
-        android:textSize="@dimen/chip_text_size"
-        android:ellipsize="none"
-        android:includeFontPadding="true"/>
-
-
-</com.android.quickstep.hints.HintView>
\ No newline at end of file
diff --git a/quickstep/recents_ui_overrides/res/layout/hint_container.xml b/quickstep/recents_ui_overrides/res/layout/hint_container.xml
index 336f63e..f8723fc 100644
--- a/quickstep/recents_ui_overrides/res/layout/hint_container.xml
+++ b/quickstep/recents_ui_overrides/res/layout/hint_container.xml
@@ -14,9 +14,10 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<com.android.quickstep.hints.HintsContainer
+<com.android.quickstep.hints.ChipsContainer
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_height="@dimen/chip_hint_height"
+    android:layout_gravity="bottom"
     android:gravity="center_horizontal"
     android:orientation="horizontal"/>
\ No newline at end of file
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java
index 408b749..9650a53 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java
@@ -100,10 +100,14 @@
     public HomeAnimationFactory prepareHomeUI(Launcher activity) {
         final DeviceProfile dp = activity.getDeviceProfile();
         final RecentsView recentsView = activity.getOverviewPanel();
-        final ComponentName component = recentsView.getRunningTaskView().getTask().key
-                .sourceComponent;
-
-        final View workspaceView = activity.getWorkspace().getFirstMatchForAppClose(component);
+        final TaskView runningTaskView = recentsView.getRunningTaskView();
+        final View workspaceView;
+        if (runningTaskView != null) {
+            ComponentName component = runningTaskView.getTask().key.sourceComponent;
+            workspaceView = activity.getWorkspace().getFirstMatchForAppClose(component);
+        } else {
+            workspaceView = null;
+        }
         final Rect iconLocation = new Rect();
         final FloatingIconView floatingView = workspaceView == null ? null
                 : FloatingIconView.getFloatingIconView(activity, workspaceView,
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ChipsContainer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ChipsContainer.java
new file mode 100644
index 0000000..8fc89f2
--- /dev/null
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ChipsContainer.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.hints;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.FloatProperty;
+import android.view.View;
+import android.widget.FrameLayout;
+
+public class ChipsContainer extends FrameLayout {
+
+    private static final String TAG = "ChipsContainer";
+
+    public static final FloatProperty<ChipsContainer> HINT_VISIBILITY =
+            new FloatProperty<ChipsContainer>("hint_visibility") {
+                @Override
+                public void setValue(ChipsContainer chipsContainer, float v) {
+                    chipsContainer.setHintVisibility(v);
+                }
+
+                @Override
+                public Float get(ChipsContainer chipsContainer) {
+                    return chipsContainer.mHintVisibility;
+                }
+            };
+
+    private float mHintVisibility;
+
+    public ChipsContainer(Context context) {
+        super(context);
+    }
+
+    public ChipsContainer(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public ChipsContainer(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public ChipsContainer(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    public void setView(View v) {
+        removeAllViews();
+        addView(v);
+    }
+
+    public void setHintVisibility(float v) {
+        if (v == 1) {
+            setVisibility(VISIBLE);
+        } else {
+            setVisibility(GONE);
+        }
+        mHintVisibility = v;
+    }
+}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintsContainer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintsContainer.java
deleted file mode 100644
index 22b1217..0000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintsContainer.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.hints;
-
-import static com.android.quickstep.hints.UiHintListenerConstants.HINTS_KEY;
-import static com.android.quickstep.hints.UiHintListenerConstants.ON_HINTS_RETURNED_CODE;
-import static com.android.quickstep.hints.UiInterfaceConstants.REQUEST_HINTS_CODE;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.util.AttributeSet;
-import android.util.FloatProperty;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.widget.LinearLayout;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.R;
-
-import java.util.ArrayList;
-
-public class HintsContainer extends LinearLayout {
-
-    private static final String TAG = "HintsView";
-
-    public static final FloatProperty<HintsContainer> HINT_VISIBILITY =
-            new FloatProperty<HintsContainer>("hint_visibility") {
-                @Override
-                public void setValue(HintsContainer hintsContainer, float v) {
-                    hintsContainer.setHintVisibility(v);
-                }
-
-                @Override
-                public Float get(HintsContainer hintsContainer) {
-                    return hintsContainer.mHintVisibility;
-                }
-            };
-
-    private static Intent mServiceIntent =
-            new Intent("com.android.systemui.action.UI_PULL_INTERFACE")
-                    .setClassName(
-                            "com.android.systemui.navbarhint",
-                            "com.android.systemui.navbarhint.service.HintService");
-
-    @Nullable
-    private Messenger mHintServiceInterface;
-    private UiHintListener mUiHintListener;
-    private boolean mBound = false;
-    private float mHintVisibility;
-
-    private final ServiceConnection mServiceConnection = new ServiceConnection() {
-        @Override
-        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
-            mHintServiceInterface = new Messenger(iBinder);
-        }
-
-        @Override
-        public void onServiceDisconnected(ComponentName componentName) {
-            mHintServiceInterface = null;
-            attemptBinding();
-        }
-
-        @Override
-        public void onBindingDied(ComponentName componentName) {
-            mHintServiceInterface = null;
-            attemptBinding();
-        }
-    };
-
-    public HintsContainer(Context context) {
-        super(context);
-    }
-
-    public HintsContainer(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public HintsContainer(Context context, AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-    }
-
-    public HintsContainer(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
-        super(context, attrs, defStyleAttr, defStyleRes);
-    }
-
-    @Override
-    protected void onAttachedToWindow() {
-        super.onAttachedToWindow();
-        if (mUiHintListener == null) {
-            mUiHintListener = new UiHintListener(this);
-        }
-        if (!mBound) {
-            attemptBinding();
-        }
-    }
-
-    @Override
-    protected void onDetachedFromWindow() {
-        if (mBound) {
-            getContext().unbindService(mServiceConnection);
-            mBound = false;
-        }
-        super.onDetachedFromWindow();
-    }
-
-    public void setHintVisibility(float v) {
-        if (v == 1) {
-            getHints();
-            setVisibility(VISIBLE);
-        } else {
-            setVisibility(GONE);
-        }
-        mHintVisibility = v;
-    }
-
-    private void attemptBinding() {
-        if (mBound) {
-            getContext().unbindService(mServiceConnection);
-            mBound = false;
-        }
-        boolean success = getContext().bindService(mServiceIntent,
-                mServiceConnection, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT);
-        if (success) {
-            mBound = true;
-        } else {
-            Log.w(TAG, "Binding to hint supplier failed");
-        }
-    }
-    
-    private void sendOnHintTap(Bundle hint) {
-        if (mHintServiceInterface != null) {
-            Message msg = Message.obtain(null, UiInterfaceConstants.ON_HINT_TAP_CODE);
-            Bundle data = new Bundle();
-            data.putString(UiInterfaceConstants.HINT_ID_KEY, HintUtil.getId(hint));
-            data.putInt(UiInterfaceConstants.WIDTH_PX_KEY, getWidth());
-            data.putInt(UiInterfaceConstants.HEIGHT_PX_KEY, getHeight());
-            data.putInt(UiInterfaceConstants.HINT_SPACE_WIDTH_PX_KEY, 0);
-            data.putInt(UiInterfaceConstants.HINT_SPACE_HEIGHT_PX_KEY, 0);
-            msg.setData(data);
-            try {
-                mHintServiceInterface.send(msg);
-            } catch (RemoteException e) {
-                Log.e(TAG, "Failed to send hint tap", e);
-            }
-        }
-    }
-
-    private void getHints() {
-        if (mHintServiceInterface != null) {
-            try {
-                Message m = Message.obtain(null, REQUEST_HINTS_CODE);
-                m.replyTo = new Messenger(mUiHintListener);
-                mHintServiceInterface.send(m);
-            } catch (RemoteException e) {
-                Log.e(TAG, "Failed to send message", e);
-            }
-        }
-    }
-
-    private static class UiHintListener extends Handler {
-        private HintsContainer mView;
-
-        UiHintListener(HintsContainer v) {
-            mView = v;
-        }
-
-        @Override
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-                case ON_HINTS_RETURNED_CODE:
-                    handleHints(msg);
-                    break;
-                default:
-                    Log.e(TAG, "UiPullInterface got unrecognized code: " + msg.what);
-                    break;
-            }
-        }
-
-        private void handleHints(Message msg) {
-            Bundle bundle = msg.getData();
-            ArrayList<Bundle> hints = bundle.getParcelableArrayList(HINTS_KEY);
-
-            if (hints != null) {
-                mView.removeAllViews();
-
-                for (Bundle hint : hints) {
-                    HintView h = (HintView) LayoutInflater.from(mView.getContext()).inflate(
-                            R.layout.hint, mView, false);
-                    h.setHint(hint);
-                    h.setOnClickListener((v) -> mView.sendOnHintTap(hint));
-                    mView.addView(h);
-                }
-            }
-        }
-    }
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java
index 88fe2ee..97bce5e 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -42,9 +42,10 @@
 import com.android.launcher3.R;
 import com.android.launcher3.anim.Interpolators;
 import com.android.launcher3.util.PendingAnimation;
+import com.android.launcher3.views.BaseDragLayer;
 import com.android.launcher3.views.ScrimView;
 import com.android.quickstep.OverviewInteractionState;
-import com.android.quickstep.hints.HintsContainer;
+import com.android.quickstep.hints.ChipsContainer;
 import com.android.quickstep.util.ClipAnimationHelper;
 import com.android.quickstep.util.ClipAnimationHelper.TransformParams;
 import com.android.quickstep.util.LayoutUtils;
@@ -77,7 +78,7 @@
     private float mTranslationYFactor;
 
     private final TransformParams mTransformParams = new TransformParams();
-    private HintsContainer mHintsContainer;
+    private ChipsContainer mChipsContainer;
 
     public LauncherRecentsView(Context context) {
         this(context, null);
@@ -111,8 +112,9 @@
     @Override
     protected void onAttachedToWindow() {
         super.onAttachedToWindow();
-        mHintsContainer = mActivity.findViewById(R.id.hints);
-        mHintsContainer.setPadding(0, 0, 0, mActivity.getDeviceProfile().chipHintBottomMarginPx);
+        mChipsContainer = mActivity.findViewById(R.id.hints);
+        BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) mChipsContainer.getLayoutParams();
+        params.bottomMargin = mActivity.getDeviceProfile().chipHintBottomMarginPx;
     }
 
     public void setTranslationYFactor(float translationFactor) {
@@ -131,11 +133,15 @@
     }
 
     public void setHintVisibility(float v) {
-        if (mHintsContainer != null && ENABLE_HINTS_IN_OVERVIEW.get()) {
-            mHintsContainer.setHintVisibility(v);
+        if (mChipsContainer != null && ENABLE_HINTS_IN_OVERVIEW.get()) {
+            mChipsContainer.setHintVisibility(v);
         }
     }
 
+    public ChipsContainer getChipsContainer() {
+        return mChipsContainer;
+    }
+
     @Override
     public void draw(Canvas canvas) {
         maybeDrawEmptyMessage(canvas);
@@ -192,7 +198,7 @@
 
         if (ENABLE_HINTS_IN_OVERVIEW.get()) {
             anim.anim.play(ObjectAnimator.ofFloat(
-                    mHintsContainer, HintsContainer.HINT_VISIBILITY, 0));
+                    mChipsContainer, ChipsContainer.HINT_VISIBILITY, 0));
         }
 
         return anim;
@@ -206,10 +212,10 @@
 
         if (ENABLE_HINTS_IN_OVERVIEW.get()) {
             anim.anim.play(ObjectAnimator.ofFloat(
-                    mHintsContainer, HintsContainer.HINT_VISIBILITY, 0));
+                    mChipsContainer, ChipsContainer.HINT_VISIBILITY, 0));
             anim.addEndListener(onEndListener -> {
                 if (!onEndListener.isSuccess) {
-                    mHintsContainer.setHintVisibility(1);
+                    mChipsContainer.setHintVisibility(1);
                 }
             });
         }
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index a7bf2c3..3e0e8ae 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -773,7 +773,7 @@
         setCurrentTask(runningTaskId);
     }
 
-    public TaskView getRunningTaskView() {
+    public @Nullable TaskView getRunningTaskView() {
         return getTaskView(mRunningTaskId);
     }
 
diff --git a/quickstep/src/com/android/quickstep/OverviewInteractionState.java b/quickstep/src/com/android/quickstep/OverviewInteractionState.java
index 411e593..a0ab301 100644
--- a/quickstep/src/com/android/quickstep/OverviewInteractionState.java
+++ b/quickstep/src/com/android/quickstep/OverviewInteractionState.java
@@ -175,7 +175,7 @@
         }
     }
 
-    public void notifySwipeUpSettingChanged(boolean swipeUpEnabled) {
+    private void notifySwipeUpSettingChanged(boolean swipeUpEnabled) {
         mUiHandler.removeMessages(MSG_SET_SWIPE_UP_ENABLED);
         mUiHandler.obtainMessage(MSG_SET_SWIPE_UP_ENABLED, swipeUpEnabled ? 1 : 0, 0).
                 sendToTarget();
diff --git a/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java b/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java
index 7274090..c5975a9 100644
--- a/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java
+++ b/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java
@@ -19,6 +19,11 @@
 import static com.android.quickstep.QuickStepOnOffRule.Mode.BOTH;
 import static com.android.quickstep.QuickStepOnOffRule.Mode.OFF;
 import static com.android.quickstep.QuickStepOnOffRule.Mode.ON;
+import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING_NAME;
+
+import static org.junit.Assert.assertTrue;
+
+import android.provider.Settings;
 
 import androidx.test.InstrumentationRegistry;
 
@@ -69,38 +74,52 @@
                 @Override
                 public void evaluate() throws Throwable {
                     try {
-                        if (mode == ON || mode == BOTH) {
-                            evaluateWithQuickstepOn();
-                        }
-                        if (mode == OFF || mode == BOTH) {
-                            evaluateWithQuickstepOff();
+                        if (SwipeUpSetting.isSwipeUpSettingAvailable()) {
+                            if (mode == ON || mode == BOTH) {
+                                evaluateWithQuickstepOn();
+                            }
+                            if (mode == OFF || mode == BOTH) {
+                                evaluateWithQuickstepOff();
+                            }
+                        } else {
+                            // Execute without changing the setting, if the requested mode is
+                            // compatible.
+                            final boolean swipeUpEnabledDefaultValue =
+                                    SwipeUpSetting.isSwipeUpEnabledDefaultValue();
+                            if (mode == BOTH ||
+                                    mode == ON && swipeUpEnabledDefaultValue ||
+                                    mode == OFF && !swipeUpEnabledDefaultValue) {
+                                evaluateWithoutChangingSetting(base);
+                            }
                         }
                     } finally {
-                        overrideSwipeUpEnabled(null);
+                        setSwipeUpSetting(null);
+
                     }
                 }
 
-                private void evaluateWithQuickstepOff() throws Throwable {
-                    overrideSwipeUpEnabled(false);
+                public void setSwipeUpSetting(String value) {
+                    assertTrue("Couldn't change Quickstep mode",
+                            Settings.Secure.putString(
+                                    InstrumentationRegistry.getInstrumentation().getTargetContext().
+                                            getContentResolver(),
+                                    SWIPE_UP_SETTING_NAME,
+                                    value));
+                }
+
+                public void evaluateWithoutChangingSetting(Statement base) throws Throwable {
                     base.evaluate();
                 }
 
+                private void evaluateWithQuickstepOff() throws Throwable {
+                    setSwipeUpSetting("0");
+                    evaluateWithoutChangingSetting(base);
+                }
+
                 private void evaluateWithQuickstepOn() throws Throwable {
-                    overrideSwipeUpEnabled(true);
+                    setSwipeUpSetting("1");
                     base.evaluate();
                 }
-
-                private void overrideSwipeUpEnabled(Boolean swipeUpEnabledOverride)
-                        throws Throwable {
-                    mLauncher.overrideSwipeUpEnabled(swipeUpEnabledOverride);
-                    mMainThreadExecutor.execute(() -> OverviewInteractionState.INSTANCE.get(
-                            InstrumentationRegistry.getInstrumentation().getTargetContext()).
-                            notifySwipeUpSettingChanged(mLauncher.isSwipeUpEnabled()));
-                    // TODO(b/124236673): avoid using sleep().
-                    mLauncher.getDevice().waitForIdle();
-                    Thread.sleep(2000);
-                    mLauncher.getDevice().waitForIdle();
-                }
             };
         } else {
             return base;
diff --git a/res/layout/launcher.xml b/res/layout/launcher.xml
index 91c3705..c9cea80 100644
--- a/res/layout/launcher.xml
+++ b/res/layout/launcher.xml
@@ -38,6 +38,15 @@
             android:theme="@style/HomeScreenElementTheme"
             launcher:pageIndicator="@+id/page_indicator" />
 
+        <!-- DO NOT CHANGE THE ID -->
+        <com.android.launcher3.Hotseat
+            android:id="@+id/hotseat"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:theme="@style/HomeScreenElementTheme"
+            android:importantForAccessibility="no"
+            launcher:containerType="hotseat" />
+
         <include
             android:id="@+id/overview_panel"
             layout="@layout/overview_panel"
@@ -71,15 +80,6 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
 
-        <!-- DO NOT CHANGE THE ID -->
-        <com.android.launcher3.Hotseat
-            android:id="@+id/hotseat"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:theme="@style/HomeScreenElementTheme"
-            android:importantForAccessibility="no"
-            launcher:containerType="hotseat" />
-
     </com.android.launcher3.dragndrop.DragLayer>
 
 </com.android.launcher3.LauncherRootView>
diff --git a/res/layout/snackbar.xml b/res/layout/snackbar.xml
index bca3308..b818943 100644
--- a/res/layout/snackbar.xml
+++ b/res/layout/snackbar.xml
@@ -29,7 +29,7 @@
         android:ellipsize="end"
         android:textSize="@dimen/snackbar_max_text_size"
         android:textColor="?android:attr/textColorPrimary"
-        android:theme="@style/TextTitle"/>
+        style="@style/TextTitle"/>
     <TextView
         android:id="@+id/action"
         android:layout_height="@dimen/snackbar_content_height"
@@ -42,6 +42,6 @@
         android:textStyle="bold"
         android:textSize="@dimen/snackbar_max_text_size"
         android:textColor="?android:attr/colorAccent"
-        android:theme="@style/TextTitle"
+        style="@style/TextTitle"
         android:capitalize="sentences"/>
 </merge>
\ No newline at end of file
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 6d85612..cee1c26 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -187,6 +187,11 @@
         return new float[] {1, 0, 0};
     }
 
+    public float[] getHotseatScaleAndTranslation(Launcher launcher) {
+        // For most states, treat the hotseat as if it were part of the workspace.
+        return getWorkspaceScaleAndTranslation(launcher);
+    }
+
     /**
      * Returns 2 floats designating how to transition overview:
      *   scale for the current and adjacent pages
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index a877141..119058d 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -17,7 +17,6 @@
 package com.android.launcher3;
 
 import static android.view.View.VISIBLE;
-
 import static com.android.launcher3.LauncherState.NORMAL;
 import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
 import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE;
@@ -298,6 +297,8 @@
             if (!isWorkspaceVisible) {
                 workspace.setScaleX(0.92f);
                 workspace.setScaleY(0.92f);
+                workspace.getHotseat().setScaleX(0.92f);
+                workspace.getHotseat().setScaleY(0.92f);
             }
         }
     }
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index 3e09493..0507470 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -19,7 +19,6 @@
 import static com.android.launcher3.LauncherAnimUtils.DRAWABLE_ALPHA;
 import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
 import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
-import static com.android.launcher3.LauncherState.HOTSEAT_SEARCH_BOX;
 import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE;
 import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE;
 import static com.android.launcher3.anim.Interpolators.LINEAR;
@@ -35,6 +34,7 @@
 import com.android.launcher3.LauncherStateManager.AnimationConfig;
 import com.android.launcher3.anim.AnimatorSetBuilder;
 import com.android.launcher3.anim.PropertySetter;
+import com.android.launcher3.dragndrop.DragLayer;
 import com.android.launcher3.graphics.WorkspaceAndHotseatScrim;
 
 /**
@@ -72,6 +72,7 @@
     private void setWorkspaceProperty(LauncherState state, PropertySetter propertySetter,
             AnimatorSetBuilder builder, AnimationConfig config) {
         float[] scaleAndTranslation = state.getWorkspaceScaleAndTranslation(mLauncher);
+        float[] hotseatScaleAndTranslation = state.getHotseatScaleAndTranslation(mLauncher);
         mNewScale = scaleAndTranslation[0];
         PageAlphaProvider pageAlphaProvider = state.getWorkspacePageAlphaProvider(mLauncher);
         final int childCount = mWorkspace.getChildCount();
@@ -84,12 +85,24 @@
         Interpolator fadeInterpolator = builder.getInterpolator(ANIM_WORKSPACE_FADE,
                 pageAlphaProvider.interpolator);
         boolean playAtomicComponent = config.playAtomicComponent();
+        Hotseat hotseat = mWorkspace.getHotseat();
         if (playAtomicComponent) {
             Interpolator scaleInterpolator = builder.getInterpolator(ANIM_WORKSPACE_SCALE, ZOOM_OUT);
             propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, scaleInterpolator);
+
+            // Set the hotseat's pivot point to match the workspace's, so that it scales together.
+            DragLayer dragLayer = mLauncher.getDragLayer();
+            int[] workspacePivot = new int[]{(int) mWorkspace.getPivotX(),
+                    (int) mWorkspace.getPivotY()};
+            dragLayer.getDescendantCoordRelativeToSelf(mWorkspace, workspacePivot);
+            dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot);
+            hotseat.setPivotX(workspacePivot[0]);
+            hotseat.setPivotY(workspacePivot[1]);
+            float hotseatScale = hotseatScaleAndTranslation[0];
+            propertySetter.setFloat(hotseat, SCALE_PROPERTY, hotseatScale, scaleInterpolator);
+
             float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0;
-            propertySetter.setViewAlpha(mLauncher.getHotseat(), hotseatIconsAlpha,
-                    fadeInterpolator);
+            propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, fadeInterpolator);
             propertySetter.setViewAlpha(mLauncher.getWorkspace().getPageIndicator(),
                     hotseatIconsAlpha, fadeInterpolator);
         }
@@ -105,6 +118,11 @@
         propertySetter.setFloat(mWorkspace, View.TRANSLATION_Y,
                 scaleAndTranslation[2], translationInterpolator);
 
+        propertySetter.setFloat(hotseat, View.TRANSLATION_Y,
+                hotseatScaleAndTranslation[2], translationInterpolator);
+        propertySetter.setFloat(mWorkspace.getPageIndicator(), View.TRANSLATION_Y,
+                hotseatScaleAndTranslation[2], translationInterpolator);
+
         // Set scrim
         WorkspaceAndHotseatScrim scrim = mLauncher.getDragLayer().getScrim();
         propertySetter.setFloat(scrim, SCRIM_PROGRESS, state.getWorkspaceScrimAlpha(mLauncher),
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index bcb5eec..93bf69d 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -124,12 +124,6 @@
         float shiftCurrent = progress * mShiftRange;
 
         mAppsView.setTranslationY(shiftCurrent);
-        float hotseatTranslation = -mShiftRange + shiftCurrent;
-
-        if (!mIsVerticalLayout) {
-            mLauncher.getHotseat().setTranslationY(hotseatTranslation);
-            mLauncher.getWorkspace().getPageIndicator().setTranslationY(hotseatTranslation);
-        }
 
         // Use a light system UI (dark icons) if all apps is behind at least half of the
         // status bar.
diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java
index 35f7f88..fcace98 100644
--- a/src/com/android/launcher3/states/SpringLoadedState.java
+++ b/src/com/android/launcher3/states/SpringLoadedState.java
@@ -73,6 +73,11 @@
     }
 
     @Override
+    public float[] getHotseatScaleAndTranslation(Launcher launcher) {
+        return new float[] {1, 0, 0};
+    }
+
+    @Override
     public void onStateEnabled(Launcher launcher) {
         Workspace ws = launcher.getWorkspace();
         ws.showPageIndicatorAtCurrentScroll();
diff --git a/tests/Android.mk b/tests/Android.mk
index a787537..9a88785 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -24,14 +24,12 @@
 	androidx.test.runner \
 	androidx.test.rules \
 	androidx.test.uiautomator_uiautomator \
-	libSharedSystemUI
+	libSharedSystemUI \
+	Launcher3QuickStepLib \
 
-LOCAL_SRC_FILES := $(call all-java-files-under, tapl) \
-  ../quickstep/src/com/android/quickstep/SwipeUpSetting.java \
-  ../src/com/android/launcher3/util/SecureSettingsObserver.java \
-  ../src/com/android/launcher3/TestProtocol.java \
+LOCAL_SRC_FILES := $(call all-java-files-under, tapl)
 
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := system_current
 LOCAL_MODULE := ub-launcher-aosp-tapl
 
 include $(BUILD_STATIC_JAVA_LIBRARY)
@@ -52,7 +50,7 @@
   LOCAL_PRIVATE_PLATFORM_APIS := true
   LOCAL_STATIC_JAVA_LIBRARIES += launcher-aosp-tapl
 else
-  LOCAL_SDK_VERSION := 28
+  LOCAL_SDK_VERSION := system_current
   LOCAL_MIN_SDK_VERSION := 21
   LOCAL_STATIC_JAVA_LIBRARIES += ub-launcher-aosp-tapl
 endif
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 7473189..93b4cc6 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -93,8 +93,6 @@
     private static WeakReference<VisibleContainer> sActiveContainer = new WeakReference<>(null);
 
     private final UiDevice mDevice;
-    private final boolean mSwipeUpEnabled;
-    private Boolean mSwipeUpEnabledOverride = null;
     private final Instrumentation mInstrumentation;
     private int mExpectedRotation = Surface.ROTATION_0;
 
@@ -104,13 +102,6 @@
     public LauncherInstrumentation(Instrumentation instrumentation) {
         mInstrumentation = instrumentation;
         mDevice = UiDevice.getInstance(instrumentation);
-        final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue();
-        mSwipeUpEnabled = SwipeUpSetting.isSwipeUpSettingAvailable() ?
-                Settings.Secure.getInt(
-                        instrumentation.getTargetContext().getContentResolver(),
-                        SWIPE_UP_SETTING_NAME,
-                        swipeUpEnabledDefaultValue ? 1 : 0) == 1 :
-                swipeUpEnabledDefaultValue;
 
         // Launcher should run in test harness so that custom accessibility protocol between
         // Launcher and TAPL is enabled. In-process tests enable this protocol with a direct call
@@ -119,17 +110,18 @@
                 TestHelpers.isInLauncherProcess() || ActivityManager.isRunningInTestHarness());
     }
 
-    // Used only by TaplTests.
-    public void overrideSwipeUpEnabled(Boolean swipeUpEnabledOverride) {
-        mSwipeUpEnabledOverride = swipeUpEnabledOverride;
-    }
-
     void setActiveContainer(VisibleContainer container) {
         sActiveContainer = new WeakReference<>(container);
     }
 
     public boolean isSwipeUpEnabled() {
-        return mSwipeUpEnabledOverride != null ? mSwipeUpEnabledOverride : mSwipeUpEnabled;
+        final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue();
+        return SwipeUpSetting.isSwipeUpSettingAvailable() ?
+                Settings.Secure.getInt(
+                        mInstrumentation.getTargetContext().getContentResolver(),
+                        SWIPE_UP_SETTING_NAME,
+                        swipeUpEnabledDefaultValue ? 1 : 0) == 1 :
+                swipeUpEnabledDefaultValue;
     }
 
     static void log(String message) {