Merge "Tighten up loading of visible task data" into ub-launcher3-edmonton
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto
index 065663d..cab20a3 100644
--- a/protos/launcher_log.proto
+++ b/protos/launcher_log.proto
@@ -155,6 +155,7 @@
     CONFIRM = 4;        // Indicates thata confirmation screen was accepted
     STOP = 5;           // Indicates onStop() was called (screen time out, power off)
     RECENTS_BUTTON = 6; // Indicates that Recents button was pressed
+    RESUME = 7;         // Indicates onResume() was called
   }
 
   optional Type type = 1;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/BackButtonAlphaHandler.java b/quickstep/src/com/android/launcher3/uioverrides/BackButtonAlphaHandler.java
new file mode 100644
index 0000000..2e6dcc0
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/uioverrides/BackButtonAlphaHandler.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2018 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.launcher3.uioverrides;
+
+import android.animation.ValueAnimator;
+
+import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherState;
+import com.android.launcher3.LauncherStateManager;
+import com.android.launcher3.anim.AnimatorSetBuilder;
+import com.android.quickstep.OverviewInteractionState;
+
+public class BackButtonAlphaHandler implements LauncherStateManager.StateHandler {
+
+    private static final String TAG = "BackButtonAlphaHandler";
+
+    private final Launcher mLauncher;
+    private final OverviewInteractionState mOverviewInteractionState;
+
+    public BackButtonAlphaHandler(Launcher launcher) {
+        mLauncher = launcher;
+        mOverviewInteractionState = OverviewInteractionState.getInstance(mLauncher);
+    }
+
+    @Override
+    public void setState(LauncherState state) {
+        UiFactory.onLauncherStateOrFocusChanged(mLauncher);
+    }
+
+    @Override
+    public void setStateWithAnimation(LauncherState toState,
+            AnimatorSetBuilder builder, LauncherStateManager.AnimationConfig config) {
+        if (!config.playNonAtomicComponent()) {
+            return;
+        }
+        float fromAlpha = mOverviewInteractionState.getBackButtonAlpha();
+        float toAlpha = toState.hideBackButton ? 0 : 1;
+        if (Float.compare(fromAlpha, toAlpha) != 0) {
+            ValueAnimator anim = ValueAnimator.ofFloat(fromAlpha, toAlpha);
+            anim.setDuration(config.duration);
+            anim.addUpdateListener(valueAnimator -> {
+                final float alpha = (float) valueAnimator.getAnimatedValue();
+                mOverviewInteractionState.setBackButtonAlpha(alpha, false);
+            });
+            builder.play(anim);
+        }
+    }
+}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
index b371677..76820b6 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
@@ -78,11 +78,13 @@
     }
 
     public static StateHandler[] getStateHandler(Launcher launcher) {
-        return new StateHandler[] {
-                launcher.getAllAppsController(), launcher.getWorkspace(),
-                new RecentsViewStateController(launcher)};
+        return new StateHandler[] {launcher.getAllAppsController(), launcher.getWorkspace(),
+                new RecentsViewStateController(launcher), new BackButtonAlphaHandler(launcher)};
     }
 
+    /**
+     * Sets the back button visibility based on the current state/window focus.
+     */
     public static void onLauncherStateOrFocusChanged(Launcher launcher) {
         boolean shouldBackButtonBeHidden = launcher != null
                 && launcher.getStateManager().getState().hideBackButton
@@ -96,10 +98,6 @@
                 .setBackButtonAlpha(shouldBackButtonBeHidden ? 0 : 1, true /* animate */);
     }
 
-    public static void setBackButtonAlpha(Launcher launcher, float alpha, boolean animate) {
-         OverviewInteractionState.getInstance(launcher).setBackButtonAlpha(alpha,animate);
-    }
-
     public static void resetOverview(Launcher launcher) {
         RecentsView recents = launcher.getOverviewPanel();
         recents.reset();
diff --git a/quickstep/src/com/android/quickstep/OverviewInteractionState.java b/quickstep/src/com/android/quickstep/OverviewInteractionState.java
index d605746..922a7ff 100644
--- a/quickstep/src/com/android/quickstep/OverviewInteractionState.java
+++ b/quickstep/src/com/android/quickstep/OverviewInteractionState.java
@@ -91,6 +91,7 @@
     // These are updated on the background thread
     private ISystemUiProxy mISystemUiProxy;
     private boolean mSwipeUpEnabled = true;
+    private float mBackButtonAlpha = 1;
 
     private Runnable mOnSwipeUpSettingChangedListener;
 
@@ -117,7 +118,14 @@
         return mSwipeUpEnabled;
     }
 
