Remove unnecessary call to RecentsView.reset when switching from any non-overview state.

We were checking whether recents is visible or not while opening all
apps and calling RecentsView#reset. Since Recents is not visible, we
were always calling reset which was making additional blur. Adding check
here of what current state is, will reduce these calls.

Added perfetto traces comparison here

https://drive.google.com/drive/folders/146K_4WLaOGQcZ1gsuhCFlOCzfZ-mJBw8?resourcekey=0-r1-NnNtYGH88d8DGEvnXZg&usp=sharing

Bug: 404647629
Test: Manual. Launcher home -> all apps.
Flag: EXEMPT bugfix
Change-Id: If0e31638adee50d36974abd7a4c809e3747f37a0
This commit is contained in:
vinayjoglekar
2025-03-22 10:52:38 +05:30
committed by Vinay Joglekar
parent 88b2f23a83
commit 162a85e777
4 changed files with 5 additions and 4 deletions
@@ -210,7 +210,7 @@ class RecentsViewStateController(private val launcher: QuickstepLauncher) :
)
builder.addEndListener { success: Boolean ->
if (!success && !toState.isRecentsViewVisible) {
if (!success && fromState.isRecentsViewVisible && !toState.isRecentsViewVisible) {
recentsView.reset()
}
}
@@ -87,7 +87,8 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
// While animating into recents, update the visible task data as needed
setter.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
setter.addEndListener(success -> {
if (!success && !toState.isRecentsViewVisible()) {
if (!success && mRecentsViewContainer.isRecentsViewVisible()
&& !toState.isRecentsViewVisible()) {
mRecentsView.reset();
}
});
@@ -287,7 +287,7 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
setOverviewGridEnabled(false);
}
}
if (!finalState.isRecentsViewVisible()) {
if (mContainer.isRecentsViewVisible() && !finalState.isRecentsViewVisible()) {
// Clean-up logic that occurs when recents is no longer in use/visible.
reset();
}
@@ -184,7 +184,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
}
}
if (!finalState.isRecentsViewVisible) {
if (mContainer.isRecentsViewVisible() && !finalState.isRecentsViewVisible) {
// Clean-up logic that occurs when recents is no longer in use/visible.
reset();
}