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

Commit f5309268 authored by Matt Pietal's avatar Matt Pietal
Browse files

Remove released long press flag

Cleanup

Fixes: 266242192
Flag: EXEMPT cleanup
Test: atest SystemUITests
Change-Id: I8559d41a8ceb20a483d2fc30d5969e787e25b4af
parent ff05aae2
Loading
Loading
Loading
Loading
+7 −19
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.deviceentry.domain.interactor.deviceEntryFaceAuthInteractor
import com.android.systemui.deviceentry.shared.FaceAuthUiEvent
import com.android.systemui.flags.Flags
import com.android.systemui.flags.fakeFeatureFlagsClassic
import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFaceAuthRepository
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
@@ -93,9 +92,7 @@ class KeyguardTouchHandlingInteractorTest : SysuiTestCase() {
        testScope.runTest {
            val isEnabled = collectLastValue(underTest.isLongPressHandlingEnabled)
            KeyguardState.values().forEach { keyguardState ->
                setUpState(
                    keyguardState = keyguardState,
                )
                setUpState(keyguardState = keyguardState)

                if (keyguardState == KeyguardState.LOCKSCREEN) {
                    assertThat(isEnabled()).isTrue()
@@ -110,10 +107,7 @@ class KeyguardTouchHandlingInteractorTest : SysuiTestCase() {
        testScope.runTest {
            val isEnabled = collectLastValue(underTest.isLongPressHandlingEnabled)
            KeyguardState.values().forEach { keyguardState ->
                setUpState(
                    keyguardState = keyguardState,
                    isQuickSettingsVisible = true,
                )
                setUpState(keyguardState = keyguardState, isQuickSettingsVisible = true)

                assertThat(isEnabled()).isFalse()
            }
@@ -290,22 +284,19 @@ class KeyguardTouchHandlingInteractorTest : SysuiTestCase() {
            keyguardTransitionRepository.sendTransitionSteps(
                from = KeyguardState.LOCKSCREEN,
                to = KeyguardState.GONE,
                testScope
                testScope,
            )
            assertThat(isMenuVisible).isFalse()

            keyguardTransitionRepository.sendTransitionSteps(
                from = KeyguardState.GONE,
                to = KeyguardState.LOCKSCREEN,
                testScope
                testScope,
            )
            assertThat(isMenuVisible).isFalse()
        }

    private suspend fun createUnderTest(
        isLongPressFeatureEnabled: Boolean = true,
        isRevampedWppFeatureEnabled: Boolean = true,
    ) {
    private suspend fun createUnderTest(isRevampedWppFeatureEnabled: Boolean = true) {
        // This needs to be re-created for each test outside of kosmos since the flag values are
        // read during initialization to set up flows. Maybe there is a better way to handle that.
        underTest =
@@ -315,10 +306,7 @@ class KeyguardTouchHandlingInteractorTest : SysuiTestCase() {
                transitionInteractor = kosmos.keyguardTransitionInteractor,
                repository = keyguardRepository,
                logger = logger,
                featureFlags =
                    kosmos.fakeFeatureFlagsClassic.apply {
                        set(Flags.LOCK_SCREEN_LONG_PRESS_ENABLED, isLongPressFeatureEnabled)
                    },
                featureFlags = kosmos.fakeFeatureFlagsClassic,
                broadcastDispatcher = fakeBroadcastDispatcher,
                accessibilityManager = kosmos.accessibilityManagerWrapper,
                pulsingGestureListener = kosmos.pulsingGestureListener,
@@ -334,7 +322,7 @@ class KeyguardTouchHandlingInteractorTest : SysuiTestCase() {
        keyguardTransitionRepository.sendTransitionSteps(
            from = KeyguardState.AOD,
            to = keyguardState,
            testScope = testScope
            testScope = testScope,
        )
        keyguardRepository.setQuickSettingsVisible(isVisible = isQuickSettingsVisible)
    }
+0 −3
Original line number Diff line number Diff line
@@ -26,9 +26,7 @@ import com.android.systemui.biometrics.authController
import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.Flags
import com.android.systemui.flags.andSceneContainer
import com.android.systemui.flags.fakeFeatureFlagsClassic
import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository
import com.android.systemui.keyguard.data.repository.keyguardOcclusionRepository
import com.android.systemui.keyguard.shared.model.ClockSize
@@ -77,7 +75,6 @@ class LockscreenContentViewModelTest(flags: FlagsParameterization) : SysuiTestCa
    @Before
    fun setup() {
        with(kosmos) {
            fakeFeatureFlagsClassic.set(Flags.LOCK_SCREEN_LONG_PRESS_ENABLED, true)
            shadeRepository.setShadeLayoutWide(false)
            underTest = lockscreenContentViewModel
            underTest.activateIn(testScope)
+0 −4
Original line number Diff line number Diff line
@@ -100,10 +100,6 @@ object Flags {
    // TODO(b/242908637): Tracking Bug
    @JvmField val WALLPAPER_FULLSCREEN_PREVIEW = releasedFlag("wallpaper_fullscreen_preview")

    /** Whether the long-press gesture to open wallpaper picker is enabled. */
    // TODO(b/266242192): Tracking Bug
    @JvmField val LOCK_SCREEN_LONG_PRESS_ENABLED = releasedFlag("lock_screen_long_press_enabled")

    /** Inflate and bind views upon emitting a blueprint value . */
    // TODO(b/297365780): Tracking Bug
    @JvmField val LAZY_INFLATE_KEYGUARD = releasedFlag("lazy_inflate_keyguard")
+5 −12
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.view.accessibility.AccessibilityManager
import androidx.annotation.VisibleForTesting
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.internal.logging.UiEvent
import com.android.internal.logging.UiEventLogger
import com.android.systemui.broadcast.BroadcastDispatcher
@@ -29,7 +30,6 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.keyguard.data.repository.KeyguardRepository
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.res.R
@@ -51,7 +51,6 @@ import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.stateIn
import com.android.app.tracing.coroutines.launchTraced as launch

/** Business logic for use-cases related to top-level touch handling in the lock screen. */
@OptIn(ExperimentalCoroutinesApi::class)
@@ -121,9 +120,7 @@ constructor(
    init {
        if (isFeatureEnabled()) {
            broadcastDispatcher
                .broadcastFlow(
                    IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS),
                )
                .broadcastFlow(IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS))
                .onEach { hideMenu() }
                .launchIn(scope)
        }
@@ -188,8 +185,7 @@ constructor(
    }

    private fun isFeatureEnabled(): Boolean {
        return featureFlags.isEnabled(Flags.LOCK_SCREEN_LONG_PRESS_ENABLED) &&
            context.resources.getBoolean(R.bool.long_press_keyguard_customize_lockscreen_enabled)
        return context.resources.getBoolean(R.bool.long_press_keyguard_customize_lockscreen_enabled)
    }

    /** Updates application state to ask to show the menu. */
@@ -230,14 +226,11 @@ constructor(
            .toLong()
    }

    enum class LogEvents(
        private val _id: Int,
    ) : UiEventLogger.UiEventEnum {
    enum class LogEvents(private val _id: Int) : UiEventLogger.UiEventEnum {
        @UiEvent(doc = "The lock screen was long-pressed and we showed the settings popup menu.")
        LOCK_SCREEN_LONG_PRESS_POPUP_SHOWN(1292),
        @UiEvent(doc = "The lock screen long-press popup menu was clicked.")
        LOCK_SCREEN_LONG_PRESS_POPUP_CLICKED(1293),
        ;
        LOCK_SCREEN_LONG_PRESS_POPUP_CLICKED(1293);

        override fun getId() = _id
    }
+3 −6
Original line number Diff line number Diff line
@@ -32,8 +32,8 @@ import com.android.systemui.common.shared.model.Icon
import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.dock.DockManagerFake
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.flags.fakeFeatureFlagsClassic
import com.android.systemui.keyguard.data.quickaffordance.BuiltInKeyguardQuickAffordanceKeys
import com.android.systemui.keyguard.data.quickaffordance.FakeKeyguardQuickAffordanceConfig
import com.android.systemui.keyguard.data.quickaffordance.FakeKeyguardQuickAffordanceProviderClientFactory
@@ -191,10 +191,7 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
        dockManager = DockManagerFake()
        biometricSettingsRepository = FakeBiometricSettingsRepository()

        val featureFlags =
            FakeFeatureFlags().apply { set(Flags.LOCK_SCREEN_LONG_PRESS_ENABLED, false) }

        val withDeps = KeyguardInteractorFactory.create(featureFlags = featureFlags)
        val withDeps = KeyguardInteractorFactory.create()
        keyguardInteractor = withDeps.keyguardInteractor
        repository = withDeps.repository

@@ -287,7 +284,7 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
                        keyguardStateController = keyguardStateController,
                        userTracker = userTracker,
                        activityStarter = activityStarter,
                        featureFlags = featureFlags,
                        featureFlags = kosmos.fakeFeatureFlagsClassic,
                        repository = { quickAffordanceRepository },
                        launchAnimator = launchAnimator,
                        logger = logger,
Loading