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

Commit 3f045e24 authored by sai.gairuboina-IN009276's avatar sai.gairuboina-IN009276
Browse files

Crash during Task switch

Problem: {
            1.Open realmelink app->pair a device
            2.add this app to google device controls
            3.Click on the paired device multiple times and observe crash
}

Solution: {
    1. Timing of methods in removeTask->resetTaskInfo->shellExecutor order is causing the crash
    2. Cache the taskToken and use it in lamda to fix NPE and make sure task is removed from recents history
}

Bug: 388747629

https: //partnerissuetracker.corp.google.com/u/1/issues/388747629
Change-Id: I47a38a6a41ba4095c8d3bacf242e91230381454b
parent 4109b479
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -529,9 +529,12 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
            Slog.w(TAG, "Trying to remove a task that was never added? (no taskToken)");
            return;
        }
        // Cache it to avoid NPE and make sure to remove it from recents history.
        // mTaskToken can be cleared in onTaskVanished() when the task is removed.
        final WindowContainerToken taskToken = mTaskToken;
        mShellExecutor.execute(() -> {
            WindowContainerTransaction wct = new WindowContainerTransaction();
            wct.removeTask(mTaskToken);
            wct.removeTask(taskToken);
            mTaskViewTransitions.closeTaskView(wct, this);
        });
    }