Simplify getTaskViewAt call am: 9d6fb64f45

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16249427

Change-Id: If52c26a38fab17d294b08a34a3e41fd5f88cef27
This commit is contained in:
Fedor Kudasov
2021-11-15 20:50:06 +00:00
committed by Automerger Merge Worker
@@ -117,11 +117,12 @@ public class OverviewCommandHelper {
mPendingCommands.clear();
}
@Nullable
private TaskView getNextTask(RecentsView view) {
final TaskView runningTaskView = view.getRunningTaskView();
if (runningTaskView == null) {
return view.getTaskViewCount() > 0 ? view.getTaskViewAt(0) : null;
return view.getTaskViewAt(0);
} else {
final TaskView nextTask = view.getNextTaskView();
return nextTask != null ? nextTask : runningTaskView;
@@ -256,8 +257,8 @@ public class OverviewCommandHelper {
// Ensure that recents view has focus so that it receives the followup key inputs
TaskView taskView = rv.getNextTaskView();
if (taskView == null) {
if (rv.getTaskViewCount() > 0) {
taskView = rv.getTaskViewAt(0);
taskView = rv.getTaskViewAt(0);
if (taskView != null) {
taskView.requestFocus();
} else {
rv.requestFocus();