Loading packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt +9 −3 Original line number Diff line number Diff line Loading @@ -37,9 +37,11 @@ import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleRegistry import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launchTraced as launch import com.android.compose.theme.PlatformTheme import com.android.internal.annotations.VisibleForTesting import com.android.systemui.Flags import com.android.systemui.Flags.communalHubOnMobile import com.android.systemui.ambient.touch.TouchMonitor import com.android.systemui.ambient.touch.dagger.AmbientTouchComponent import com.android.systemui.communal.dagger.Communal Loading Loading @@ -70,7 +72,6 @@ import java.util.function.Consumer import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import com.android.app.tracing.coroutines.launchTraced as launch /** * Controller that's responsible for the glanceable hub container view and its touch handling. Loading Loading @@ -513,14 +514,19 @@ constructor( val touchOnUmo = keyguardMediaController.isWithinMediaViewBounds(ev.x.toInt(), ev.y.toInt()) val touchOnSmartspace = lockscreenSmartspaceController.isWithinSmartspaceBounds(ev.x.toInt(), ev.y.toInt()) if (!hubShowing && (touchOnNotifications || touchOnUmo || touchOnSmartspace)) { val glanceableHubV2 = communalHubOnMobile() if ( !hubShowing && (touchOnNotifications || touchOnUmo || touchOnSmartspace || glanceableHubV2) ) { logger.d({ "Lockscreen touch ignored: touchOnNotifications: $bool1, touchOnUmo: $bool2, " + "touchOnSmartspace: $bool3" "touchOnSmartspace: $bool3, glanceableHubV2: $bool4" }) { bool1 = touchOnNotifications bool2 = touchOnUmo bool3 = touchOnSmartspace bool4 = glanceableHubV2 } return false } Loading packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import androidx.lifecycle.LifecycleOwner import androidx.test.filters.SmallTest import com.android.compose.animation.scene.SceneKey import com.android.systemui.Flags import com.android.systemui.Flags.FLAG_COMMUNAL_HUB_ON_MOBILE import com.android.systemui.Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX import com.android.systemui.SysuiTestCase import com.android.systemui.ambient.touch.TouchHandler Loading Loading @@ -630,6 +631,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() { } } @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE) @Test fun onTouchEvent_shadeInteracting_movesNotDispatched() = with(kosmos) { Loading Loading @@ -686,6 +688,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() { } } @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE) @Test fun onTouchEvent_bouncerInteracting_movesNotDispatched() = with(kosmos) { Loading Loading @@ -718,6 +721,19 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() { } } @EnableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE) @Test fun onTouchEvent_onLockscreenAndGlanceableHubV2_touchIgnored() = with(kosmos) { testScope.runTest { // On lockscreen. goToScene(CommunalScenes.Blank) assertThat(underTest.onTouchEvent(DOWN_EVENT)).isFalse() verify(containerView, never()).onTouchEvent(DOWN_EVENT) } } @Test fun disposeView_destroysTouchMonitor() { clearInvocations(touchMonitor) Loading Loading
packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt +9 −3 Original line number Diff line number Diff line Loading @@ -37,9 +37,11 @@ import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleRegistry import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launchTraced as launch import com.android.compose.theme.PlatformTheme import com.android.internal.annotations.VisibleForTesting import com.android.systemui.Flags import com.android.systemui.Flags.communalHubOnMobile import com.android.systemui.ambient.touch.TouchMonitor import com.android.systemui.ambient.touch.dagger.AmbientTouchComponent import com.android.systemui.communal.dagger.Communal Loading Loading @@ -70,7 +72,6 @@ import java.util.function.Consumer import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import com.android.app.tracing.coroutines.launchTraced as launch /** * Controller that's responsible for the glanceable hub container view and its touch handling. Loading Loading @@ -513,14 +514,19 @@ constructor( val touchOnUmo = keyguardMediaController.isWithinMediaViewBounds(ev.x.toInt(), ev.y.toInt()) val touchOnSmartspace = lockscreenSmartspaceController.isWithinSmartspaceBounds(ev.x.toInt(), ev.y.toInt()) if (!hubShowing && (touchOnNotifications || touchOnUmo || touchOnSmartspace)) { val glanceableHubV2 = communalHubOnMobile() if ( !hubShowing && (touchOnNotifications || touchOnUmo || touchOnSmartspace || glanceableHubV2) ) { logger.d({ "Lockscreen touch ignored: touchOnNotifications: $bool1, touchOnUmo: $bool2, " + "touchOnSmartspace: $bool3" "touchOnSmartspace: $bool3, glanceableHubV2: $bool4" }) { bool1 = touchOnNotifications bool2 = touchOnUmo bool3 = touchOnSmartspace bool4 = glanceableHubV2 } return false } Loading
packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import androidx.lifecycle.LifecycleOwner import androidx.test.filters.SmallTest import com.android.compose.animation.scene.SceneKey import com.android.systemui.Flags import com.android.systemui.Flags.FLAG_COMMUNAL_HUB_ON_MOBILE import com.android.systemui.Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX import com.android.systemui.SysuiTestCase import com.android.systemui.ambient.touch.TouchHandler Loading Loading @@ -630,6 +631,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() { } } @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE) @Test fun onTouchEvent_shadeInteracting_movesNotDispatched() = with(kosmos) { Loading Loading @@ -686,6 +688,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() { } } @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE) @Test fun onTouchEvent_bouncerInteracting_movesNotDispatched() = with(kosmos) { Loading Loading @@ -718,6 +721,19 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() { } } @EnableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE) @Test fun onTouchEvent_onLockscreenAndGlanceableHubV2_touchIgnored() = with(kosmos) { testScope.runTest { // On lockscreen. goToScene(CommunalScenes.Blank) assertThat(underTest.onTouchEvent(DOWN_EVENT)).isFalse() verify(containerView, never()).onTouchEvent(DOWN_EVENT) } } @Test fun disposeView_destroysTouchMonitor() { clearInvocations(touchMonitor) Loading