diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 961dc58eb1..15038a43ee 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -50,7 +50,6 @@ import com.android.launcher3.tapl.Workspace; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; -import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import com.android.launcher3.util.rule.TestStabilityRule; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; @@ -584,19 +583,14 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { public void testExcludeFromRecents() throws Exception { startExcludeFromRecentsTestActivity(); OverviewTask currentTask = getAndAssertLaunchedApp().switchToOverview().getCurrentTask(); - // TODO(b/342627272): the expected content description shouldn't be null but for now there - // is a bug that causes it to sometimes be for excludeForRecents tasks. assertTrue("Can't find ExcludeFromRecentsTestActivity after entering Overview from it", - currentTask.containsContentDescription("ExcludeFromRecents") - || currentTask.containsContentDescription(null)); + currentTask.containsContentDescription("ExcludeFromRecents")); // Going home should clear out the excludeFromRecents task. BaseOverview overview = mLauncher.goHome().switchToOverview(); if (overview.hasTasks()) { currentTask = overview.getCurrentTask(); assertFalse("Found ExcludeFromRecentsTestActivity after entering Overview from Home", - currentTask.containsContentDescription( - "ExcludeFromRecents") - || currentTask.containsContentDescription(null)); + currentTask.containsContentDescription("ExcludeFromRecents")); } else { // Presumably the test started with 0 tasks and remains that way after going home. } diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java index 8512d73193..70bfb606c1 100644 --- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java +++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java @@ -24,7 +24,6 @@ import static com.android.launcher3.tapl.OverviewTask.OverviewTaskContainer.SPLI import android.graphics.Rect; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.test.uiautomator.By; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.UiObject2; @@ -281,10 +280,8 @@ public final class OverviewTask { /** * Returns whether the given String is contained in this Task's contentDescription. Also returns * true if both Strings are null. - * - * TODO(b/342627272): remove Nullable support once the bug causing it to be null is fixed. */ - public boolean containsContentDescription(@Nullable String expected, + public boolean containsContentDescription(String expected, OverviewTaskContainer overviewTaskContainer) { String actual = findObjectInTask(overviewTaskContainer.snapshotRes).getContentDescription(); if (actual == null && expected == null) { @@ -300,7 +297,7 @@ public final class OverviewTask { * Returns whether the given String is contained in this Task's contentDescription. Also returns * true if both Strings are null */ - public boolean containsContentDescription(@Nullable String expected) { + public boolean containsContentDescription(String expected) { return containsContentDescription(expected, DEFAULT); }