external displays: mirror/extend switch
Add a mirror/extend built-in display switch. Make minor changes to DisplayTopology.kt for consistency and correctness. Kotlin requires the two preference key names are different since they are in the same namespace, so fix the name in the existing DisplayTopology.kt module. Make DisplayTopologyPreference responsible, rather than the caller, for setting its persistence property, since a wrong value may cause unusual behavior. The setOrder calls are necessary to prevent the new switch from appearing below the Built-in display category when a display is hot-plugged in after showing the UI. We set them on all top-level preferences (not just the two we are fixing) for consistency. Flag: com.android.settings.flags.display_topology_pane_in_display_list Test: atest ExternalDisplayPreferenceFragmentTest.java Bug: b/352648432 Bug: b/366056921 Change-Id: Ib0072dd75066758903cc48c2d1e7142e1d921f67
This commit is contained in:
@@ -157,7 +157,7 @@ class TopologyScale(
|
||||
}
|
||||
}
|
||||
|
||||
const val PREFERENCE_KEY = "display_topology_preference"
|
||||
const val TOPOLOGY_PREFERENCE_KEY = "display_topology_preference"
|
||||
|
||||
/** Padding in pane coordinate pixels on each side of a display block. */
|
||||
const val BLOCK_PADDING = 2f
|
||||
@@ -220,7 +220,8 @@ class DisplayTopologyPreference(context : Context)
|
||||
// Prevent highlight when hovering with mouse.
|
||||
isSelectable = false
|
||||
|
||||
key = PREFERENCE_KEY
|
||||
key = TOPOLOGY_PREFERENCE_KEY
|
||||
isPersistent = false
|
||||
|
||||
injector = Injector(context)
|
||||
}
|
||||
|
Reference in New Issue
Block a user