Fix broken uses of TISBinder.refreshOverviewTarget

TaskbarManager.setActivity doesn't get called again when TISBinder.refreshOverviewTarget is called because TIS isn't re-connecting to launcher. TISBinder.refreshOverviewTarget just forcefully updated the overview target, but TIS was still connected. So, QuickstepLauncher.onTISConnected wouldn't run again to call TaskbarMAnager.setActivity(this). Calling it manually to fix failing TaplTestsNexus tests with recents in window flags enabled

Flag: com.android.launcher3.enable_launcher_overview_in_window
Flag: com.android.launcher3.enable_fallback_overview_in_window
Flag: com.android.launcher3.enable_overview_on_connected_displays
Bug: 377678992
Test: TaplTestsNexus.testDismissWithKeyboardShortcut and TaplTestsNexus.testSearchWithKeyboardShortcut
Change-Id: Ib386c3b8cfc5a9167f7f219dba0cccec344446b6
This commit is contained in:
Schneider Victor-Tulias
2025-03-26 15:57:09 -04:00
parent 924c181fcd
commit cdf20df7f6
2 changed files with 11 additions and 2 deletions
@@ -174,7 +174,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
return response;
case TestProtocol.REQUEST_REFRESH_OVERVIEW_TARGET:
runOnTISBinder(TouchInteractionService.TISBinder::refreshOverviewTarget);
runOnTISBinder(TouchInteractionService.TISBinder::refreshOverviewTargetForTest);
return response;
case TestProtocol.REQUEST_RECREATE_TASKBAR:
@@ -73,6 +73,7 @@ import com.android.app.displaylib.PerDisplayRepository;
import com.android.launcher3.ConstantItem;
import com.android.launcher3.EncryptionType;
import com.android.launcher3.Flags;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.desktop.DesktopAppLaunchTransitionManager;
@@ -96,6 +97,7 @@ import com.android.launcher3.util.TraceHelper;
import com.android.quickstep.OverviewCommandHelper.CommandType;
import com.android.quickstep.OverviewComponentObserver.OverviewChangeListener;
import com.android.quickstep.fallback.window.RecentsDisplayModel;
import com.android.quickstep.fallback.window.RecentsWindowFlags;
import com.android.quickstep.fallback.window.RecentsWindowSwipeHandler;
import com.android.quickstep.inputconsumers.BubbleBarInputConsumer;
import com.android.quickstep.inputconsumers.OneHandedModeInputConsumer;
@@ -537,10 +539,17 @@ public class TouchInteractionService extends Service {
}
/** Refreshes the current overview target. */
public void refreshOverviewTarget() {
@VisibleForTesting
public void refreshOverviewTargetForTest() {
executeForTouchInteractionService(tis -> {
tis.mAllAppsActionManager.onDestroy();
tis.onOverviewTargetChanged(tis.mOverviewComponentObserver.isHomeAndOverviewSame());
if (RecentsWindowFlags.getEnableOverviewInWindow()) {
Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedContext();
if (launcher != null) {
tis.mTaskbarManager.setActivity(launcher);
}
}
});
}
}