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

Commit 04309940 authored by Alex Chau's avatar Alex Chau
Browse files

If hometask is last task to be dismissed, show empty recents instead of home screen

- http://ag/16221737 ensure homescren stub is always added if tasks hasn't been loaded in RecentsView. This introduced an edge case that after dismissing home task view, no task remains in overview and it get dismissed
- The fix is to show empty recents instead of home screen if last task dismissed is a home task (showing empty recents isn't always correct, as there might be unloaded tasks, but it's better than dismissing overview)
- Also tuned the timing of when mLoadPlanEverApplied is set

Fix: 206462357
Test: FallbackRecentsTest.goToOverviewFromHome
Change-Id: I0f395639f57a1a57fddf750623a8a74b8ede8555
parent d8a1b5c3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1335,6 +1335,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            return;
        }

        mLoadPlanEverApplied = true;
        if (taskGroups == null || taskGroups.isEmpty()) {
            removeTasksViewsAndClearAllButton();
            onTaskStackUpdated();
@@ -1437,7 +1438,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        resetTaskVisuals();
        onTaskStackUpdated();
        updateEnabledOverlays();
        mLoadPlanEverApplied = true;
    }

    private boolean isModal() {
@@ -3115,12 +3115,17 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                    } else if (dismissedIndex < pageToSnapTo || pageToSnapTo == taskCount - 1) {
                        pageToSnapTo--;
                    }
                    boolean isHomeTaskDismissed = dismissedTaskView == getHomeTaskView();
                    removeViewInLayout(dismissedTaskView);
                    mTopRowIdSet.remove(dismissedTaskViewId);

                    if (taskCount == 1) {
                        removeViewInLayout(mClearAllButton);
                        if (isHomeTaskDismissed) {
                            updateEmptyMessage();
                        } else {
                            startHome();
                        }
                    } else {
                        // Update focus task and its size.
                        if (finalIsFocusedTaskDismissed) {