diff options
author | Tony Wickham <twickham@google.com> | 2019-06-11 12:44:11 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-11 12:44:11 -0700 |
commit | afff47d4a57490f6e271578abc1c0b3c07815438 (patch) | |
tree | 63d26fbdf5cdacbfef7d1cd9ed94622142def261 /quickstep/recents_ui_overrides/src | |
parent | 615d893cb7fd4ecea86c707de7b2ecfc3ea1dbd4 (diff) | |
parent | 6129e4737cce1590f81393f384ec66efb6a220f8 (diff) | |
download | android_packages_apps_Trebuchet-afff47d4a57490f6e271578abc1c0b3c07815438.tar.gz android_packages_apps_Trebuchet-afff47d4a57490f6e271578abc1c0b3c07815438.tar.bz2 android_packages_apps_Trebuchet-afff47d4a57490f6e271578abc1c0b3c07815438.zip |
Merge "Fix potential NPE in BackgroundAppState" into ub-launcher3-qt-dev
am: 6129e4737c
Change-Id: Ifb7aeb3ba9b3cf31b8d3b7d05553e11e88c1d16e
Diffstat (limited to 'quickstep/recents_ui_overrides/src')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index f1d6450a5..1c6696858 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -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(); } |