+    public float getBackButtonAlpha() {
+        return mBackButtonAlpha;
+    }
+
     public void setBackButtonAlpha(float alpha, boolean animate) {
+        if (!mSwipeUpEnabled) {
+            alpha = 1;
+        }
         mUiHandler.removeMessages(MSG_SET_BACK_BUTTON_ALPHA);
         mUiHandler.obtainMessage(MSG_SET_BACK_BUTTON_ALPHA, animate ? 1 : 0, 0, alpha)
                 .sendToTarget();
@@ -128,6 +136,9 @@
     }
 
     private boolean handleUiMessage(Message msg) {
+        if (msg.what == MSG_SET_BACK_BUTTON_ALPHA) {
+            mBackButtonAlpha = (float) msg.obj;
+        }
         mBgHandler.obtainMessage(msg.what, msg.arg1, msg.arg2, msg.obj).sendToTarget();
         return true;
     }
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index 9e2de33..c5d74c7 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -20,8 +20,10 @@
 import android.graphics.Rect;
 import android.util.AttributeSet;
 import android.view.View;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.R;
 import com.android.quickstep.RecentsActivity;
 import com.android.quickstep.util.LayoutUtils;
 import com.android.quickstep.views.RecentsView;
@@ -71,4 +73,21 @@
         // Just use the activity task size for multi-window as well.
         return false;
     }
+
+    @Override
+    public void addTaskAccessibilityActionsExtra(AccessibilityNodeInfo info) {
+        info.addAction(
+                new AccessibilityNodeInfo.AccessibilityAction(
+                        R.string.recents_clear_all,
+                        getContext().getText(R.string.recents_clear_all)));
+    }
+
+    @Override
+    public boolean performTaskAccessibilityActionExtra(int action) {
+        if (action == R.string.recents_clear_all) {
+            dismissAllTasks();
+            return true;
+        }
+        return false;
+    }
 }
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index f06342f..91d3350 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -53,7 +53,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewDebug;
-import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.launcher3.BaseActivity;
 import com.android.launcher3.DeviceProfile;
@@ -1007,6 +1007,7 @@
     }
 
     public void setContentAlpha(float alpha) {
+        alpha = Utilities.boundToRange(alpha, 0, 1);
         mContentAlpha = alpha;
         for (int i = getChildCount() - 1; i >= 0; i--) {
             TaskView child = getPageAt(i);
@@ -1269,10 +1270,6 @@
     @Override
     protected void notifyPageSwitchListener(int prevPage) {
         super.notifyPageSwitchListener(prevPage);
-        View currChild = getChildAt(mCurrentPage);
-        if (currChild != null) {
-            currChild.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
-        }
         loadVisibleTaskData();
     }
 
@@ -1330,4 +1327,11 @@
     protected boolean isPageOrderFlipped() {
         return FLIP_RECENTS;
     }
+
+    public void addTaskAccessibilityActionsExtra(AccessibilityNodeInfo info) {
+    }
+
+    public boolean performTaskAccessibilityActionExtra(int action) {
+        return false;
+    }
 }
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 82aa45a..2f1a0fe 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -17,6 +17,7 @@
 package com.android.quickstep.views;
 
 import static android.widget.Toast.LENGTH_SHORT;
+
 import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA_MULTIPLIER;
 
 import android.animation.Animator;
@@ -116,7 +117,7 @@
             }
             launchTask(true /* animate */);
             BaseActivity.fromContext(context).getUserEventDispatcher().logTaskLaunchOrDismiss(
-                    Touch.TAP, Direction.NONE, ((RecentsView) getParent()).indexOfChild(this),
+                    Touch.TAP, Direction.NONE, getRecentsView().indexOfChild(this),
                     TaskUtils.getComponentKeyForTask(getTask().key));
         });
         setOutlineProvider(new TaskOutlineProvider(getResources()));
@@ -318,12 +319,14 @@
                         context.getText(menuOption.labelResId)));
             }
         }
