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

Commit a366fc70 authored by Daniel Akinola's avatar Daniel Akinola
Browse files

Don't show dialog when device is in kiosk mode & extended mode

If a device is extended mode and in kiosk mode, then we should go
straight into mirroring without showing the dialog at all

Bug: 429288575
Test: manual testing
Flag: com.android.window.flags.enable_updated_display_connection_dialog
Change-Id: Ida4437f9cfcec4734cd1a882d1b818c3823e0a79
parent 068427d1
Loading
Loading
Loading
Loading
+22 −12
Original line number Diff line number Diff line
@@ -188,18 +188,28 @@ constructor(

        val isInExtendedMode = desktopState.isDesktopModeSupportedOnDisplay(DEFAULT_DISPLAY)

        if (isInKioskMode) {
        when {
            isInKioskMode && isInExtendedMode -> {
                pendingDisplay.enableForMirroring()
            }
            isInKioskMode -> {
                dismissDialog()
            pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode)
        } else if (isInExtendedMode) {
                pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode = true)
            }
            isInExtendedMode -> {
                pendingDisplay.enableForDesktop()
                showExtendedDisplayConnectionToast()
        } else {
            }
            else -> {
                when (pendingDisplay.connectionType) {
                    DESKTOP -> pendingDisplay.enableForDesktop()
                    MIRROR -> pendingDisplay.enableForMirroring()
                    NOT_SPECIFIED ->
                    pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode)
                        pendingDisplay.showNewDialog(
                            concurrentDisplaysInProgress,
                            isInKioskMode = false,
                        )
                }
            }
        }
    }