Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7a7bfc3 authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Remove ENABLE_QUICKSTEP_LIVE_TILE flag" into tm-qpr-dev

parents 6a84ebc7 c0095e81
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_WIDGET_PICKER_DEPTH;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
@@ -559,11 +558,9 @@ public class QuickstepLauncher extends Launcher {
    @Override
    protected void onScreenOff() {
        super.onScreenOff();
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        RecentsView recentsView = getOverviewPanel();
        recentsView.finishRecentsAnimation(true /* toRecents */, null);
    }
    }

    /**
     * {@code LauncherOverlayCallbacks} scroll amount.
+4 −9
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION;
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;

@@ -139,9 +138,7 @@ public class NavBarToHomeTouchController implements TouchController,
            AnimatorControllerWithResistance.createRecentsResistanceFromOverviewAnim(mLauncher,
                    builder);

            if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            builder.addOnFrameCallback(recentsView::redrawLiveTile);
            }

            AbstractFloatingView.closeOpenContainer(mLauncher, AbstractFloatingView.TYPE_TASK_MENU);
        } else if (mStartState == ALL_APPS) {
@@ -182,11 +179,9 @@ public class NavBarToHomeTouchController implements TouchController,
        boolean success = interpolatedProgress >= SUCCESS_TRANSITION_PROGRESS
                || (velocity < 0 && fling);
        if (success) {
            if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            RecentsView recentsView = mLauncher.getOverviewPanel();
            recentsView.switchToScreenshot(null,
                    () -> recentsView.finishRecentsAnimation(true /* toRecents */, null));
            }
            if (mStartState.overviewUi) {
                new OverviewToHomeAnim(mLauncher, () -> onSwipeInteractionCompleted(mEndState))
                        .animateWithVelocity(velocity);
+15 −42
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static com.android.launcher3.PagedView.INVALID_PAGE;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE;
@@ -400,12 +399,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                this::resetStateForAnimationCancel);
        mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED | STATE_FINISH_WITH_NO_END,
                this::resetStateForAnimationCancel);

        if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            mStateCallback.addChangeListener(STATE_APP_CONTROLLER_RECEIVED | STATE_LAUNCHER_PRESENT
                            | STATE_SCREENSHOT_VIEW_SHOWN | STATE_CAPTURE_SCREENSHOT,
                    (b) -> mRecentsView.setRunningTaskHidden(!b));
        }
    }

    protected boolean onActivityInit(Boolean alreadyOnHome) {
@@ -583,14 +576,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    }

    private void onDeferredActivityLaunch() {
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        mActivityInterface.switchRunningTaskViewToScreenshot(
                null, () -> {
                    mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */);
                });
        } else {
            mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */);
        }
    }

    private void setupRecentsViewUi() {
@@ -1719,8 +1708,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    }

    private void invalidateHandler() {
        if (!ENABLE_QUICKSTEP_LIVE_TILE.get() || !mActivityInterface.isInLiveTileMode()
                || mGestureState.getEndTarget() != RECENTS) {
        if (!mActivityInterface.isInLiveTileMode() || mGestureState.getEndTarget() != RECENTS) {
            mInputConsumerProxy.destroy();
            mTaskAnimationManager.setLiveTileCleanUpHandler(null);
        }
@@ -1765,10 +1753,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
     * continued quick switch gesture, which cancels the previous handler but doesn't invalidate it.
     */
    private void resetLauncherListeners() {
        // Reset the callback for deferred activity launches
        if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            mActivityInterface.setOnDeferredActivityLaunchCallback(null);
        }
        mActivity.getRootView().setOnApplyWindowInsetsListener(null);

        mRecentsView.removeOnScrollChangedListener(mOnRecentsScrollListener);
@@ -1790,7 +1774,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            mStateCallback.setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
        } else {
            final int runningTaskId = mGestureState.getRunningTaskId();
            final boolean refreshView = !ENABLE_QUICKSTEP_LIVE_TILE.get() /* refreshView */;
            boolean finishTransitionPosted = false;
            if (mRecentsAnimationController != null) {
                // Update the screenshot of the task
@@ -1801,14 +1784,14 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                                mRecentsAnimationController.screenshotTask(runningTaskId);
                        MAIN_EXECUTOR.execute(() -> {
                            mTaskSnapshot = taskSnapshot;
                            if (!updateThumbnail(runningTaskId, refreshView)) {
                            if (!updateThumbnail(runningTaskId, false /* refreshView */)) {
                                setScreenshotCapturedState();
                            }
                        });
                    });
                    return;
                }
                finishTransitionPosted = updateThumbnail(runningTaskId, refreshView);
                finishTransitionPosted = updateThumbnail(runningTaskId, false /* refreshView */);
            }
            if (!finishTransitionPosted) {
                setScreenshotCapturedState();
@@ -1846,18 +1829,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    }

    private void finishCurrentTransitionToRecents() {
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
        if (mRecentsAnimationController != null) {
            mRecentsAnimationController.detachNavigationBarFromApp(true);
        }
        } else if (!hasTargets() || mRecentsAnimationController == null) {
            // If there are no targets or the animation not started, then there is nothing to finish
            mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
        } else {
            mRecentsAnimationController.finish(true /* toRecents */,
                    () -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
        }
        ActiveGestureLog.INSTANCE.addLog(
                /* event= */ "finishRecentsAnimation",
                /* extras= */ true,
@@ -1920,13 +1895,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        }
        endLauncherTransitionController();
        mRecentsView.onSwipeUpAnimationSuccess();
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        mTaskAnimationManager.setLiveTileCleanUpHandler(() -> {
            mRecentsView.cleanupRemoteTargets();
            mInputConsumerProxy.destroy();
        });
        mTaskAnimationManager.enableLiveTileRestartListener();
        }

        SystemUiProxy.INSTANCE.get(mContext).onOverviewShown(false, TAG);
        doLogGesture(RECENTS, mRecentsView.getCurrentPageTaskView());
+1 −3
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */
package com.android.quickstep;

import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
import static com.android.quickstep.fallback.RecentsState.BACKGROUND_APP;
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
@@ -120,8 +119,7 @@ public final class FallbackActivityInterface extends
    public RecentsView getVisibleRecentsView() {
        RecentsActivity activity = getCreatedActivity();
        if (activity != null) {
            if (activity.hasBeenResumed()
                    || (ENABLE_QUICKSTEP_LIVE_TILE.get() && isInLiveTileMode())) {
            if (activity.hasBeenResumed() || isInLiveTileMode()) {
                return activity.getOverviewPanel();
            }
        }
+2 −4
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;

import android.animation.Animator;
@@ -203,8 +202,7 @@ public final class LauncherActivityInterface extends
    private Launcher getVisibleLauncher() {
        Launcher launcher = getCreatedActivity();
        return (launcher != null) && launcher.isStarted()
                && ((ENABLE_QUICKSTEP_LIVE_TILE.get() && isInLiveTileMode())
                || launcher.hasBeenResumed()) ? launcher : null;
                && (isInLiveTileMode() || launcher.hasBeenResumed()) ? launcher : null;
    }

    @Override
@@ -213,7 +211,7 @@ public final class LauncherActivityInterface extends
        if (launcher == null) {
            return false;
        }
        if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isInLiveTileMode()) {
        if (isInLiveTileMode()) {
            RecentsView recentsView = getVisibleRecentsView();
            if (recentsView == null) {
                return false;
Loading