Loading packages/SystemUI/multivalentTests/src/com/android/systemui/actioncorner/data/repository/ActionCornerSettingRepositoryTest.kt +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.actioncorner.data.repository import android.provider.Settings.Secure.ACTION_CORNER_ACTION_HOME import android.provider.Settings.Secure.ACTION_CORNER_ACTION_LOCKSCREEN import android.provider.Settings.Secure.ACTION_CORNER_ACTION_NOTIFICATIONS import android.provider.Settings.Secure.ACTION_CORNER_ACTION_OVERVIEW import android.provider.Settings.Secure.ACTION_CORNER_ACTION_QUICK_SETTINGS Loading @@ -28,6 +29,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.actioncorner.data.model.ActionType.HOME import com.android.systemui.actioncorner.data.model.ActionType.LOCKSCREEN import com.android.systemui.actioncorner.data.model.ActionType.NONE import com.android.systemui.actioncorner.data.model.ActionType.NOTIFICATIONS import com.android.systemui.actioncorner.data.model.ActionType.OVERVIEW Loading Loading @@ -116,4 +118,15 @@ class ActionCornerSettingRepositoryTest : SysuiTestCase() { val model by collectLastValue(underTest.bottomRightCornerAction) assertThat(model).isEqualTo(HOME) } @Test fun testLockscreenActionOnBottomRightCorner() = kosmos.runTest { settingsRepository.setInt( ACTION_CORNER_BOTTOM_RIGHT_ACTION, ACTION_CORNER_ACTION_LOCKSCREEN, ) val model by collectLastValue(underTest.bottomRightCornerAction) assertThat(model).isEqualTo(LOCKSCREEN) } } packages/SystemUI/multivalentTests/src/com/android/systemui/actioncorner/domain/interactor/ActionCornerInteractorTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.actioncorner.domain.interactor import android.provider.Settings.Secure.ACTION_CORNER_ACTION_HOME import android.provider.Settings.Secure.ACTION_CORNER_ACTION_LOCKSCREEN import android.provider.Settings.Secure.ACTION_CORNER_ACTION_NOTIFICATIONS import android.provider.Settings.Secure.ACTION_CORNER_ACTION_OVERVIEW import android.provider.Settings.Secure.ACTION_CORNER_ACTION_QUICK_SETTINGS Loading @@ -25,6 +26,7 @@ import android.provider.Settings.Secure.ACTION_CORNER_BOTTOM_RIGHT_ACTION import android.provider.Settings.Secure.ACTION_CORNER_TOP_LEFT_ACTION import android.provider.Settings.Secure.ACTION_CORNER_TOP_RIGHT_ACTION import android.view.Display.DEFAULT_DISPLAY import android.view.IWindowManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.LauncherProxyService Loading Loading @@ -58,6 +60,7 @@ import com.android.systemui.util.settings.data.repository.userAwareSecureSetting import kotlin.test.Test import org.junit.Before import org.junit.runner.RunWith import org.mockito.kotlin.eq import org.mockito.kotlin.mock import org.mockito.kotlin.never import org.mockito.kotlin.times Loading @@ -75,6 +78,7 @@ class ActionCornerInteractorTest : SysuiTestCase() { } private val Kosmos.launcherProxyService by Fixture { mock<LauncherProxyService>() } private val Kosmos.windowManager by Fixture { mock<IWindowManager>() } private val Kosmos.commandQueue by Fixture { mock<CommandQueue>() } private val Kosmos.fakePointerRepository by Fixture { FakePointerDeviceRepository() } Loading @@ -87,6 +91,7 @@ class ActionCornerInteractorTest : SysuiTestCase() { windowManagerLockscreenVisibilityInteractor, fakeUserSetupRepository, commandQueue, windowManager, ) } Loading Loading @@ -145,6 +150,16 @@ class ActionCornerInteractorTest : SysuiTestCase() { verify(commandQueue).toggleQuickSettingsPanel() } @Test fun actionCornerActivated_lockscreenActionConfigured_lockScreen() = unlockScreenAndRunTest { settingsRepository.setInt( ACTION_CORNER_BOTTOM_RIGHT_ACTION, ACTION_CORNER_ACTION_LOCKSCREEN, ) actionCornerRepository.addState(ActiveActionCorner(BOTTOM_RIGHT, DEFAULT_DISPLAY)) verify(windowManager).lockNow(eq(null)) } @Test fun userNotSetUp_overviewActionConfigured_actionCornerActivated_actionNotTriggered() = unlockScreenAndRunTest { Loading packages/SystemUI/src/com/android/systemui/actioncorner/data/model/ActionCornerState.kt +1 −0 Original line number Diff line number Diff line Loading @@ -55,4 +55,5 @@ enum class ActionType { OVERVIEW, NOTIFICATIONS, QUICK_SETTINGS, LOCKSCREEN, } packages/SystemUI/src/com/android/systemui/actioncorner/data/repository/ActionCornerSettingRepository.kt +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.actioncorner.data.repository import android.provider.Settings.Secure.ACTION_CORNER_ACTION_HOME import android.provider.Settings.Secure.ACTION_CORNER_ACTION_LOCKSCREEN import android.provider.Settings.Secure.ACTION_CORNER_ACTION_NOTIFICATIONS import android.provider.Settings.Secure.ACTION_CORNER_ACTION_OVERVIEW import android.provider.Settings.Secure.ACTION_CORNER_ACTION_QUICK_SETTINGS Loading @@ -27,6 +28,7 @@ import android.provider.Settings.Secure.ACTION_CORNER_TOP_RIGHT_ACTION import android.provider.Settings.Secure.ActionCornerActionType import com.android.systemui.actioncorner.data.model.ActionType import com.android.systemui.actioncorner.data.model.ActionType.HOME import com.android.systemui.actioncorner.data.model.ActionType.LOCKSCREEN import com.android.systemui.actioncorner.data.model.ActionType.NONE import com.android.systemui.actioncorner.data.model.ActionType.NOTIFICATIONS import com.android.systemui.actioncorner.data.model.ActionType.OVERVIEW Loading Loading @@ -94,6 +96,7 @@ constructor( ACTION_CORNER_ACTION_OVERVIEW -> OVERVIEW ACTION_CORNER_ACTION_NOTIFICATIONS -> NOTIFICATIONS ACTION_CORNER_ACTION_QUICK_SETTINGS -> QUICK_SETTINGS ACTION_CORNER_ACTION_LOCKSCREEN -> LOCKSCREEN else -> NONE } } packages/SystemUI/src/com/android/systemui/actioncorner/domain/interactor/ActionCornerInteractor.kt +4 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.actioncorner.domain.interactor import android.view.IWindowManager import com.android.systemui.LauncherProxyService import com.android.systemui.actioncorner.data.model.ActionCornerRegion import com.android.systemui.actioncorner.data.model.ActionCornerRegion.BOTTOM_LEFT Loading @@ -25,6 +26,7 @@ import com.android.systemui.actioncorner.data.model.ActionCornerRegion.TOP_RIGHT import com.android.systemui.actioncorner.data.model.ActionCornerState.ActiveActionCorner import com.android.systemui.actioncorner.data.model.ActionType import com.android.systemui.actioncorner.data.model.ActionType.HOME import com.android.systemui.actioncorner.data.model.ActionType.LOCKSCREEN import com.android.systemui.actioncorner.data.model.ActionType.NONE import com.android.systemui.actioncorner.data.model.ActionType.NOTIFICATIONS import com.android.systemui.actioncorner.data.model.ActionType.OVERVIEW Loading Loading @@ -59,6 +61,7 @@ constructor( private val lockscreenVisibilityInteractor: WindowManagerLockscreenVisibilityInteractor, private val userSetupRepository: UserSetupRepository, private val commandQueue: CommandQueue, private val windowManager: IWindowManager, ) : ExclusiveActivatable() { override suspend fun onActivated(): Nothing { Loading Loading @@ -101,6 +104,7 @@ constructor( ) NOTIFICATIONS -> commandQueue.toggleNotificationsPanel() QUICK_SETTINGS -> commandQueue.toggleQuickSettingsPanel() LOCKSCREEN -> windowManager.lockNow(/* bundle= */ null) NONE -> {} } } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/actioncorner/data/repository/ActionCornerSettingRepositoryTest.kt +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.actioncorner.data.repository import android.provider.Settings.Secure.ACTION_CORNER_ACTION_HOME import android.provider.Settings.Secure.ACTION_CORNER_ACTION_LOCKSCREEN import android.provider.Settings.Secure.ACTION_CORNER_ACTION_NOTIFICATIONS import android.provider.Settings.Secure.ACTION_CORNER_ACTION_OVERVIEW import android.provider.Settings.Secure.ACTION_CORNER_ACTION_QUICK_SETTINGS Loading @@ -28,6 +29,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.actioncorner.data.model.ActionType.HOME import com.android.systemui.actioncorner.data.model.ActionType.LOCKSCREEN import com.android.systemui.actioncorner.data.model.ActionType.NONE import com.android.systemui.actioncorner.data.model.ActionType.NOTIFICATIONS import com.android.systemui.actioncorner.data.model.ActionType.OVERVIEW Loading Loading @@ -116,4 +118,15 @@ class ActionCornerSettingRepositoryTest : SysuiTestCase() { val model by collectLastValue(underTest.bottomRightCornerAction) assertThat(model).isEqualTo(HOME) } @Test fun testLockscreenActionOnBottomRightCorner() = kosmos.runTest { settingsRepository.setInt( ACTION_CORNER_BOTTOM_RIGHT_ACTION, ACTION_CORNER_ACTION_LOCKSCREEN, ) val model by collectLastValue(underTest.bottomRightCornerAction) assertThat(model).isEqualTo(LOCKSCREEN) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/actioncorner/domain/interactor/ActionCornerInteractorTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.actioncorner.domain.interactor import android.provider.Settings.Secure.ACTION_CORNER_ACTION_HOME import android.provider.Settings.Secure.ACTION_CORNER_ACTION_LOCKSCREEN import android.provider.Settings.Secure.ACTION_CORNER_ACTION_NOTIFICATIONS import android.provider.Settings.Secure.ACTION_CORNER_ACTION_OVERVIEW import android.provider.Settings.Secure.ACTION_CORNER_ACTION_QUICK_SETTINGS Loading @@ -25,6 +26,7 @@ import android.provider.Settings.Secure.ACTION_CORNER_BOTTOM_RIGHT_ACTION import android.provider.Settings.Secure.ACTION_CORNER_TOP_LEFT_ACTION import android.provider.Settings.Secure.ACTION_CORNER_TOP_RIGHT_ACTION import android.view.Display.DEFAULT_DISPLAY import android.view.IWindowManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.LauncherProxyService Loading Loading @@ -58,6 +60,7 @@ import com.android.systemui.util.settings.data.repository.userAwareSecureSetting import kotlin.test.Test import org.junit.Before import org.junit.runner.RunWith import org.mockito.kotlin.eq import org.mockito.kotlin.mock import org.mockito.kotlin.never import org.mockito.kotlin.times Loading @@ -75,6 +78,7 @@ class ActionCornerInteractorTest : SysuiTestCase() { } private val Kosmos.launcherProxyService by Fixture { mock<LauncherProxyService>() } private val Kosmos.windowManager by Fixture { mock<IWindowManager>() } private val Kosmos.commandQueue by Fixture { mock<CommandQueue>() } private val Kosmos.fakePointerRepository by Fixture { FakePointerDeviceRepository() } Loading @@ -87,6 +91,7 @@ class ActionCornerInteractorTest : SysuiTestCase() { windowManagerLockscreenVisibilityInteractor, fakeUserSetupRepository, commandQueue, windowManager, ) } Loading Loading @@ -145,6 +150,16 @@ class ActionCornerInteractorTest : SysuiTestCase() { verify(commandQueue).toggleQuickSettingsPanel() } @Test fun actionCornerActivated_lockscreenActionConfigured_lockScreen() = unlockScreenAndRunTest { settingsRepository.setInt( ACTION_CORNER_BOTTOM_RIGHT_ACTION, ACTION_CORNER_ACTION_LOCKSCREEN, ) actionCornerRepository.addState(ActiveActionCorner(BOTTOM_RIGHT, DEFAULT_DISPLAY)) verify(windowManager).lockNow(eq(null)) } @Test fun userNotSetUp_overviewActionConfigured_actionCornerActivated_actionNotTriggered() = unlockScreenAndRunTest { Loading
packages/SystemUI/src/com/android/systemui/actioncorner/data/model/ActionCornerState.kt +1 −0 Original line number Diff line number Diff line Loading @@ -55,4 +55,5 @@ enum class ActionType { OVERVIEW, NOTIFICATIONS, QUICK_SETTINGS, LOCKSCREEN, }
packages/SystemUI/src/com/android/systemui/actioncorner/data/repository/ActionCornerSettingRepository.kt +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.actioncorner.data.repository import android.provider.Settings.Secure.ACTION_CORNER_ACTION_HOME import android.provider.Settings.Secure.ACTION_CORNER_ACTION_LOCKSCREEN import android.provider.Settings.Secure.ACTION_CORNER_ACTION_NOTIFICATIONS import android.provider.Settings.Secure.ACTION_CORNER_ACTION_OVERVIEW import android.provider.Settings.Secure.ACTION_CORNER_ACTION_QUICK_SETTINGS Loading @@ -27,6 +28,7 @@ import android.provider.Settings.Secure.ACTION_CORNER_TOP_RIGHT_ACTION import android.provider.Settings.Secure.ActionCornerActionType import com.android.systemui.actioncorner.data.model.ActionType import com.android.systemui.actioncorner.data.model.ActionType.HOME import com.android.systemui.actioncorner.data.model.ActionType.LOCKSCREEN import com.android.systemui.actioncorner.data.model.ActionType.NONE import com.android.systemui.actioncorner.data.model.ActionType.NOTIFICATIONS import com.android.systemui.actioncorner.data.model.ActionType.OVERVIEW Loading Loading @@ -94,6 +96,7 @@ constructor( ACTION_CORNER_ACTION_OVERVIEW -> OVERVIEW ACTION_CORNER_ACTION_NOTIFICATIONS -> NOTIFICATIONS ACTION_CORNER_ACTION_QUICK_SETTINGS -> QUICK_SETTINGS ACTION_CORNER_ACTION_LOCKSCREEN -> LOCKSCREEN else -> NONE } }
packages/SystemUI/src/com/android/systemui/actioncorner/domain/interactor/ActionCornerInteractor.kt +4 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.actioncorner.domain.interactor import android.view.IWindowManager import com.android.systemui.LauncherProxyService import com.android.systemui.actioncorner.data.model.ActionCornerRegion import com.android.systemui.actioncorner.data.model.ActionCornerRegion.BOTTOM_LEFT Loading @@ -25,6 +26,7 @@ import com.android.systemui.actioncorner.data.model.ActionCornerRegion.TOP_RIGHT import com.android.systemui.actioncorner.data.model.ActionCornerState.ActiveActionCorner import com.android.systemui.actioncorner.data.model.ActionType import com.android.systemui.actioncorner.data.model.ActionType.HOME import com.android.systemui.actioncorner.data.model.ActionType.LOCKSCREEN import com.android.systemui.actioncorner.data.model.ActionType.NONE import com.android.systemui.actioncorner.data.model.ActionType.NOTIFICATIONS import com.android.systemui.actioncorner.data.model.ActionType.OVERVIEW Loading Loading @@ -59,6 +61,7 @@ constructor( private val lockscreenVisibilityInteractor: WindowManagerLockscreenVisibilityInteractor, private val userSetupRepository: UserSetupRepository, private val commandQueue: CommandQueue, private val windowManager: IWindowManager, ) : ExclusiveActivatable() { override suspend fun onActivated(): Nothing { Loading Loading @@ -101,6 +104,7 @@ constructor( ) NOTIFICATIONS -> commandQueue.toggleNotificationsPanel() QUICK_SETTINGS -> commandQueue.toggleQuickSettingsPanel() LOCKSCREEN -> windowManager.lockNow(/* bundle= */ null) NONE -> {} } } Loading