Fix SystemNav and Taskbar related Memory Leaks

Test: Presubmit
Bug: 398908322
Bug: 399884290
Flag: EXEMPT bugfix
Change-Id: Idf1ed3ff154e64de523b477aa34b67cbcd3cf8b4
This commit is contained in:
Jagrut Desai committed 2025-03-03 09:29:39 -08:00
1 parent 12934bc891
commit 39dd498074
2 files changed
+13 -3

No files matched your search

@@ -191,6 +191,8 @@ public class TaskbarLauncherStateController {
private boolean mIsQsbInline;
private RecentsAnimationCallbacks mRecentsAnimationCallbacks;
private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener =
new DeviceProfile.OnDeviceProfileChangeListener() {
@Override
@@ -295,6 +297,11 @@ public class TaskbarLauncherStateController {
mIsDestroyed = true;
mCanSyncViews = false;
if (mRecentsAnimationCallbacks != null) {
mRecentsAnimationCallbacks.removeListener(mTaskBarRecentsAnimationListener);
mRecentsAnimationCallbacks = null;
}
mIconAlignment.finishAnimation();
mLauncher.getHotseat().setIconsAlpha(1f, ALPHA_CHANNEL_TASKBAR_ALIGNMENT);
@@ -315,6 +322,7 @@ public class TaskbarLauncherStateController {
// If going to overview, stash the task bar
// If going home, align the icons to hotseat
AnimatorSet animatorSet = new AnimatorSet();
mRecentsAnimationCallbacks = callbacks;
// Update stashed flags first to ensure goingToUnstashedLauncherState() returns correctly.
TaskbarStashController stashController = mControllers.taskbarStashController;