Loading packages/SystemUI/aconfig/desktop_users_and_accounts.aconfig +8 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,13 @@ flag { bug: "392597328" } flag { name: "disable_double_click_swap_on_bouncer" namespace: "desktop_users_and_accounts" description: "Disable swapping bouncer sides with double click in two-column layout" bug: "416223998" } flag { name: "user_switcher_add_sign_out_option" namespace: "desktop_users_and_accounts" Loading packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1134,4 +1134,7 @@ <!-- If AOD can show an ambient version of the wallpaper (-1 means ignore) --> <integer name="config_dozeSupportsAodWallpaperOverride">-1</integer> <!-- Whether to enable features improving large screen interaction --> <bool name="config_improveLargeScreenInteractionOnLockscreen">false</bool> </resources> packages/SystemUI/src/com/android/systemui/bouncer/data/repository/BouncerRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,13 @@ constructor( val isOneHandedBouncerSupportedInConfig: Boolean get() = applicationContext.resources.getBoolean(R.bool.can_use_one_handed_bouncer) /** Whether improved large screen interaction is enabled for this device */ val isImproveLargeScreenInteractionEnabledInConfig: Boolean get() = applicationContext.resources.getBoolean( R.bool.config_improveLargeScreenInteractionOnLockscreen ) /** * Preferred side of the screen where the input area on the bouncer should be. This is * applicable for large screen devices (foldables and tablets). Loading packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt +4 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,10 @@ constructor( (repository.isOneHandedBouncerSupportedInConfig && (authMethod !is Password)) } /** Whether interactions should be improved for large-screen (non-handheld) form factor. */ val isImproveLargeScreenInteractionEnabled: Boolean = repository.isImproveLargeScreenInteractionEnabledInConfig /** * Preferred side of the screen where the input area on the bouncer should be. This is * applicable for large screen devices (foldables and tablets). Loading packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerOverlayContentViewModel.kt +37 −23 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import androidx.compose.ui.input.key.type import androidx.core.graphics.drawable.toBitmap import com.android.app.tracing.coroutines.launchTraced as launch import com.android.app.tracing.coroutines.traceCoroutine import com.android.systemui.Flags import com.android.systemui.authentication.domain.interactor.AuthenticationInteractor import com.android.systemui.authentication.shared.model.AuthenticationMethodModel import com.android.systemui.authentication.shared.model.AuthenticationWipeModel Loading Loading @@ -132,6 +133,14 @@ 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() Loading Loading @@ -208,13 +217,15 @@ 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 && Loading @@ -223,7 +234,8 @@ constructor( bouncerInteractor.setPreferredBouncerInputSide( if ( lastRecordedNotificationTouchPosition < applicationContext.resources.displayMetrics.widthPixels / 2 applicationContext.resources.displayMetrics .widthPixels / 2 ) { BouncerInputSide.LEFT } else { Loading @@ -233,6 +245,7 @@ constructor( } } } } launch { bouncerInteractor.isUserSwitcherVisible.collect { Loading Loading @@ -377,6 +390,7 @@ constructor( * input UI is not present. */ fun onDoubleTap(wasEventOnNonInputHalfOfScreen: Boolean) { if (disableDoubleClickSwap) return if (!wasEventOnNonInputHalfOfScreen) return if (_isInputPreferredOnLeftSide.value) { bouncerInteractor.setPreferredBouncerInputSide(BouncerInputSide.RIGHT) Loading Loading
packages/SystemUI/aconfig/desktop_users_and_accounts.aconfig +8 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,13 @@ flag { bug: "392597328" } flag { name: "disable_double_click_swap_on_bouncer" namespace: "desktop_users_and_accounts" description: "Disable swapping bouncer sides with double click in two-column layout" bug: "416223998" } flag { name: "user_switcher_add_sign_out_option" namespace: "desktop_users_and_accounts" Loading
packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1134,4 +1134,7 @@ <!-- If AOD can show an ambient version of the wallpaper (-1 means ignore) --> <integer name="config_dozeSupportsAodWallpaperOverride">-1</integer> <!-- Whether to enable features improving large screen interaction --> <bool name="config_improveLargeScreenInteractionOnLockscreen">false</bool> </resources>
packages/SystemUI/src/com/android/systemui/bouncer/data/repository/BouncerRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,13 @@ constructor( val isOneHandedBouncerSupportedInConfig: Boolean get() = applicationContext.resources.getBoolean(R.bool.can_use_one_handed_bouncer) /** Whether improved large screen interaction is enabled for this device */ val isImproveLargeScreenInteractionEnabledInConfig: Boolean get() = applicationContext.resources.getBoolean( R.bool.config_improveLargeScreenInteractionOnLockscreen ) /** * Preferred side of the screen where the input area on the bouncer should be. This is * applicable for large screen devices (foldables and tablets). Loading
packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt +4 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,10 @@ constructor( (repository.isOneHandedBouncerSupportedInConfig && (authMethod !is Password)) } /** Whether interactions should be improved for large-screen (non-handheld) form factor. */ val isImproveLargeScreenInteractionEnabled: Boolean = repository.isImproveLargeScreenInteractionEnabledInConfig /** * Preferred side of the screen where the input area on the bouncer should be. This is * applicable for large screen devices (foldables and tablets). Loading
packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerOverlayContentViewModel.kt +37 −23 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import androidx.compose.ui.input.key.type import androidx.core.graphics.drawable.toBitmap import com.android.app.tracing.coroutines.launchTraced as launch import com.android.app.tracing.coroutines.traceCoroutine import com.android.systemui.Flags import com.android.systemui.authentication.domain.interactor.AuthenticationInteractor import com.android.systemui.authentication.shared.model.AuthenticationMethodModel import com.android.systemui.authentication.shared.model.AuthenticationWipeModel Loading Loading @@ -132,6 +133,14 @@ 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() Loading Loading @@ -208,13 +217,15 @@ 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 && Loading @@ -223,7 +234,8 @@ constructor( bouncerInteractor.setPreferredBouncerInputSide( if ( lastRecordedNotificationTouchPosition < applicationContext.resources.displayMetrics.widthPixels / 2 applicationContext.resources.displayMetrics .widthPixels / 2 ) { BouncerInputSide.LEFT } else { Loading @@ -233,6 +245,7 @@ constructor( } } } } launch { bouncerInteractor.isUserSwitcherVisible.collect { Loading Loading @@ -377,6 +390,7 @@ constructor( * input UI is not present. */ fun onDoubleTap(wasEventOnNonInputHalfOfScreen: Boolean) { if (disableDoubleClickSwap) return if (!wasEventOnNonInputHalfOfScreen) return if (_isInputPreferredOnLeftSide.value) { bouncerInteractor.setPreferredBouncerInputSide(BouncerInputSide.RIGHT) Loading