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

Commit 5c2fdd48 authored by Yunke Zhou's avatar Yunke Zhou Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Fix the missing user switcher issue" into main

parents c9cbfc71 dae18efb
Loading
Loading
Loading
Loading
+28 −35
Original line number Diff line number Diff line
@@ -134,14 +134,6 @@ constructor(
     */
    val isOneHandedModeSupported: StateFlow<Boolean> = _isOneHandedModeSupported.asStateFlow()

    /**
     * Whether swap of layout columns on double click should be disabled to improve interaction on
     * large-screen form factor, e.g. desktop, kiosk
     */
    private val disableDoubleClickSwap =
        Flags.disableDoubleClickSwapOnBouncer() &&
            bouncerInteractor.isImproveLargeScreenInteractionEnabled

    private val _isInputPreferredOnLeftSide = MutableStateFlow(false)
    val isInputPreferredOnLeftSide = _isInputPreferredOnLeftSide.asStateFlow()

@@ -224,15 +216,13 @@ constructor(

            launch { actionButtonInteractor.actionButton.collect { _actionButton.value = it } }

            if (!disableDoubleClickSwap) {
            launch {
                combine(
                        bouncerInteractor.isOneHandedModeSupported,
                        bouncerInteractor.lastRecordedLockscreenTouchPosition,
                        ::Pair,
                    )
                        .collect { (isOneHandedModeSupported, lastRecordedNotificationTouchPosition)
                            ->
                    .collect { (isOneHandedModeSupported, lastRecordedNotificationTouchPosition) ->
                        _isOneHandedModeSupported.value = isOneHandedModeSupported
                        if (
                            isOneHandedModeSupported &&
@@ -241,8 +231,7 @@ constructor(
                            bouncerInteractor.setPreferredBouncerInputSide(
                                if (
                                    lastRecordedNotificationTouchPosition <
                                            applicationContext.resources.displayMetrics
                                                .widthPixels / 2
                                        applicationContext.resources.displayMetrics.widthPixels / 2
                                ) {
                                    BouncerInputSide.LEFT
                                } else {
@@ -252,7 +241,6 @@ constructor(
                        }
                    }
            }
            }

            launch {
                bouncerInteractor.isUserSwitcherVisible.collect {
@@ -397,6 +385,11 @@ constructor(
     * input UI is not present.
     */
    fun onDoubleTap(wasEventOnNonInputHalfOfScreen: Boolean) {
        // Swap of layout columns on double click should be disabled to improve interaction on
        // large-screen form factor, e.g. desktop, kiosk
        val disableDoubleClickSwap =
            Flags.disableDoubleClickSwapOnBouncer() &&
                bouncerInteractor.isImproveLargeScreenInteractionEnabled
        if (disableDoubleClickSwap) return
        if (!wasEventOnNonInputHalfOfScreen) return
        if (_isInputPreferredOnLeftSide.value) {