Loading packages/SystemUI/src/com/android/systemui/display/ui/view/ExternalDisplayConnectionDialogDelegate.kt +18 −6 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ class ExternalDisplayConnectionDialogDelegate @AssistedInject constructor( @Application private val context: Context, @Assisted private val showConcurrentDisplayInfo: Boolean = false, @Assisted("showConcurrentDisplayInfo") private val showConcurrentDisplayInfo: Boolean = false, @Assisted("isInKioskMode") private val isInKioskMode: Boolean = false, @Assisted private val rememberChoiceCheckBoxListener: CompoundButton.OnCheckedChangeListener, @Assisted("onStartDesktop") private val onStartDesktopClickListener: View.OnClickListener, @Assisted("onStartMirroring") private val onStartMirroringClickListener: View.OnClickListener, Loading Loading @@ -79,15 +80,25 @@ constructor( desktopButton = dialog.requireViewById<Button>(R.id.start_desktop_mode).apply { setOnClickListener(onStartDesktopClickListener) if (isInKioskMode) { visibility = View.GONE } else { visibility = View.VISIBLE setOnClickListener { optionSelected = true onStartDesktopClickListener.onClick(this) } } } mirrorButton = dialog.requireViewById<Button>(R.id.start_mirroring).apply { setOnClickListener(onStartMirroringClickListener) setOnClickListener { optionSelected = true onStartMirroringClickListener.onClick(this) } } dismissButton = dialog.requireViewById<Button>(R.id.cancel).apply { setOnClickListener(onCancelClickListener) Loading Loading @@ -159,7 +170,8 @@ constructor( @AssistedFactory interface Factory { fun create( showConcurrentDisplayInfo: Boolean, @Assisted("showConcurrentDisplayInfo") showConcurrentDisplayInfo: Boolean, @Assisted("isInKioskMode") isInKioskMode: Boolean, rememberChoiceCheckBoxListener: CompoundButton.OnCheckedChangeListener, @Assisted("onStartDesktop") onStartDesktopClickListener: View.OnClickListener, @Assisted("onStartMirroring") onStartMirroringClickListener: View.OnClickListener, Loading packages/SystemUI/src/com/android/systemui/display/ui/viewmodel/ConnectingDisplayViewModel.kt +16 −5 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package com.android.systemui.display.ui.viewmodel import android.app.ActivityManager import android.app.ActivityManager.LOCK_TASK_MODE_LOCKED import android.app.Dialog import android.content.Context import android.provider.Settings.Secure.MIRROR_BUILT_IN_DISPLAY Loading Loading @@ -73,6 +75,7 @@ constructor( private val context: Context, private val desktopState: DesktopState, private val secureSettings: SecureSettings, private val activityManager: ActivityManager, private val connectedDisplayInteractor: ConnectedDisplayInteractor, @Application private val scope: CoroutineScope, @Background private val bgDispatcher: CoroutineDispatcher, Loading Loading @@ -137,7 +140,10 @@ constructor( .apply { show() } } private fun PendingDisplay.showNewDialog(showConcurrentDisplayInfo: Boolean) { private fun PendingDisplay.showNewDialog( showConcurrentDisplayInfo: Boolean, isInKioskMode: Boolean, ) { var saveChoice = false dismissDialog() Loading @@ -152,6 +158,7 @@ constructor( }, insetsProvider = { getInsetsOf(context, displayCutout() or navigationBars()) }, showConcurrentDisplayInfo = showConcurrentDisplayInfo, isInKioskMode = isInKioskMode, ) dialog = Loading @@ -173,14 +180,20 @@ constructor( return } if (isInExtendedMode()) { val isInKioskMode = activityManager.lockTaskModeState == LOCK_TASK_MODE_LOCKED val isInExtendedMode = desktopState.isDesktopModeSupportedOnDisplay(DEFAULT_DISPLAY) if (isInKioskMode) { pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode) } else if (isInExtendedMode) { pendingDisplay.enableForDesktop() showExtendedDisplayConnectionToast() } else { when (pendingDisplay.connectionType) { DESKTOP -> pendingDisplay.enableForDesktop() MIRROR -> pendingDisplay.enableForMirroring() NOT_SPECIFIED -> pendingDisplay.showNewDialog(concurrentDisplaysInProgress) NOT_SPECIFIED -> pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode) } } } Loading Loading @@ -231,8 +244,6 @@ constructor( dialog = null } private fun isInExtendedMode() = desktopState.isDesktopModeSupportedOnDisplay(DEFAULT_DISPLAY) private fun showExtendedDisplayConnectionToast() = Toast.makeText(context, R.string.connected_display_extended_mode_text, LENGTH_LONG).show() Loading Loading
packages/SystemUI/src/com/android/systemui/display/ui/view/ExternalDisplayConnectionDialogDelegate.kt +18 −6 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ class ExternalDisplayConnectionDialogDelegate @AssistedInject constructor( @Application private val context: Context, @Assisted private val showConcurrentDisplayInfo: Boolean = false, @Assisted("showConcurrentDisplayInfo") private val showConcurrentDisplayInfo: Boolean = false, @Assisted("isInKioskMode") private val isInKioskMode: Boolean = false, @Assisted private val rememberChoiceCheckBoxListener: CompoundButton.OnCheckedChangeListener, @Assisted("onStartDesktop") private val onStartDesktopClickListener: View.OnClickListener, @Assisted("onStartMirroring") private val onStartMirroringClickListener: View.OnClickListener, Loading Loading @@ -79,15 +80,25 @@ constructor( desktopButton = dialog.requireViewById<Button>(R.id.start_desktop_mode).apply { setOnClickListener(onStartDesktopClickListener) if (isInKioskMode) { visibility = View.GONE } else { visibility = View.VISIBLE setOnClickListener { optionSelected = true onStartDesktopClickListener.onClick(this) } } } mirrorButton = dialog.requireViewById<Button>(R.id.start_mirroring).apply { setOnClickListener(onStartMirroringClickListener) setOnClickListener { optionSelected = true onStartMirroringClickListener.onClick(this) } } dismissButton = dialog.requireViewById<Button>(R.id.cancel).apply { setOnClickListener(onCancelClickListener) Loading Loading @@ -159,7 +170,8 @@ constructor( @AssistedFactory interface Factory { fun create( showConcurrentDisplayInfo: Boolean, @Assisted("showConcurrentDisplayInfo") showConcurrentDisplayInfo: Boolean, @Assisted("isInKioskMode") isInKioskMode: Boolean, rememberChoiceCheckBoxListener: CompoundButton.OnCheckedChangeListener, @Assisted("onStartDesktop") onStartDesktopClickListener: View.OnClickListener, @Assisted("onStartMirroring") onStartMirroringClickListener: View.OnClickListener, Loading
packages/SystemUI/src/com/android/systemui/display/ui/viewmodel/ConnectingDisplayViewModel.kt +16 −5 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package com.android.systemui.display.ui.viewmodel import android.app.ActivityManager import android.app.ActivityManager.LOCK_TASK_MODE_LOCKED import android.app.Dialog import android.content.Context import android.provider.Settings.Secure.MIRROR_BUILT_IN_DISPLAY Loading Loading @@ -73,6 +75,7 @@ constructor( private val context: Context, private val desktopState: DesktopState, private val secureSettings: SecureSettings, private val activityManager: ActivityManager, private val connectedDisplayInteractor: ConnectedDisplayInteractor, @Application private val scope: CoroutineScope, @Background private val bgDispatcher: CoroutineDispatcher, Loading Loading @@ -137,7 +140,10 @@ constructor( .apply { show() } } private fun PendingDisplay.showNewDialog(showConcurrentDisplayInfo: Boolean) { private fun PendingDisplay.showNewDialog( showConcurrentDisplayInfo: Boolean, isInKioskMode: Boolean, ) { var saveChoice = false dismissDialog() Loading @@ -152,6 +158,7 @@ constructor( }, insetsProvider = { getInsetsOf(context, displayCutout() or navigationBars()) }, showConcurrentDisplayInfo = showConcurrentDisplayInfo, isInKioskMode = isInKioskMode, ) dialog = Loading @@ -173,14 +180,20 @@ constructor( return } if (isInExtendedMode()) { val isInKioskMode = activityManager.lockTaskModeState == LOCK_TASK_MODE_LOCKED val isInExtendedMode = desktopState.isDesktopModeSupportedOnDisplay(DEFAULT_DISPLAY) if (isInKioskMode) { pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode) } else if (isInExtendedMode) { pendingDisplay.enableForDesktop() showExtendedDisplayConnectionToast() } else { when (pendingDisplay.connectionType) { DESKTOP -> pendingDisplay.enableForDesktop() MIRROR -> pendingDisplay.enableForMirroring() NOT_SPECIFIED -> pendingDisplay.showNewDialog(concurrentDisplaysInProgress) NOT_SPECIFIED -> pendingDisplay.showNewDialog(concurrentDisplaysInProgress, isInKioskMode) } } } Loading Loading @@ -231,8 +244,6 @@ constructor( dialog = null } private fun isInExtendedMode() = desktopState.isDesktopModeSupportedOnDisplay(DEFAULT_DISPLAY) private fun showExtendedDisplayConnectionToast() = Toast.makeText(context, R.string.connected_display_extended_mode_text, LENGTH_LONG).show() Loading