summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/display/data/repository/DisplayRepository.kt21
1 files changed, 16 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/display/data/repository/DisplayRepository.kt b/packages/SystemUI/src/com/android/systemui/display/data/repository/DisplayRepository.kt
index 82b032450938..01d689e584c0 100644
--- a/packages/SystemUI/src/com/android/systemui/display/data/repository/DisplayRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/display/data/repository/DisplayRepository.kt
@@ -175,24 +175,35 @@ constructor(
initialValue = emptySet()
)
+ private val connectedExternalDisplayIds: Flow<Set<Int>> =
+ connectedDisplayIds
+ .map { connectedDisplayIds ->
+ connectedDisplayIds
+ .filter { id -> displayManager.getDisplay(id)?.type == Display.TYPE_EXTERNAL }
+ .toSet()
+ }
+ .flowOn(backgroundCoroutineDispatcher)
+ .debugLog("connectedExternalDisplayIds")
+
/**
* Pending displays are the ones connected, but not enabled and not ignored. A connected display
* is ignored after the user makes the decision to use it or not. For now, the initial decision
* from the user is final and not reversible.
*/
private val pendingDisplayIds: Flow<Set<Int>> =
- combine(enabledDisplayIds, connectedDisplayIds, ignoredDisplayIds) {
+ combine(enabledDisplayIds, connectedExternalDisplayIds, ignoredDisplayIds) {
enabledDisplaysIds,
- connectedDisplayIds,
+ connectedExternalDisplayIds,
ignoredDisplayIds ->
if (DEBUG) {
Log.d(
TAG,
- "combining enabled: $enabledDisplaysIds, " +
- "connected: $connectedDisplayIds, ignored: $ignoredDisplayIds"
+ "combining enabled=$enabledDisplaysIds, " +
+ "connectedExternalDisplayIds=$connectedExternalDisplayIds, " +
+ "ignored=$ignoredDisplayIds"
)
}
- connectedDisplayIds - enabledDisplaysIds - ignoredDisplayIds
+ connectedExternalDisplayIds - enabledDisplaysIds - ignoredDisplayIds
}
.debugLog("pendingDisplayIds")