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

Commit 51a6c921 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Migrate from using taskIDs to taskViewIDs in RecentsView

* Follow up CL coming to introduce a TaskView that
can have multiple Tasks, so a taskID won't be particularly useful
in that scenario.

Bug: 192292305
Test: Manual, w/ and w/o live tile
Change-Id: I1900b999ac51aa99923239f2af400c90c71c3dae
parent 20957316
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public final class LauncherActivityInterface extends
                launcher != null && launcher.getStateManager().getState().overviewUi
                        ? launcher.getOverviewPanel() : null;
        if (recentsView == null || (!launcher.hasBeenResumed()
                && recentsView.getRunningTaskId() == -1)) {
                && recentsView.getRunningTaskViewId() == -1)) {
            // If live tile has ended, return null.
            return null;
        }
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public final class TaskViewUtils {

        // If the opening task id is not currently visible in overview, then fall back to normal app
        // icon launch animation
        TaskView taskView = recentsView.getTaskView(openingTaskId);
        TaskView taskView = recentsView.getTaskViewByTaskId(openingTaskId);
        if (taskView == null || !recentsView.isTaskViewVisible(taskView)) {
            return null;
        }
+8 −6
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
            TaskViewSimulator taskViewSimulator) {
        super.onPrepareGestureEndAnimation(animatorSet, endTarget, taskViewSimulator);
        if (mHomeTaskInfo != null && endTarget == RECENTS && animatorSet != null) {
            TaskView tv = getTaskView(mHomeTaskInfo.taskId);
            TaskView tv = getTaskViewByTaskId(mHomeTaskInfo.taskId);
            if (tv != null) {
                PendingAnimation pa = createTaskDismissAnimation(tv, true, false, 150,
                        false /* dismissingForSplitSelection*/);
@@ -117,8 +117,9 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
    }

    @Override
    public void setCurrentTask(int runningTaskId) {
        super.setCurrentTask(runningTaskId);
    public void setCurrentTask(int runningTaskViewId) {
        super.setCurrentTask(runningTaskViewId);
        int runningTaskId = getTaskIdsForRunningTaskView()[0];
        if (mHomeTaskInfo != null && mHomeTaskInfo.taskId != runningTaskId) {
            mHomeTaskInfo = null;
            setRunningTaskHidden(false);
@@ -128,7 +129,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
    @Nullable
    @Override
    protected TaskView getHomeTaskView() {
        return mHomeTaskInfo != null ? getTaskView(mHomeTaskInfo.taskId) : null;
        return mHomeTaskInfo != null ? getTaskViewByTaskId(mHomeTaskInfo.taskId) : null;
    }

    @Override
@@ -148,11 +149,12 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
        // When quick-switching on 3p-launcher, we add a "stub" tile corresponding to Launcher
        // as well. This tile is never shown as we have setCurrentTaskHidden, but allows use to
        // track the index of the next task appropriately, as if we are switching on any other app.
        if (mHomeTaskInfo != null && mHomeTaskInfo.taskId == mRunningTaskId && !tasks.isEmpty()) {
        int runningTaskId = getTaskIdsForRunningTaskView()[0];
        if (mHomeTaskInfo != null && mHomeTaskInfo.taskId == runningTaskId && !tasks.isEmpty()) {
            // Check if the task list has running task
            boolean found = false;
            for (Task t : tasks) {
                if (t.key.id == mRunningTaskId) {
                if (t.key.id == runningTaskId) {
                    found = true;
                    break;
                }
+151 −63

File changed.

Preview size limit exceeded, changes collapsed.

+20 −3

File changed.

Preview size limit exceeded, changes collapsed.

Loading