mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
update odin 2 bugfix to handle other languages
This commit is contained in:
parent
80f3fdb45b
commit
0572930c70
1 changed files with 6 additions and 2 deletions
|
|
@ -91,8 +91,12 @@ class SecondaryDisplay(val context: Context) : DisplayManager.DisplayListener {
|
|||
currentDisplayId = preferredDisplayId
|
||||
displays.first { it.displayId == preferredDisplayId }
|
||||
} else {
|
||||
// prioritize a display without the word "Built" in name if it exists
|
||||
currentDisplayId = displays.firstOrNull{!it.name.contains("Built",true)}?.displayId ?: displays[0].displayId
|
||||
val dm = context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
|
||||
val default = dm.displays.first {it.displayId == Display.DEFAULT_DISPLAY}
|
||||
// prioritize displays that have a different name from the default display, as
|
||||
// some devices such as the Odin 2 create a permanent virtual display with the same
|
||||
// name as the default display that should be skipped in most cases
|
||||
currentDisplayId = displays.firstOrNull{it.name != default.name && !it.name.contains("Built",true)}?.displayId ?: displays[0].displayId
|
||||
displays.first{ it.displayId == currentDisplayId }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue