From 912a53e677cd158e7fe3bd7351c96e4360e4c2af Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Tue, 15 Nov 2022 12:12:17 -0800 Subject: [PATCH] Fix null-pointer exception in all set activity first reveal animation Fixes: 259296310 Test: started all set activity and started the first reveal animation Change-Id: I371f62be81e7f28ce5ecee150abb5d294bb2264d --- .../android/launcher3/taskbar/TaskbarActivityContext.java | 5 +++-- quickstep/src/com/android/launcher3/taskbar/TaskbarView.java | 1 + .../com/android/launcher3/taskbar/TaskbarViewController.java | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 3c9e96f295..79b8c60ef8 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -920,12 +920,13 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } mControllers.taskbarStashController.addUnstashToHotseatAnimation(fullAnimation, duration); - if (!FeatureFlags.ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT.get()) { + View allAppsButton = mControllers.taskbarViewController.getAllAppsButtonView(); + if (allAppsButton != null && !FeatureFlags.ENABLE_ALL_APPS_BUTTON_IN_HOTSEAT.get()) { ValueAnimator alphaOverride = ValueAnimator.ofFloat(0, 1); alphaOverride.setDuration(duration); alphaOverride.addUpdateListener(a -> { // Override the alpha updates in the icon alignment animation. - mControllers.taskbarViewController.getAllAppsButtonView().setAlpha(0); + allAppsButton.setAlpha(0); }); fullAnimation.play(alphaOverride); } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index fe38bb1275..c4eeca7beb 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -422,6 +422,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar /** * Returns the all apps button in the taskbar. */ + @Nullable public View getAllAppsButtonView() { return mAllAppsButton; } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 80a31b4b44..9936d27951 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -240,6 +240,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar return mTaskbarView.getIconViews(); } + @Nullable public View getAllAppsButtonView() { return mTaskbarView.getAllAppsButtonView(); }