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

Commit 162ed05a authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Add NavigationModeFeatureFlag

3 Button mode doesn't use recents animation so live tile would not work on 3 button mode before migration to recents animation happens.

Bug: 169694902
Test: manual
Change-Id: I9574c624f3d220834fa18e910637cd64460adb0c
parent 4092352a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_EDU;
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.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;

import android.animation.ValueAnimator;
@@ -145,7 +145,7 @@ public class NavBarToHomeTouchController implements TouchController,
                    OverviewScrim.SCRIM_MULTIPLIER, OVERVIEW_TO_HOME_SCRIM_MULTIPLIER,
                    PULLBACK_INTERPOLATOR);

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

@@ -194,7 +194,7 @@ public class NavBarToHomeTouchController implements TouchController,
        boolean success = interpolatedProgress >= SUCCESS_TRANSITION_PROGRESS
                || (velocity < 0 && fling);
        if (success) {
            if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            if (LIVE_TILE.get()) {
                RecentsView recentsView = mLauncher.getOverviewPanel();
                recentsView.switchToScreenshot(null,
                        () -> recentsView.finishRecentsAnimation(true /* toRecents */, null));
+8 −8
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAG
import static com.android.launcher3.QuickstepAppTransitionManagerImpl.RECENTS_LAUNCH_DURATION;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
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;
@@ -45,6 +44,7 @@ import static com.android.quickstep.GestureState.STATE_END_TARGET_ANIMATION_FINI
import static com.android.quickstep.GestureState.STATE_END_TARGET_SET;
import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHED;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
@@ -318,7 +318,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
        mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED | STATE_FINISH_WITH_NO_END,
                this::notifyTransitionCancelled);

        if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        if (!LIVE_TILE.get()) {
            mStateCallback.addChangeListener(STATE_APP_CONTROLLER_RECEIVED | STATE_LAUNCHER_PRESENT
                            | STATE_SCREENSHOT_VIEW_SHOWN | STATE_CAPTURE_SCREENSHOT,
                    (b) -> mRecentsView.setRunningTaskHidden(!b));
@@ -459,7 +459,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
    }

    private void onDeferredActivityLaunch() {
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        if (LIVE_TILE.get()) {
            mActivityInterface.switchRunningTaskViewToScreenshot(
                    null, () -> {
                        mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */);
@@ -1366,7 +1366,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends

    private void resetLauncherListenersAndOverlays() {
        // Reset the callback for deferred activity launches
        if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        if (!LIVE_TILE.get()) {
            mActivityInterface.setOnDeferredActivityLaunchCallback(null);
        }
        mActivity.getRootView().setOnApplyWindowInsetsListener(null);
@@ -1387,7 +1387,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends

    protected void switchToScreenshot() {
        final int runningTaskId = mGestureState.getRunningTaskId();
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        if (LIVE_TILE.get()) {
            if (mRecentsAnimationController != null) {
                mRecentsAnimationController.getController().setWillFinishToHome(true);
                // Update the screenshot of the task
@@ -1456,7 +1456,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
    }

    private void finishCurrentTransitionToRecents() {
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        if (LIVE_TILE.get()) {
            mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
        } else if (!hasTargets() || mRecentsAnimationController == null) {
            // If there are no targets or the animation not started, then there is nothing to finish
@@ -1517,7 +1517,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
        endLauncherTransitionController();
        mActivityInterface.onSwipeUpToRecentsComplete();
        mRecentsView.onSwipeUpAnimationSuccess();
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        if (LIVE_TILE.get()) {
            mTaskAnimationManager.setLaunchOtherTaskInLiveTileModeHandler(
                    appearedTaskTarget -> {
                        RemoteAnimationTargetCompat[] apps = Arrays.copyOf(
@@ -1765,7 +1765,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, Q extends
            }
            mTaskViewSimulator.apply(mTransformParams);
        }
        if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mRecentsAnimationTargets != null) {
        if (LIVE_TILE.get() && mRecentsAnimationTargets != null) {
            LiveTileOverlay.INSTANCE.update(
                    mTaskViewSimulator.getCurrentRect(),
                    mTaskViewSimulator.getCurrentCornerRadius());
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.quickstep;

import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -59,6 +61,8 @@ public class QuickstepProcessInitializer extends MainProcessInitializer {

        super.init(context);

        LIVE_TILE.initialize(context);

        // Elevate GPU priority for Quickstep and Remote animations.
        ThreadedRendererCompat.setContextPriority(
                ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG);
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.quickstep;

import static android.view.Surface.ROTATION_0;

import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
import static com.android.quickstep.views.OverviewActionsView.DISABLED_NO_THUMBNAIL;
import static com.android.quickstep.views.OverviewActionsView.DISABLED_ROTATED;

@@ -163,7 +163,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
         * @param callback callback to run, after switching to screenshot
         */
        public void endLiveTileMode(@NonNull Runnable callback) {
            if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            if (LIVE_TILE.get()) {
                RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView();
                recentsView.switchToScreenshot(
                        () -> recentsView.finishRecentsAnimation(true /* toRecents */, callback));
+4 −5
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncest
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR;
import static com.android.launcher3.anim.Interpolators.clampToProgress;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.statehandlers.DepthController.DEPTH;
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;

@@ -139,7 +139,7 @@ public final class TaskViewUtils {
        boolean isRunningTask = v.isRunningTask();
        TransformParams params = null;
        TaskViewSimulator tsv = null;
        if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask) {
        if (LIVE_TILE.get() && isRunningTask) {
            params = v.getRecentsView().getLiveTileParams();
            tsv = v.getRecentsView().getLiveTileTaskViewSimulator();
        }
@@ -159,8 +159,7 @@ public final class TaskViewUtils {
        boolean isQuickSwitch = v.isEndQuickswitchCuj();
        v.setEndQuickswitchCuj(false);

        boolean inLiveTileMode =
                ENABLE_QUICKSTEP_LIVE_TILE.get() && v.getRecentsView().getRunningTaskIndex() != -1;
        boolean inLiveTileMode = LIVE_TILE.get() && v.getRecentsView().getRunningTaskIndex() != -1;
        final RemoteAnimationTargets targets =
                new RemoteAnimationTargets(appTargets, wallpaperTargets,
                        inLiveTileMode ? MODE_CLOSING : MODE_OPENING);
@@ -341,7 +340,7 @@ public final class TaskViewUtils {
            };
        }
        pa.add(launcherAnim);
        if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskIndex() != -1) {
        if (LIVE_TILE.get() && recentsView.getRunningTaskIndex() != -1) {
            pa.addOnFrameCallback(recentsView::redrawLiveTile);
        }
        anim.play(pa.buildAnim());
Loading