+
+        getRecentsView().addTaskAccessibilityActionsExtra(info);
     }
 
     @Override
     public boolean performAccessibilityAction(int action, Bundle arguments) {
         if (action == R.string.accessibility_close_task) {
-            ((RecentsView) getParent()).dismissTask(this, true /*animateTaskView*/,
+            getRecentsView().dismissTask(this, true /*animateTaskView*/,
                     true /*removeTask*/);
             return true;
         }
@@ -339,9 +342,15 @@
             }
         }
 
+        if (getRecentsView().performTaskAccessibilityActionExtra(action)) return true;
+
         return super.performAccessibilityAction(action, arguments);
     }
 
+    private RecentsView getRecentsView() {
+        return (RecentsView) getParent();
+    }
+
     public void notifyTaskLaunchFailed(String tag) {
         String msg = "Failed to launch task";
         if (mTask != null) {
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 5a1c158..c75509e 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -101,10 +101,12 @@
     }
 
     public final void close(boolean animate) {
-        animate &= !Utilities.isPowerSaverOn(getContext());
+        animate &= !Utilities.isPowerSaverPreventingAnimation(getContext());
+        if (mIsOpen) {
+            BaseActivity.fromContext(getContext()).getUserEventDispatcher()
+                    .resetElapsedContainerMillis("container closed");
+        }
         handleClose(animate);
-        BaseActivity.fromContext(getContext()).getUserEventDispatcher()
-                .resetElapsedContainerMillis("container closed");
         mIsOpen = false;
     }
 
@@ -121,9 +123,11 @@
 
     protected abstract boolean isOfType(@FloatingViewType int type);
 
-    public void onBackPressed() {
+    /** @return Whether the back is consumed. If false, Launcher will handle the back as well. */
+    public boolean onBackPressed() {
         logActionCommand(Action.Command.BACK);
         close(true);
+        return true;
     }
 
     @Override
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 7979082..6c2fd8e 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -1980,7 +1980,7 @@
             // Animations are disabled in power save mode, causing the repeated animation to jump
             // spastically between beginning and end states. Since this looks bad, we don't repeat
             // the animation in power save mode.
-            if (!Utilities.isPowerSaverOn(getContext())) {
+            if (!Utilities.isPowerSaverPreventingAnimation(getContext())) {
                 va.setRepeatMode(ValueAnimator.REVERSE);
                 va.setRepeatCount(ValueAnimator.INFINITE);
             }
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index e851499..14390ec 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -50,6 +50,7 @@
 import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.Handler;
 import android.os.Parcelable;
 import android.os.Process;
 import android.os.StrictMode;
@@ -243,6 +244,10 @@
 
     private RotationHelper mRotationHelper;
 
+
+    private final Handler mHandler = new Handler();
+    private final Runnable mLogOnDelayedResume = this::logOnDelayedResume;
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         if (DEBUG_STRICT_MODE) {
@@ -727,10 +732,11 @@
         if (mLauncherCallbacks != null) {
             mLauncherCallbacks.onStop();
         }
-        mAppWidgetHost.setListenIfResumed(false);
-
         getUserEventDispatcher().logActionCommand(Action.Command.STOP,
                 mStateManager.getState().containerType, -1);
+
+        mAppWidgetHost.setListenIfResumed(false);
+
         NotificationListener.removeNotificationsChangedListener();
         getStateManager().moveToRestState();
 
@@ -751,13 +757,23 @@
         UiFactory.onStart(this);
     }
 
+    private void logOnDelayedResume() {
+        if (hasBeenResumed()) {
+            getUserEventDispatcher().logActionCommand(Action.Command.RESUME,
+                    mStateManager.getState().containerType, -1);
+            getUserEventDispatcher().startSession();
+        }
+    }
+
     @Override
     protected void onResume() {
         TraceHelper.beginSection("ON_RESUME");
         super.onResume();
         TraceHelper.partitionSection("ON_RESUME", "superCall");
 
-        getUserEventDispatcher().resetElapsedSessionMillis();
+        mHandler.removeCallbacks(mLogOnDelayedResume);
+        Utilities.postAsyncCallback(mHandler, mLogOnDelayedResume);
+
         setOnResumeCallback(null);
         // Process any items that were added while Launcher was away.
         InstallShortcutReceiver.disableAndFlushInstallQueue(
@@ -1583,8 +1599,8 @@
         // by using if-else statements.
         UserEventDispatcher ued = getUserEventDispatcher();
         AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(this);
-        if (topView != null) {
-            topView.onBackPressed();
+        if (topView != null && topView.onBackPressed()) {
+            // Handled by the floating view.
         } else if (!isInState(NORMAL)) {
             LauncherState lastState = mStateManager.getLastState();
             ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType,
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index e6fc4c6..3fcdee9 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -396,7 +396,6 @@
             setRestState(null);
         }
 
-        UiFactory.onLauncherStateOrFocusChanged(mLauncher);
         UiFactory.onLauncherStateOrResumeChanged(mLauncher);
     }
 
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 006dc95..4bd9a9b 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -39,7 +39,6 @@
 import android.os.Message;
 import android.os.PowerManager;
 import android.os.TransactionTooLargeException;
-import android.support.v4.os.BuildCompat;
 import android.text.Spannable;
 import android.text.SpannableString;
 import android.text.TextUtils;
@@ -83,7 +82,8 @@
     private static final Matrix sMatrix = new Matrix();
     private static final Matrix sInverseMatrix = new Matrix();
 
-    public static final boolean ATLEAST_P = BuildCompat.isAtLeastP();
+    public static final boolean ATLEAST_P =
+            Build.VERSION.SDK_INT >= Build.VERSION_CODES.P;
 
     public static final boolean ATLEAST_OREO_MR1 =
             Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1;
@@ -492,7 +492,11 @@
                 LauncherFiles.DEVICE_PREFERENCES_KEY, Context.MODE_PRIVATE);
     }
 
-    public static boolean isPowerSaverOn(Context context) {
+    public static boolean isPowerSaverPreventingAnimation(Context context) {
+        if (ATLEAST_P) {
+            // Battery saver mode no longer prevents animations.
+            return false;
+        }
         PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
         return powerManager.isPowerSaveMode();
     }
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index b5c821a..2c3e3ee 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -25,11 +25,9 @@
 import com.android.launcher3.LauncherStateManager.AnimationConfig;
 import com.android.launcher3.LauncherStateManager.StateHandler;
 import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
 import com.android.launcher3.anim.AnimationSuccessListener;
 import com.android.launcher3.anim.AnimatorSetBuilder;
 import com.android.launcher3.anim.PropertySetter;
-import com.android.launcher3.uioverrides.UiFactory;
 import com.android.launcher3.util.Themes;
 import com.android.launcher3.views.ScrimView;
 
@@ -184,13 +182,6 @@
         anim.setDuration(config.duration);
         anim.setInterpolator(builder.getInterpolator(ANIM_VERTICAL_PROGRESS, interpolator));
         anim.addListener(getProgressAnimatorListener());
-        if (toState.hideBackButton) {
-            anim.addUpdateListener(animation -> {
-                final float alpha = (float) animation.getAnimatedValue();
-                UiFactory.setBackButtonAlpha(mLauncher, 1 - Utilities.boundToRange(alpha, 0, 1),
-                        false /* animate */);
-            });
-        }
 
         builder.play(anim);
 
diff --git a/src/com/android/launcher3/allapps/DiscoveryBounce.java b/src/com/android/launcher3/allapps/DiscoveryBounce.java
index deaf8d3..e1cd06a 100644
--- a/src/com/android/launcher3/allapps/DiscoveryBounce.java
+++ b/src/com/android/launcher3/allapps/DiscoveryBounce.java
@@ -84,6 +84,14 @@
     }
 
     @Override
+    public boolean onBackPressed() {
+        super.onBackPressed();
+        // Go back to the previous state (from a user's perspective this floating view isn't
+        // something to go back from).
+        return false;
+    }
+
+    @Override
     public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
         handleClose(false);
         return false;
diff --git a/src/com/android/launcher3/compat/UserManagerCompatVP.java b/src/com/android/launcher3/compat/UserManagerCompatVP.java
index 2e8a8eb..fa3902b 100644
--- a/src/com/android/launcher3/compat/UserManagerCompatVP.java
+++ b/src/com/android/launcher3/compat/UserManagerCompatVP.java
@@ -15,41 +15,20 @@
  */
 package com.android.launcher3.compat;
 
+import android.annotation.TargetApi;
 import android.content.Context;
+import android.os.Build;
 import android.os.UserHandle;
-import android.os.UserManager;
-import android.util.Log;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
+@TargetApi(Build.VERSION_CODES.P)
 public class UserManagerCompatVP extends UserManagerCompatVNMr1 {
-    private static final String TAG = "UserManagerCompatVP";
-
-    private Method mRequestQuietModeEnabled;
 
     UserManagerCompatVP(Context context) {
         super(context);
-        // TODO: Replace it with proper API call once SDK is ready.
-        try {
-            mRequestQuietModeEnabled = UserManager.class.getDeclaredMethod(
-                    "requestQuietModeEnabled", boolean.class, UserHandle.class);
-        } catch (NoSuchMethodException e) {
-            Log.e(TAG, "requestQuietModeEnabled is not available", e);
-        }
     }
 
     @Override
     public boolean requestQuietModeEnabled(boolean enableQuietMode, UserHandle user) {
-        if (mRequestQuietModeEnabled == null) {
-            return false;
-        }
-        try {
-            return (boolean)
-                    mRequestQuietModeEnabled.invoke(mUserManager, enableQuietMode, user);
-        } catch (IllegalAccessException | InvocationTargetException e) {
-            Log.e(TAG, "Failed to invoke mRequestQuietModeEnabled", e);
-        }
-        return false;
+        return mUserManager.requestQuietModeEnabled(enableQuietMode, user);
     }
 }
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index b49952f..6b13da7 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -1437,12 +1437,13 @@
     }
 
     @Override
-    public void onBackPressed() {
+    public boolean onBackPressed() {
         if (isEditingName()) {
             mFolderName.dispatchBackKey();
         } else {
             super.onBackPressed();
         }
+        return true;
     }
 
     @Override
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index 850c948..1842e19 100644
--- a/src/com/android/launcher3/logging/UserEventDispatcher.java
+++ b/src/com/android/launcher3/logging/UserEventDispatcher.java
@@ -125,6 +125,7 @@
         return null;
     }
 
+    private boolean mSessionStarted;
     private long mElapsedContainerMillis;
     private long mElapsedSessionMillis;
     private long mActionDurationMillis;
@@ -216,9 +217,11 @@
 
     public void logActionCommand(int command, Target srcTarget, Target dstTarget) {
         LauncherEvent event = newLauncherEvent(newCommandAction(command), srcTarget);
-        if (command == Action.Command.STOP && mAppOrTaskLaunch) {
-            // Prevent double logging by skipping STOP when app or task has been launched.
-            return;
+        if (command == Action.Command.STOP) {
+            if (mAppOrTaskLaunch || !mSessionStarted) {
+                mSessionStarted = false;
+                return;
+            }
         }
 
         if (dstTarget != null) {
@@ -405,7 +408,8 @@
 
     }
 
-    public final void resetElapsedSessionMillis() {
+    public final void startSession() {
+        mSessionStarted = true;
         mElapsedSessionMillis = SystemClock.uptimeMillis();
         mElapsedContainerMillis = SystemClock.uptimeMillis();
     }
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 0e68538..24382b7 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -42,7 +42,6 @@
 import com.android.launcher3.anim.AnimationSuccessListener;
 import com.android.launcher3.anim.AnimatorPlaybackController;
 import com.android.launcher3.anim.AnimatorSetBuilder;
-import com.android.launcher3.uioverrides.UiFactory;
 import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
 import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
 import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -224,8 +223,6 @@
             cancelAtomicComponentsController();
         }
         mProgressMultiplier = initCurrentAnimation(animComponents);
-        mCurrentAnimation.getAnimationPlayer().addUpdateListener(animation ->
-                setBackButtonAlphaWithProgress((float) animation.getAnimatedValue()));
         mCurrentAnimation.dispatchOnStart();
         return true;
     }
@@ -284,7 +281,6 @@
             mAtomicComponentsController.setPlayFraction(fraction - mAtomicComponentsStartProgress);
         }
         maybeUpdateAtomicAnim(mFromState, mToState, fraction);
-        setBackButtonAlphaWithProgress(fraction);
     }
 
     /**
@@ -477,14 +473,6 @@
         }
     }
 
-    private void setBackButtonAlphaWithProgress(float progress) {
-        if (mFromState.hideBackButton ^ mToState.hideBackButton) {
-            progress = Utilities.boundToRange(progress, 0, 1);
-            final float alpha = mToState.hideBackButton ? 1 - progress : progress;
-            UiFactory.setBackButtonAlpha(mLauncher, alpha, false /* animate */);
-        }
-    }
-
     private void logReachedState(int logAction) {
         // Transition complete. log the action
         mLauncher.getUserEventDispatcher().logStateChangeAction(logAction,