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

Commit 921da74c authored by Tony's avatar Tony
Browse files

Continue using window's sysui flags if task thumbnail unavailable

If the centermost task is null or doesn't yet have thumbnail data,
don't use its sysui flags - continue using the window we're swiping
from instead.

Bug: 132898688
Change-Id: I202937d8aa01ee24ef01693d9594c4929e6bd314
parent 3c7f4811
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -706,12 +706,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>

    private void updateSysUiFlags(float windowProgress) {
        if (mRecentsView != null) {
            TaskView centermostTask = mRecentsView.getTaskViewAt(mRecentsView
                    .getPageNearestToCenterOfScreen());
            int centermostTaskFlags = centermostTask == null ? 0
                    : centermostTask.getThumbnail().getSysUiStatusNavFlags();
            boolean useHomeScreenFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
            // We will handle the sysui flags based on the centermost task view.
            mRecentsAnimationWrapper.setWindowThresholdCrossed(true);
            int sysuiFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD
                    ? 0
                    : mRecentsView.getTaskViewAt(mRecentsView.getPageNearestToCenterOfScreen())
                            .getThumbnail().getSysUiStatusNavFlags();
            mRecentsAnimationWrapper.setWindowThresholdCrossed(centermostTaskFlags != 0
                    || useHomeScreenFlags);
            int sysuiFlags = useHomeScreenFlags ? 0 : centermostTaskFlags;
            mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, sysuiFlags);
        }
    }