Loading quickstep/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ filegroup { "tests/src/com/android/quickstep/TaplOverviewIconTest.java", "tests/src/com/android/quickstep/TaplTestsQuickstep.java", "tests/src/com/android/quickstep/TaplTestsSplitscreen.java", "tests/src/com/android/quickstep/util/SplitScreenTestUtils.kt", "tests/src/com/android/launcher3/testcomponent/ExcludeFromRecentsTestActivity.java", ], } Loading quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.kt +7 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class DigitalWellBeingToast( private fun setNoLimit() { hasLimit = false taskView.contentDescription = task.titleDescription setContentDescription(appUsageLimitTimeMs = -1, appRemainingTimeMs = -1) replaceBanner(null) appRemainingTimeMs = -1 } Loading @@ -110,9 +110,14 @@ class DigitalWellBeingToast( setOnClickListener(::openAppUsageSettings) } replaceBanner(toast) setContentDescription(appUsageLimitTimeMs, appRemainingTimeMs) } taskView.contentDescription = private fun setContentDescription(appUsageLimitTimeMs: Long, appRemainingTimeMs: Long) { val taskContainer: TaskContainer = taskView.getTaskContainerById(task.key.id) ?: return val contentDescription = getContentDescriptionForTask(task, appUsageLimitTimeMs, appRemainingTimeMs) taskContainer.snapshotView.contentDescription = contentDescription } fun initialize(task: Task) { Loading quickstep/src/com/android/quickstep/views/TaskContainer.kt +14 −0 Original line number Diff line number Diff line Loading @@ -171,4 +171,18 @@ class TaskContainer( thumbnailViewDeprecated.setOverlayEnabled(enabled) } } fun addChildForAccessibility(outChildren: ArrayList<View>) { addAccessibleChildToList(iconView.asView(), outChildren) addAccessibleChildToList(snapshotView, outChildren) showWindowsView?.let { addAccessibleChildToList(it, outChildren) } } private fun addAccessibleChildToList(view: View, outChildren: ArrayList<View>) { if (view.includeForAccessibility()) { outChildren.add(view) } else { view.addChildrenForAccessibility(outChildren) } } } quickstep/src/com/android/quickstep/views/TaskView.kt +6 −0 Original line number Diff line number Diff line Loading @@ -1662,6 +1662,12 @@ constructor( return thumbnailBounds.contains(x.toInt(), y.toInt()) } override fun addChildrenForAccessibility(outChildren: ArrayList<View>) { (if (isLayoutRtl) taskContainers.reversed() else taskContainers).forEach { it.addChildForAccessibility(outChildren) } } companion object { private const val TAG = "TaskView" const val FLAG_UPDATE_ICON = 1 Loading quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java +6 −30 Original line number Diff line number Diff line Loading @@ -15,20 +15,18 @@ */ package com.android.quickstep; import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL; import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import android.content.Intent; import android.platform.test.annotations.PlatinumTest; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewTask.OverviewSplitTask; import com.android.launcher3.tapl.OverviewTaskMenu; import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.rule.TestStabilityRule; import com.android.quickstep.util.SplitScreenTestUtils; import org.junit.Test; Loading Loading @@ -70,39 +68,17 @@ public class TaplOverviewIconTest extends AbstractLauncherUiTest<QuickstepLaunch @Test public void testSplitTaskTapBothIconMenus() { createAndLaunchASplitPair(); Overview overview = SplitScreenTestUtils.createAndLaunchASplitPairInOverview(mLauncher); OverviewTaskMenu taskMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); OverviewTaskMenu taskMenu = overview.getCurrentTask().tapMenu(); assertTrue("App info item not appearing in expanded task menu.", taskMenu.hasMenuItem("App info")); taskMenu.touchOutsideTaskMenuToDismiss(); OverviewTaskMenu splitMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu( OverviewTaskMenu splitMenu = overview.getCurrentTask().tapMenu( OverviewSplitTask.SPLIT_BOTTOM_OR_RIGHT); assertTrue("App info item not appearing in expanded split task's menu.", splitMenu.hasMenuItem("App info")); splitMenu.touchOutsideTaskMenuToDismiss(); } private void createAndLaunchASplitPair() { clearAllRecentTasks(); startTestActivity(2); startTestActivity(3); if (mLauncher.isTablet() && !mLauncher.isGridOnlyOverviewEnabled()) { mLauncher.goHome().switchToOverview().getOverviewActions() .clickSplit() .getTestActivityTask(2) .open(); } else { mLauncher.goHome().switchToOverview().getCurrentTask() .tapMenu() .tapSplitMenuItem() .getCurrentTask() .open(); } } } No newline at end of file Loading
quickstep/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ filegroup { "tests/src/com/android/quickstep/TaplOverviewIconTest.java", "tests/src/com/android/quickstep/TaplTestsQuickstep.java", "tests/src/com/android/quickstep/TaplTestsSplitscreen.java", "tests/src/com/android/quickstep/util/SplitScreenTestUtils.kt", "tests/src/com/android/launcher3/testcomponent/ExcludeFromRecentsTestActivity.java", ], } Loading
quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.kt +7 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class DigitalWellBeingToast( private fun setNoLimit() { hasLimit = false taskView.contentDescription = task.titleDescription setContentDescription(appUsageLimitTimeMs = -1, appRemainingTimeMs = -1) replaceBanner(null) appRemainingTimeMs = -1 } Loading @@ -110,9 +110,14 @@ class DigitalWellBeingToast( setOnClickListener(::openAppUsageSettings) } replaceBanner(toast) setContentDescription(appUsageLimitTimeMs, appRemainingTimeMs) } taskView.contentDescription = private fun setContentDescription(appUsageLimitTimeMs: Long, appRemainingTimeMs: Long) { val taskContainer: TaskContainer = taskView.getTaskContainerById(task.key.id) ?: return val contentDescription = getContentDescriptionForTask(task, appUsageLimitTimeMs, appRemainingTimeMs) taskContainer.snapshotView.contentDescription = contentDescription } fun initialize(task: Task) { Loading
quickstep/src/com/android/quickstep/views/TaskContainer.kt +14 −0 Original line number Diff line number Diff line Loading @@ -171,4 +171,18 @@ class TaskContainer( thumbnailViewDeprecated.setOverlayEnabled(enabled) } } fun addChildForAccessibility(outChildren: ArrayList<View>) { addAccessibleChildToList(iconView.asView(), outChildren) addAccessibleChildToList(snapshotView, outChildren) showWindowsView?.let { addAccessibleChildToList(it, outChildren) } } private fun addAccessibleChildToList(view: View, outChildren: ArrayList<View>) { if (view.includeForAccessibility()) { outChildren.add(view) } else { view.addChildrenForAccessibility(outChildren) } } }
quickstep/src/com/android/quickstep/views/TaskView.kt +6 −0 Original line number Diff line number Diff line Loading @@ -1662,6 +1662,12 @@ constructor( return thumbnailBounds.contains(x.toInt(), y.toInt()) } override fun addChildrenForAccessibility(outChildren: ArrayList<View>) { (if (isLayoutRtl) taskContainers.reversed() else taskContainers).forEach { it.addChildForAccessibility(outChildren) } } companion object { private const val TAG = "TaskView" const val FLAG_UPDATE_ICON = 1 Loading
quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java +6 −30 Original line number Diff line number Diff line Loading @@ -15,20 +15,18 @@ */ package com.android.quickstep; import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL; import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import android.content.Intent; import android.platform.test.annotations.PlatinumTest; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewTask.OverviewSplitTask; import com.android.launcher3.tapl.OverviewTaskMenu; import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.rule.TestStabilityRule; import com.android.quickstep.util.SplitScreenTestUtils; import org.junit.Test; Loading Loading @@ -70,39 +68,17 @@ public class TaplOverviewIconTest extends AbstractLauncherUiTest<QuickstepLaunch @Test public void testSplitTaskTapBothIconMenus() { createAndLaunchASplitPair(); Overview overview = SplitScreenTestUtils.createAndLaunchASplitPairInOverview(mLauncher); OverviewTaskMenu taskMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); OverviewTaskMenu taskMenu = overview.getCurrentTask().tapMenu(); assertTrue("App info item not appearing in expanded task menu.", taskMenu.hasMenuItem("App info")); taskMenu.touchOutsideTaskMenuToDismiss(); OverviewTaskMenu splitMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu( OverviewTaskMenu splitMenu = overview.getCurrentTask().tapMenu( OverviewSplitTask.SPLIT_BOTTOM_OR_RIGHT); assertTrue("App info item not appearing in expanded split task's menu.", splitMenu.hasMenuItem("App info")); splitMenu.touchOutsideTaskMenuToDismiss(); } private void createAndLaunchASplitPair() { clearAllRecentTasks(); startTestActivity(2); startTestActivity(3); if (mLauncher.isTablet() && !mLauncher.isGridOnlyOverviewEnabled()) { mLauncher.goHome().switchToOverview().getOverviewActions() .clickSplit() .getTestActivityTask(2) .open(); } else { mLauncher.goHome().switchToOverview().getCurrentTask() .tapMenu() .tapSplitMenuItem() .getCurrentTask() .open(); } } } No newline at end of file