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

Commit a73a764f authored by Daniel Chapin's avatar Daniel Chapin Committed by Android Build Coastguard Worker
Browse files

Revert "Allowing clicks on the IDLE state of the QSLongPressEffect"

This reverts commit 0c973ce7.

Reason for revert: b/350417298
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4e47fc6d7da21df91d3ca62496cbd50f88eadfa8)
Merged-In: Idc07f451490661c875ae2b9f92fc3c130ce713f8
Change-Id: Idc07f451490661c875ae2b9f92fc3c130ce713f8
parent 3038d53e
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -274,29 +274,6 @@ class QSLongPressEffectTest : SysuiTestCase() {
            assertThat(couldClick).isFalse()
        }

    @Test
    fun onTileClick_whileIdle_withQSTile_clicks() =
        testWhileInState(QSLongPressEffect.State.IDLE) {
            // GIVEN that a click was detected
            val couldClick = longPressEffect.onTileClick()

            // THEN the click is successful
            assertThat(couldClick).isTrue()
        }

    @Test
    fun onTileClick_whileIdle_withoutQSTile_cannotClick() =
        testWhileInState(QSLongPressEffect.State.IDLE) {
            // GIVEN that no QSTile has been set
            longPressEffect.qsTile = null

            // GIVEN that a click was detected
            val couldClick = longPressEffect.onTileClick()

            // THEN the click is not successful
            assertThat(couldClick).isFalse()
        }

    private fun testWithScope(initialize: Boolean = true, test: suspend TestScope.() -> Unit) =
        with(kosmos) {
            testScope.runTest {
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ constructor(
    }

    fun onTileClick(): Boolean {
        if (state == State.TIMEOUT_WAIT || state == State.IDLE) {
        if (state == State.TIMEOUT_WAIT) {
            setState(State.IDLE)
            qsTile?.let {
                it.click(expandable)