From 253c23b2e82ee8d0b9412e1b80d13d5f0d5ea542 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Fri, 1 Apr 2022 22:28:39 +0000 Subject: [PATCH] Close open folders when pausing launcher. Previously, folders wouldn't close after launching an app and quickly navigating back the launcher. This is because the onStop state which contains a call to AbstractFloatingView.closeViews() wasn't being called. This change adds an additional call to specifically close any open folders when the Launcher enters a paused state. Bug: 227142635 Test: Verified that the issue is fixed after code change. I logged the Launcher's lifecycle state to ensure my manual testing was reliable. Change-Id: I838f992f83afdd754672ebbe85d0eb2a7e894417 --- src/com/android/launcher3/Launcher.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 1cead11cbf..a2c68048de 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1183,6 +1183,7 @@ public class Launcher extends StatefulActivity implements Launche mOverlayManager.onActivityResumed(this); } + AbstractFloatingView.closeOpenViews(this, false, TYPE_ALL & ~TYPE_REBIND_SAFE); TraceHelper.INSTANCE.endSection(traceToken); } @@ -1686,9 +1687,6 @@ public class Launcher extends StatefulActivity implements Launche outState.remove(RUNTIME_STATE_WIDGET_PANEL); } - // We close any open folders and shortcut containers that are not safe for rebind, - // and we need to make sure this state is reflected. - AbstractFloatingView.closeOpenViews(this, false, TYPE_ALL & ~TYPE_REBIND_SAFE); finishAutoCancelActionMode(); if (mPendingRequestArgs != null) {