From 5713bf2ef0c5d283660bc7861f6d1709fda1bc9b Mon Sep 17 00:00:00 2001 From: Jordan Silva Date: Thu, 17 Apr 2025 10:42:30 +0100 Subject: [PATCH] Remove feature flag for OverviewCommandHelper timeout Fix: 409608875 Flag: EXEMPT Flag removal. Test: OverviewCommandHelperTest.kt Change-Id: I094eed94620665b8b089716b2cfe15773243e573 --- aconfig/launcher_overview.aconfig | 10 ----- .../quickstep/OverviewCommandHelper.kt | 37 +++++-------------- .../quickstep/OverviewCommandHelperTest.kt | 8 ---- 3 files changed, 10 insertions(+), 45 deletions(-) diff --git a/aconfig/launcher_overview.aconfig b/aconfig/launcher_overview.aconfig index 6de551bea3..4c01415cf0 100644 --- a/aconfig/launcher_overview.aconfig +++ b/aconfig/launcher_overview.aconfig @@ -29,16 +29,6 @@ flag { bug: "357860832" } -flag { - name: "enable_overview_command_helper_timeout" - namespace: "launcher_overview" - description: "Enables OverviewCommandHelper new version with a timeout to prevent the queue to be unresponsive." - bug: "351122926" - metadata { - purpose: PURPOSE_BUGFIX - } -} - flag { name: "enable_desktop_exploded_view" namespace: "launcher_overview" diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt b/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt index 8034c2e5b6..370a9a1c6d 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.kt @@ -34,7 +34,6 @@ import com.android.app.tracing.traceSection import com.android.internal.jank.Cuj import com.android.launcher3.DeviceProfile import com.android.launcher3.Flags.enableLargeDesktopWindowingTile -import com.android.launcher3.Flags.enableOverviewCommandHelperTimeout import com.android.launcher3.PagedView import com.android.launcher3.logger.LauncherAtom import com.android.launcher3.logging.StatsLogManager @@ -43,7 +42,6 @@ import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVER import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_SHORTCUT import com.android.launcher3.taskbar.TaskbarManager import com.android.launcher3.taskbar.TaskbarUIController -import com.android.launcher3.util.Executors import com.android.launcher3.util.RunnableList import com.android.launcher3.util.coroutines.DispatcherProvider import com.android.launcher3.util.coroutines.ProductionDispatchers @@ -61,15 +59,15 @@ import com.android.quickstep.views.RecentsView import com.android.quickstep.views.TaskView import com.android.systemui.shared.recents.model.ThumbnailData import com.android.systemui.shared.system.InteractionJankMonitorWrapper -import java.io.PrintWriter -import java.util.concurrent.ConcurrentLinkedDeque -import kotlin.coroutines.resume import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.ensureActive import kotlinx.coroutines.launch import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.withTimeout +import java.io.PrintWriter +import java.util.concurrent.ConcurrentLinkedDeque +import kotlin.coroutines.resume /** Helper class to handle various atomic commands for switching between Overview. */ class OverviewCommandHelper @@ -125,11 +123,7 @@ constructor( if (commandQueue.size == 1) { Log.d(TAG, "execute: $command - queue size: ${commandQueue.size}") - if (enableOverviewCommandHelperTimeout()) { - coroutineScope.launch(dispatcherProvider.main) { processNextCommand() } - } else { - Executors.MAIN_EXECUTOR.execute { processNextCommand() } - } + coroutineScope.launch(dispatcherProvider.main) { processNextCommand() } } else { Log.d(TAG, "not executed: $command - queue size: ${commandQueue.size}") } @@ -188,25 +182,14 @@ constructor( command.status = CommandStatus.PROCESSING Log.d(TAG, "executing command: $command") - if (enableOverviewCommandHelperTimeout()) { - coroutineScope.launch(dispatcherProvider.main) { - traceSection("OverviewCommandHelper.executeCommandWithTimeout") { - withTimeout(QUEUE_WAIT_DURATION_IN_MS) { - executeCommandSuspended(command) - ensureActive() - onCommandFinished(command) - } + coroutineScope.launch(dispatcherProvider.main) { + traceSection("OverviewCommandHelper.executeCommandWithTimeout") { + withTimeout(QUEUE_WAIT_DURATION_IN_MS) { + executeCommandSuspended(command) + ensureActive() + onCommandFinished(command) } } - } else { - val result = - executeCommand(command, onCallbackResult = { onCommandFinished(command) }) - Log.d(TAG, "command executed: $command with result: $result") - if (result) { - onCommandFinished(command) - } else { - Log.d(TAG, "waiting for command callback: $command") - } } } diff --git a/quickstep/tests/multivalentTests/src/com/android/quickstep/OverviewCommandHelperTest.kt b/quickstep/tests/multivalentTests/src/com/android/quickstep/OverviewCommandHelperTest.kt index 7e73d47605..35ab3d7865 100644 --- a/quickstep/tests/multivalentTests/src/com/android/quickstep/OverviewCommandHelperTest.kt +++ b/quickstep/tests/multivalentTests/src/com/android/quickstep/OverviewCommandHelperTest.kt @@ -16,18 +16,15 @@ package com.android.quickstep -import android.platform.test.flag.junit.SetFlagsRule import android.view.Display.DEFAULT_DISPLAY import androidx.test.filters.SmallTest import com.android.app.displaylib.DisplayRepository -import com.android.launcher3.Flags import com.android.launcher3.LauncherState import com.android.launcher3.statemanager.StateManager import com.android.launcher3.statemanager.StatefulActivity import com.android.launcher3.uioverrides.QuickstepLauncher import com.android.launcher3.util.LauncherMultivalentJUnit import com.android.launcher3.util.TestDispatcherProvider -import com.android.launcher3.util.rule.setFlags import com.android.quickstep.OverviewCommandHelper.CommandInfo import com.android.quickstep.OverviewCommandHelper.CommandInfo.CommandStatus import com.android.quickstep.OverviewCommandHelper.CommandType @@ -45,7 +42,6 @@ import kotlinx.coroutines.test.advanceTimeBy import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before -import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.doAnswer @@ -59,8 +55,6 @@ import org.mockito.kotlin.whenever @RunWith(LauncherMultivalentJUnit::class) @OptIn(ExperimentalCoroutinesApi::class) class OverviewCommandHelperTest { - @get:Rule val setFlagsRule: SetFlagsRule = SetFlagsRule() - private lateinit var sut: OverviewCommandHelper private val dispatcher = StandardTestDispatcher() private val testScope = TestScope(dispatcher) @@ -86,8 +80,6 @@ class OverviewCommandHelperTest { @Suppress("UNCHECKED_CAST") @Before fun setup() { - setFlagsRule.setFlags(true, Flags.FLAG_ENABLE_OVERVIEW_COMMAND_HELPER_TIMEOUT) - setupDefaultDisplay() val overviewComponentObserver = mock()