mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 23:36:04 +00:00
fix(session): run game thread hints on the SM8750P Snapdragon 8 Elite (#2914)
* fix: run game thread hints on the SM8750P Snapdragon 8 Elite * fix: gate game thread hints on the SoC model SocNames resolves * fix: skip unknown SoC model properties
This commit is contained in:
1 parent
46206b3e16
commit
31c475d5e1
4 files changed
+9
-4
No files matched your search
@@ -7,7 +7,8 @@ object SocNames {
|
||||
"SM8150" to "Snapdragon 855", "SM8250" to "Snapdragon 865", "SM8250-AC" to "Snapdragon 870",
|
||||
"SM8350" to "Snapdragon 888", "SM8450" to "Snapdragon 8 Gen 1", "SM8475" to "Snapdragon 8+ Gen 1",
|
||||
"SM8550" to "Snapdragon 8 Gen 2", "QCS8550" to "Snapdragon 8 Gen 2", "SM8650" to "Snapdragon 8 Gen 3",
|
||||
"SM8750" to "Snapdragon 8 Elite", "SM8850" to "Snapdragon 8 Elite Gen 5",
|
||||
"SM8750" to "Snapdragon 8 Elite", "SM8750P" to "Snapdragon 8 Elite",
|
||||
"SM8850" to "Snapdragon 8 Elite Gen 5",
|
||||
"SM8975" to "Snapdragon 8 Elite Extreme Gen 6",
|
||||
"SM7325" to "Snapdragon 778G", "SM7450" to "Snapdragon 7 Gen 1", "SM7550" to "Snapdragon 7 Gen 3",
|
||||
"SM6375" to "Snapdragon 695",
|
||||
@@ -23,7 +24,8 @@ object SocNames {
|
||||
val sdk = if (Build.VERSION.SDK_INT >= 31) Build.SOC_MODEL.takeIf { it != Build.UNKNOWN }.orEmpty() else ""
|
||||
return listOf(prop("ro.soc.model"), prop("ro.vendor.qti.soc_model"), sdk, prop("ro.fota.platform"))
|
||||
.map { it.trim() }
|
||||
.firstOrNull { it.isNotEmpty() && !Regex("(?i)^msm_\\d").containsMatchIn(it) }.orEmpty()
|
||||
.firstOrNull { it.isNotEmpty() && !it.equals(Build.UNKNOWN, ignoreCase = true) && !Regex("(?i)^msm_\\d").containsMatchIn(it) }
|
||||
.orEmpty()
|
||||
}
|
||||
|
||||
internal fun normalizedModel(model: String): String = model.trim().uppercase().removePrefix("QTI ").trim()
|
||||
|
||||
@@ -27,14 +27,14 @@ object GameThreadHints {
|
||||
private const val PACE_TOLERANCE = 0.08
|
||||
|
||||
private val NOT_GAMES = setOf("steam", "steamwebhelper")
|
||||
private val SOCS = setOf("CQ8725S", "SM8750")
|
||||
private val SOCS = setOf("CQ8725S", "SM8750", "SM8750P")
|
||||
|
||||
private var worker: Thread? = null
|
||||
|
||||
@Synchronized
|
||||
fun start(context: Context): String {
|
||||
if (!SessionPrefs.gameThreadHints(context)) return "game thread hints: off"
|
||||
if (Build.VERSION.SDK_INT < 31 || !supported(Build.SOC_MODEL)) return "game thread hints: Snapdragon 8 Elite only"
|
||||
if (Build.VERSION.SDK_INT < 31 || !supported(SocNames.model())) return "game thread hints: Snapdragon 8 Elite only"
|
||||
val hm = context.getSystemService(PerformanceHintManager::class.java)
|
||||
?: return "game thread hints: no PerformanceHintManager"
|
||||
val pm = context.getSystemService(PowerManager::class.java)
|
||||
|
||||
@@ -11,6 +11,7 @@ class SocNamesTest {
|
||||
assertEquals("SG8350P", SocNames.model(props("ro.vendor.qti.soc_model" to "SG8350P", "ro.fota.platform" to "MSM_13.0")))
|
||||
assertEquals("QCS8550", SocNames.model(props("ro.soc.model" to "QCS8550", "ro.vendor.qti.soc_model" to "other")))
|
||||
assertEquals("", SocNames.model(props("ro.fota.platform" to "MSM_13.0")))
|
||||
assertEquals("QTI SM8750P", SocNames.model(props("ro.soc.model" to "unknown", "ro.vendor.qti.soc_model" to "QTI SM8750P")))
|
||||
}
|
||||
|
||||
@Test fun knownModelsAndPlatformsGetTheirNames() {
|
||||
@@ -26,6 +27,7 @@ class SocNamesTest {
|
||||
assertEquals("Snapdragon 8 Elite Extreme Gen 6", SocNames.name("QTI SM8975", ""))
|
||||
assertEquals("Snapdragon 8 Elite Extreme Gen 6", SocNames.name(" qti sm8975 ", ""))
|
||||
assertEquals("Snapdragon 8 Elite Extreme Gen 6 (QTI SM8975)", SocNames.label("QTI SM8975", ""))
|
||||
assertEquals("Snapdragon 8 Elite", SocNames.name("QTI SM8750P", ""))
|
||||
assertNull(SocNames.name("SM89750", ""))
|
||||
assertNull(SocNames.name("SM8975-PRO", ""))
|
||||
assertNull(SocNames.name("Qualcomm SM8975", ""))
|
||||
|
||||
@@ -10,6 +10,7 @@ class GameThreadHintsTest {
|
||||
assertTrue(GameThreadHints.supported("CQ8725S"))
|
||||
assertTrue(GameThreadHints.supported("SM8750"))
|
||||
assertTrue(GameThreadHints.supported("QTI SM8750"))
|
||||
assertTrue(GameThreadHints.supported("QTI SM8750P"))
|
||||
assertFalse(GameThreadHints.supported("SM8650"))
|
||||
assertFalse(GameThreadHints.supported("SM8850"))
|
||||
assertFalse(GameThreadHints.supported(""))
|
||||
|
||||
Reference in new issue
Block a user