Add a contentDescription to splitscreen's first staged task

Currently, when we stage the first app in a split, the floatingTaskView has no contentDescription and is announced by screen readers as "unlabeled".

This CL allows FloatingTaskView to copy a contentDescription from the underlying task or ItemInfo when it is created.

Also changes SplitConfigurationOptions#itemInfo to a private field with a public getter for mockito compatibility.

Fixes: 319783133
Test: Confirmed with TalkBack on Overview, contextual and Intent splits
Flag: EXEMPT bugfix
Change-Id: Ia5a95e403bfe8623e17d2ceac9073ef15c7bb476
This commit is contained in:
Jeremy Sim
2024-08-13 16:50:15 -07:00
parent 9df623644a
commit 2e59268f3b
6 changed files with 24 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ import android.view.View
import android.window.TransitionInfo
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.launcher3.apppairs.AppPairIcon
import com.android.launcher3.model.data.ItemInfo
import com.android.launcher3.statehandlers.DepthController
import com.android.launcher3.statemanager.StateManager
import com.android.launcher3.taskbar.TaskbarActivityContext
@@ -76,6 +77,7 @@ class SplitAnimationControllerTest {
private val splitSelectSource: SplitConfigurationOptions.SplitSelectSource = mock()
private val mockSplitSourceDrawable: Drawable = mock()
private val mockSplitSourceView: View = mock()
private val mockItemInfo: ItemInfo = mock()
private val stateManager: StateManager<*, *> = mock()
private val depthController: DepthController = mock()
@@ -89,11 +91,13 @@ class SplitAnimationControllerTest {
whenever(mockTaskContainer.snapshotView).thenReturn(mockSnapshotView)
whenever(mockTaskContainer.splitAnimationThumbnail).thenReturn(mockBitmap)
whenever(mockTaskContainer.iconView).thenReturn(mockIconView)
whenever(mockTaskContainer.task).thenReturn(mockTask)
whenever(mockIconView.drawable).thenReturn(mockTaskViewDrawable)
whenever(mockTaskView.taskContainers).thenReturn(List(1) { mockTaskContainer })
whenever(splitSelectSource.drawable).thenReturn(mockSplitSourceDrawable)
whenever(splitSelectSource.view).thenReturn(mockSplitSourceView)
whenever(splitSelectSource.itemInfo).thenReturn(mockItemInfo)
splitAnimationController = SplitAnimationController(mockSplitSelectStateController)
}