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

Unverified Commit 1482a9db authored by Sebastiano Barezzi's avatar Sebastiano Barezzi Committed by Michael Bestas
Browse files

SystemUI: Allow skipping mirroring confirmation dialog



* As of Android 14, when a user hooks up to an external
  display android asks if you are okay with mirroring your
  screen.
* But on some devices that dock, the internal display is
  physically inaccessible, turns off when docked, or the
  "external" display is effectively the primary (devkits).
  Which makes it impossible or very difficult to click to
  allow mirroring.
* So this just allows those devices to opt-in to bypass
  the prompt.

Co-authored-by: default avatarNolen Johnson <johnsonnolen@gmail.com>
Change-Id: I711a6fb6c471cbc0774bbd06debf306d6f12e31a
parent 9dda482d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.systemui.display.ui.viewmodel

import android.app.Dialog
import android.content.Context
import android.os.SystemProperties
import android.provider.Settings.Secure.MIRROR_BUILT_IN_DISPLAY
import android.util.Log
import android.view.Display.DEFAULT_DISPLAY
@@ -128,6 +129,12 @@ constructor(
        concurrentDisplaysInProgress: Boolean,
    ) {
        dismissDialog()

        if (SystemProperties.getBoolean(DISABLE_MIRRORING_CONFIRMATION_DIALOG, false)) {
            scope.launch(context = bgDispatcher) { pendingDisplay.enable() }
            return
        }

        dialog =
            bottomSheetFactoryDeprecated
                .createDialog(
@@ -273,5 +280,7 @@ constructor(

    private companion object {
        const val TAG: String = "ConnectingDisplayViewModel"
        private const val DISABLE_MIRRORING_CONFIRMATION_DIALOG =
            "persist.sysui.disable_mirroring_confirmation_dialog"
    }
}