Merge "Fix potential NPE in BackgroundAppState" into ub-launcher3-qt-dev

am: 6129e4737c

Change-Id: Ifb7aeb3ba9b3cf31b8d3b7d05553e11e88c1d16e
This commit is contained in:
Tony Wickham
2019-06-11 12:44:11 -07:00
committed by android-build-merger
@@ -64,10 +64,12 @@ public class BackgroundAppState extends OverviewState {
public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) {
// Initialize the recents view scale to what it would be when starting swipe up
RecentsView recentsView = launcher.getOverviewPanel();
if (recentsView.getTaskViewCount() == 0) {
int taskCount = recentsView.getTaskViewCount();
if (taskCount == 0) {
return super.getOverviewScaleAndTranslation(launcher);
}
TaskView dummyTask = recentsView.getTaskViewAt(recentsView.getCurrentPage());
TaskView dummyTask = recentsView.getTaskViewAt(Math.max(taskCount - 1,
recentsView.getCurrentPage()));
return recentsView.getTempClipAnimationHelper().updateForFullscreenOverview(dummyTask)
.getScaleAndTranslation();
}