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

Commit fa652a8a authored by Winson Chung's avatar Winson Chung
Browse files

Updating to use deferred cancel api

- Also updating the sysui flag to home's flags when passing some
  threshold
- Also ensure we don't allow swipe up when QS is open

Bug: 137196872
Bug: 135969043
Change-Id: I476eee7f02ae86aa795fceabb304bcaa7416ef9c
parent f26bcb19
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -188,9 +188,9 @@ public class RecentsAnimationWrapper {
        return true;
    }

    public void setCancelWithDeferredScreenshot(boolean deferredWithScreenshot) {
    public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
        if (targetSet != null) {
            targetSet.controller.setCancelWithDeferredScreenshot(deferredWithScreenshot);
            targetSet.controller.setDeferCancelUntilNextTransition(defer, screenshot);
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_H
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_ASSISTANT;
@@ -569,6 +570,7 @@ public class TouchInteractionService extends Service implements
    private boolean validSystemUiFlags() {
        return (mSystemUiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) == 0
                && (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0
                && (mSystemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) == 0
                && ((mSystemUiStateFlags & SYSUI_STATE_HOME_DISABLED) == 0
                        || (mSystemUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0);
    }
+2 −1
Original line number Diff line number Diff line
@@ -1186,7 +1186,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
    private void setupLauncherUiAfterSwipeUpToRecentsAnimation() {
        endLauncherTransitionController();
        mActivityControlHelper.onSwipeUpToRecentsComplete(mActivity);
        mRecentsAnimationWrapper.setCancelWithDeferredScreenshot(true);
        mRecentsAnimationWrapper.setDeferCancelUntilNextTransition(true /* defer */,
                true /* screenshot */);
        mRecentsView.onSwipeUpAnimationSuccess();

        RecentsModel.INSTANCE.get(mContext).onOverviewShown(false, TAG);
+3 −1
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import com.android.quickstep.fallback.FallbackRecentsView;
import com.android.quickstep.util.ObjectWrapper;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.SwipeAnimationTargetSet;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -335,7 +336,8 @@ public class FallbackNoButtonInputConsumer extends

                ThumbnailData thumbnail =
                        mRecentsAnimationWrapper.targetSet.controller.screenshotTask(mRunningTaskId);
                mRecentsAnimationWrapper.setCancelWithDeferredScreenshot(true);
                mRecentsAnimationWrapper.setDeferCancelUntilNextTransition(true /* defer */,
                        false /* screenshot */);

                ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0);
                ActivityOptionsCompat.setFreezeRecentTasksList(options);