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

Commit 53de6761 authored by Bryce Lee's avatar Bryce Lee
Browse files

Create dedicated bugfix flag for vertical swipes.

This changelist introduces a new flag to track vertical swipe
behavior in hub mode as a bugfix.

Test: manual - ensured new flag is still used.
Fixes: 340177049
Flag: com.android.systemui.hubmode_fullscreen_vertical_swipe_fix
Change-Id: I1455077edcf32cae539a82abc1fa82ae26af4875
parent a5971de4
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1232,6 +1232,17 @@ flag {
  }
}

flag {
  name: "hubmode_fullscreen_vertical_swipe_fix"
  namespace: "systemui"
  description: "Bug fix that enables fullscreen vertical swiping in hub mode to bring up and down the bouncer and shade"
  bug: "340177049"
  metadata {
      purpose: PURPOSE_BUGFIX
  }
}


flag {
   namespace: "systemui"
   name: "remove_update_listener_in_qs_icon_view_impl"
+2 −1
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ import com.android.compose.modifiers.thenIf
import com.android.compose.theme.LocalAndroidColorScheme
import com.android.compose.ui.graphics.painter.rememberDrawablePainter
import com.android.internal.R.dimen.system_app_widget_background_radius
import com.android.systemui.Flags
import com.android.systemui.Flags.communalTimerFlickerFix
import com.android.systemui.communal.domain.model.CommunalContentModel
import com.android.systemui.communal.shared.model.CommunalContentSize
@@ -269,7 +270,7 @@ fun CommunalHub(
                    }
                }
                // Nested scroll for full screen swipe to get to shade and bouncer
                .thenIf(!viewModel.isEditMode) {
                .thenIf(!viewModel.isEditMode && Flags.hubmodeFullscreenVerticalSwipeFix()) {
                    Modifier.nestedScroll(nestedScrollConnection).pointerInput(viewModel) {
                        awaitPointerEventScope {
                            while (true) {
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ import java.util.Optional;

@SmallTest
@RunWith(AndroidJUnit4.class)
@EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
@EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
@DisableFlags(Flags.FLAG_COMMUNAL_BOUNCER_DO_NOT_MODIFY_PLUGIN_OPEN)
public class BouncerFullscreenSwipeTouchHandlerTest extends SysuiTestCase {
    private KosmosJavaAdapter mKosmos;
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ import java.util.Optional;

@SmallTest
@RunWith(AndroidJUnit4.class)
@DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
@DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
public class BouncerSwipeTouchHandlerTest extends SysuiTestCase {
    private KosmosJavaAdapter mKosmos;
    @Mock
+12 −12
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {

    // Verifies that a swipe down in the gesture region is captured by the shade touch handler.
    @Test
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testSwipeDown_captured() {
        val captured = swipe(Direction.DOWN)
        Truth.assertThat(captured).isTrue()
@@ -87,7 +87,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {

    // Verifies that a swipe in the upward direction is not captured.
    @Test
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testSwipeUp_notCaptured() {
        val captured = swipe(Direction.UP)

@@ -97,7 +97,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {

    // Verifies that a swipe down forwards captured touches to central surfaces for handling.
    @Test
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    @EnableFlags(Flags.FLAG_COMMUNAL_HUB)
    fun testSwipeDown_communalEnabled_sentToCentralSurfaces() {
        kosmos.fakeFeatureFlagsClassic.set(COMMUNAL_SERVICE_ENABLED, true)
@@ -110,7 +110,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {

    // Verifies that a swipe down forwards captured touches to the shade view for handling.
    @Test
    @DisableFlags(Flags.FLAG_COMMUNAL_HUB, Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_COMMUNAL_HUB, Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testSwipeDown_communalDisabled_sentToShadeView() {
        swipe(Direction.DOWN)

@@ -121,7 +121,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {
    // Verifies that a swipe down while dreaming forwards captured touches to the shade view for
    // handling.
    @Test
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testSwipeDown_dreaming_sentToShadeView() {
        whenever(mDreamManager.isDreaming).thenReturn(true)
        swipe(Direction.DOWN)
@@ -132,7 +132,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {

    // Verifies that a swipe up is not forwarded to central surfaces.
    @Test
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    @EnableFlags(Flags.FLAG_COMMUNAL_HUB)
    fun testSwipeUp_communalEnabled_touchesNotSent() {
        kosmos.fakeFeatureFlagsClassic.set(COMMUNAL_SERVICE_ENABLED, true)
@@ -146,7 +146,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {

    // Verifies that a swipe up is not forwarded to the shade view.
    @Test
    @DisableFlags(Flags.FLAG_COMMUNAL_HUB, Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_COMMUNAL_HUB, Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testSwipeUp_communalDisabled_touchesNotSent() {
        swipe(Direction.UP)

@@ -156,7 +156,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {
    }

    @Test
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @DisableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testCancelMotionEvent_popsTouchSession() {
        swipe(Direction.DOWN)
        val event = MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0f, 0f, 0)
@@ -165,7 +165,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testFullVerticalSwipe_initiatedWhenAvailable() {
        // Indicate touches are available
        mTouchHandler.onGlanceableTouchAvailable(true)
@@ -176,7 +176,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testFullVerticalSwipe_notInitiatedWhenNotAvailable() {
        // Indicate touches aren't available
        mTouchHandler.onGlanceableTouchAvailable(false)
@@ -187,7 +187,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testFullVerticalSwipe_resetsTouchStateOnUp() {
        // Indicate touches are available
        mTouchHandler.onGlanceableTouchAvailable(true)
@@ -203,7 +203,7 @@ class ShadeTouchHandlerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE)
    @EnableFlags(Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX)
    fun testFullVerticalSwipe_resetsTouchStateOnCancel() {
        // Indicate touches are available
        mTouchHandler.onGlanceableTouchAvailable(true)
Loading