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

Commit 5dab6943 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "If the rootTaskIdsToRestore is empty..." into main

parents 5b437f69 747ece1e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1948,7 +1948,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        final IntArray rootTaskIdsToRestore = mUserVisibleRootTasks.get(userId);
        boolean homeInFront = false;
        if (Flags.enableTopVisibleRootTaskPerUserTracking()) {
            if (rootTaskIdsToRestore == null) {
            if (rootTaskIdsToRestore == null || rootTaskIdsToRestore.size() == 0) {
                // If there are no root tasks saved, try restore id 0 which should create and launch
                // the home task.
                handleRootTaskLaunchOnUserSwitch(/* restoreRootTaskId */INVALID_TASK_ID);
@@ -1958,12 +1958,9 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                    handleRootTaskLaunchOnUserSwitch(rootTaskIdsToRestore.get(i));
                }
                // Check if the top task is type home
                if (rootTaskIdsToRestore.size() > 0) {
                    final int topRootTaskId = rootTaskIdsToRestore.get(
                            rootTaskIdsToRestore.size() - 1);
                final int topRootTaskId = rootTaskIdsToRestore.get(rootTaskIdsToRestore.size() - 1);
                homeInFront = isHomeTask(topRootTaskId);
            }
            }
        } else {
            handleRootTaskLaunchOnUserSwitch(restoreRootTaskId);
            // Check if the top task is type home