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

Commit 841dfad3 authored by Xin Li's avatar Xin Li
Browse files

Merge UP1A.230905.019

Merged-In: Ic437ff4d19cbd5764635f3007d99880622150f5b
Change-Id: I130465c5f31cededa1edc540123d83c6dedc9487
parents 2545c08f 3ce9069b
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.launcher3;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
import static android.view.RemoteAnimationTarget.MODE_OPENING;
@@ -144,6 +145,7 @@ import com.android.quickstep.util.StaggeredWorkspaceAnim;
import com.android.quickstep.util.SurfaceTransaction;
import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties;
import com.android.quickstep.util.SurfaceTransactionApplier;
import com.android.quickstep.util.TaskRestartedDuringLaunchListener;
import com.android.quickstep.util.WorkspaceRevealAnim;
import com.android.quickstep.views.FloatingWidgetView;
import com.android.quickstep.views.RecentsView;
@@ -229,6 +231,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
    private RemoteAnimationProvider mRemoteAnimationProvider;
    // Strong refs to runners which are cleared when the launcher activity is destroyed
    private RemoteAnimationFactory mWallpaperOpenRunner;
    private RemoteAnimationFactory mAppLaunchRunner;
    private RemoteAnimationFactory mKeyguardGoingAwayRunner;

    private RemoteAnimationFactory mWallpaperOpenTransitionRunner;
@@ -298,17 +301,23 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
        boolean fromRecents = isLaunchingFromRecents(v, null /* targets */);
        RunnableList onEndCallback = new RunnableList();

        RemoteAnimationFactory delegateRunner = new AppLaunchAnimationRunner(v, onEndCallback);
        // Handle the case where an already visible task is launched which results in no transition
        TaskRestartedDuringLaunchListener restartedListener =
                new TaskRestartedDuringLaunchListener();
        restartedListener.register(onEndCallback::executeAllAndDestroy);
        onEndCallback.add(restartedListener::unregister);

        mAppLaunchRunner = new AppLaunchAnimationRunner(v, onEndCallback);
        ItemInfo tag = (ItemInfo) v.getTag();
        if (tag != null && tag.shouldUseBackgroundAnimation()) {
            ContainerAnimationRunner containerAnimationRunner =
                    ContainerAnimationRunner.from(v, mStartingWindowListener, onEndCallback);
            if (containerAnimationRunner != null) {
                delegateRunner = containerAnimationRunner;
                mAppLaunchRunner = containerAnimationRunner;
            }
        }
        RemoteAnimationRunnerCompat runner = new LauncherAnimationRunner(
                mHandler, delegateRunner, true /* startAtFrontOfQueue */);
                mHandler, mAppLaunchRunner, true /* startAtFrontOfQueue */);

        // Note that this duration is a guess as we do not know if the animation will be a
        // recents launch or not for sure until we know the opening app targets.
@@ -1164,6 +1173,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
            // Also clear strong references to the runners registered with the remote animation
            // definition so we don't have to wait for the system gc
            mWallpaperOpenRunner = null;
            mAppLaunchRunner = null;
            mKeyguardGoingAwayRunner = null;
        }
    }
@@ -1201,16 +1211,17 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
        return false;
    }

    private boolean hasMultipleTargetsWithMode(RemoteAnimationTarget[] targets, int mode) {
    private boolean shouldPlayFallbackClosingAnimation(RemoteAnimationTarget[] targets) {
        int numTargets = 0;
        for (RemoteAnimationTarget target : targets) {
            if (target.mode == mode) {
            if (target.mode == MODE_CLOSING) {
                numTargets++;
            }
            if (numTargets > 1) {
                if (numTargets > 1 || target.windowConfiguration.getWindowingMode()
                        == WINDOWING_MODE_MULTI_WINDOW) {
                    return true;
                }
            }
        }
        return false;
    }

@@ -1595,7 +1606,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
            boolean playFallBackAnimation = (launcherView == null
                    && launcherIsForceInvisibleOrOpening)
                    || mLauncher.getWorkspace().isOverlayShown()
                    || hasMultipleTargetsWithMode(appTargets, MODE_CLOSING);
                    || shouldPlayFallbackClosingAnimation(appTargets);

            boolean playWorkspaceReveal = true;
            boolean skipAllAppsScale = false;
+5 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import com.android.quickstep.util.GroupTask;
import com.android.quickstep.views.RecentsView;

import java.io.PrintWriter;
import java.util.Arrays;

/**
 * A data source which integrates with a Launcher instance
@@ -105,6 +106,10 @@ public class LauncherTaskbarUIController extends TaskbarUIController {

        // Restore the in-app display progress from before Taskbar was recreated.
        float[] prevProgresses = mControllers.getSharedState().inAppDisplayProgressMultiPropValues;
        // Make a copy of the previous progress to set since updating the multiprop will update
        // the property which also calls onInAppDisplayProgressChanged() which writes the current
        // values into the shared state
        prevProgresses = Arrays.copyOf(prevProgresses, prevProgresses.length);
        for (int i = 0; i < prevProgresses.length; i++) {
            mTaskbarInAppDisplayProgressMultiProp.get(i).setValue(prevProgresses[i]);
        }
+9 −0
Original line number Diff line number Diff line
@@ -923,6 +923,15 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
        insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
    }

    /**
     * Called whenever a new ui controller is set, and should update anything that depends on the
     * ui controller.
     */
    public void onUiControllerChanged() {
        updateNavButtonInAppDisplayProgressForSysui();
        updateNavButtonTranslationY();
    }

    @Override
    public void dumpLogs(String prefix, PrintWriter pw) {
        pw.println(prefix + "NavbarButtonsViewController:");
+1 −3
Original line number Diff line number Diff line
@@ -591,9 +591,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
     * Sets a new data-source for this taskbar instance
     */
    public void setUIController(@NonNull TaskbarUIController uiController) {
        mControllers.uiController.onDestroy();
        mControllers.uiController = uiController;
        mControllers.uiController.init(mControllers);
        mControllers.setUiController(uiController);
    }

    /**
+13 −0
Original line number Diff line number Diff line
@@ -196,6 +196,19 @@ public class TaskbarControllers {
        mPostInitCallbacks.clear();
    }

    /**
     * Sets the ui controller.
     */
    public void setUiController(@NonNull TaskbarUIController newUiController) {
        uiController.onDestroy();
        uiController = newUiController;
        uiController.init(this);
        uiController.updateStateForSysuiFlags(mSharedState.sysuiStateFlags);

        // Notify that the ui controller has changed
        navbarButtonsViewController.onUiControllerChanged();
    }

    @Nullable
    public TaskbarSharedState getSharedState() {
        // This should only be null if called before init() and after destroy().
Loading