Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09623dd5 authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Fix talkback in split mode" into main

parents 32f22de9 3359fa7f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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",
    ],
}
+7 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ class DigitalWellBeingToast(

    private fun setNoLimit() {
        hasLimit = false
        taskView.contentDescription = task.titleDescription
        setContentDescription(appUsageLimitTimeMs = -1, appRemainingTimeMs = -1)
        replaceBanner(null)
        appRemainingTimeMs = -1
    }
@@ -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) {
+14 −0
Original line number Diff line number Diff line
@@ -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)
        }
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -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
+6 −30
Original line number Diff line number Diff line
@@ -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;

@@ -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