Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/data/DesktopRepository.kt +9 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.tracing.Trace import com.android.app.tracing.traceSection import com.android.internal.annotations.VisibleForTesting import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.common.WorkSerializer import com.android.wm.shell.desktopmode.DisplayDeskState import com.android.wm.shell.desktopmode.data.persistence.DesktopPersistentRepository Loading Loading @@ -67,8 +68,14 @@ class DesktopRepository( private val activeTasksListeners = ArraySet<ActiveTasksListener>() private val visibleTasksListeners = ArrayMap<VisibleTasksListener, Executor>() private val persistentUpdateQueue = WorkSerializer(bgCoroutineScope) private val persistentUpdateQueue = WorkSerializer( if (Flags.repositoryBasedPersistenceBgThread()) { bgCoroutineScope } else { mainCoroutineScope } ) /* Tracks corner/caption regions of desktop tasks, used to determine gesture exclusion. */ private val desktopExclusionRegions = SparseArray<Region>() Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopImmersiveControllerTest.kt +10 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.transition.Transitions import com.android.wm.shell.util.StubTransaction import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.cancel import kotlinx.coroutines.test.TestScope import org.junit.After import org.junit.Before import org.junit.Rule import org.junit.Test Loading Loading @@ -89,6 +91,7 @@ class DesktopImmersiveControllerTest : ShellTestCase() { private lateinit var controller: DesktopImmersiveController private lateinit var desktopRepository: DesktopRepository private val testScope = TestScope() @Before fun setUp() { Loading @@ -100,8 +103,8 @@ class DesktopImmersiveControllerTest : ShellTestCase() { mock(), mock(), mock(), mock(), TestScope(), testScope.backgroundScope, testScope.backgroundScope, mock(), desktopState, desktopConfig, Loading @@ -128,6 +131,11 @@ class DesktopImmersiveControllerTest : ShellTestCase() { desktopRepository.setActiveDesk(DEFAULT_DISPLAY, DEFAULT_DESK_ID) } @After fun tearDown() { testScope.cancel() } @Test fun enterImmersive_transitionReady_updatesRepository() { val task = createFreeformTask() Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/multidesks/DesksTransitionObserverTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ class DesksTransitionObserverTest : ShellTestCase() { /* shellController= */ mockShellController, /* persistentRepository= */ mock(), /* repositoryInitializer= */ mock(), testScope, testScope.backgroundScope, testScope.backgroundScope, /* userManager= */ mock(), desktopState, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenuTest.kt +5 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer import com.google.common.truth.Truth.assertThat import kotlin.test.assertNotNull import kotlinx.coroutines.cancel import kotlinx.coroutines.test.TestScope import org.junit.After import org.junit.Assert.fail Loading Loading @@ -71,6 +72,7 @@ class DesktopHeaderManageWindowsMenuTest : ShellTestCase() { private lateinit var desktopConfig: FakeDesktopConfig private var menu: DesktopHeaderManageWindowsMenu? = null private val testScope = TestScope() @Before fun setUp() { Loading @@ -92,8 +94,8 @@ class DesktopHeaderManageWindowsMenuTest : ShellTestCase() { shellController = mock(), persistentRepository = mock(), repositoryInitializer = mock(), mainCoroutineScope = mock(), bgCoroutineScope = TestScope(), mainCoroutineScope = testScope.backgroundScope, bgCoroutineScope = testScope.backgroundScope, userManager = mockUserManager, desktopState = desktopState, desktopConfig = desktopConfig, Loading @@ -108,6 +110,7 @@ class DesktopHeaderManageWindowsMenuTest : ShellTestCase() { fun tearDown() { menu?.removeFromContainer() mockitoSession.finishMocking() testScope.cancel() } @Test Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/data/DesktopRepository.kt +9 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.tracing.Trace import com.android.app.tracing.traceSection import com.android.internal.annotations.VisibleForTesting import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.common.WorkSerializer import com.android.wm.shell.desktopmode.DisplayDeskState import com.android.wm.shell.desktopmode.data.persistence.DesktopPersistentRepository Loading Loading @@ -67,8 +68,14 @@ class DesktopRepository( private val activeTasksListeners = ArraySet<ActiveTasksListener>() private val visibleTasksListeners = ArrayMap<VisibleTasksListener, Executor>() private val persistentUpdateQueue = WorkSerializer(bgCoroutineScope) private val persistentUpdateQueue = WorkSerializer( if (Flags.repositoryBasedPersistenceBgThread()) { bgCoroutineScope } else { mainCoroutineScope } ) /* Tracks corner/caption regions of desktop tasks, used to determine gesture exclusion. */ private val desktopExclusionRegions = SparseArray<Region>() Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopImmersiveControllerTest.kt +10 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.transition.Transitions import com.android.wm.shell.util.StubTransaction import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.cancel import kotlinx.coroutines.test.TestScope import org.junit.After import org.junit.Before import org.junit.Rule import org.junit.Test Loading Loading @@ -89,6 +91,7 @@ class DesktopImmersiveControllerTest : ShellTestCase() { private lateinit var controller: DesktopImmersiveController private lateinit var desktopRepository: DesktopRepository private val testScope = TestScope() @Before fun setUp() { Loading @@ -100,8 +103,8 @@ class DesktopImmersiveControllerTest : ShellTestCase() { mock(), mock(), mock(), mock(), TestScope(), testScope.backgroundScope, testScope.backgroundScope, mock(), desktopState, desktopConfig, Loading @@ -128,6 +131,11 @@ class DesktopImmersiveControllerTest : ShellTestCase() { desktopRepository.setActiveDesk(DEFAULT_DISPLAY, DEFAULT_DESK_ID) } @After fun tearDown() { testScope.cancel() } @Test fun enterImmersive_transitionReady_updatesRepository() { val task = createFreeformTask() Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/multidesks/DesksTransitionObserverTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ class DesksTransitionObserverTest : ShellTestCase() { /* shellController= */ mockShellController, /* persistentRepository= */ mock(), /* repositoryInitializer= */ mock(), testScope, testScope.backgroundScope, testScope.backgroundScope, /* userManager= */ mock(), desktopState, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenuTest.kt +5 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import com.android.wm.shell.sysui.ShellInit import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer import com.google.common.truth.Truth.assertThat import kotlin.test.assertNotNull import kotlinx.coroutines.cancel import kotlinx.coroutines.test.TestScope import org.junit.After import org.junit.Assert.fail Loading Loading @@ -71,6 +72,7 @@ class DesktopHeaderManageWindowsMenuTest : ShellTestCase() { private lateinit var desktopConfig: FakeDesktopConfig private var menu: DesktopHeaderManageWindowsMenu? = null private val testScope = TestScope() @Before fun setUp() { Loading @@ -92,8 +94,8 @@ class DesktopHeaderManageWindowsMenuTest : ShellTestCase() { shellController = mock(), persistentRepository = mock(), repositoryInitializer = mock(), mainCoroutineScope = mock(), bgCoroutineScope = TestScope(), mainCoroutineScope = testScope.backgroundScope, bgCoroutineScope = testScope.backgroundScope, userManager = mockUserManager, desktopState = desktopState, desktopConfig = desktopConfig, Loading @@ -108,6 +110,7 @@ class DesktopHeaderManageWindowsMenuTest : ShellTestCase() { fun tearDown() { menu?.removeFromContainer() mockitoSession.finishMocking() testScope.cancel() } @Test Loading