Skip to content

Commit 76a68c4

Browse files
authored
Fix "Requires a newer version of Android Auto" prompt (#3491)
1 parent f6b7264 commit 76a68c4

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ private val CONFIGURATION_OPTIONS = mapOf(
9090
"com.google.android.apps.photos" to arrayOf(
9191
Flag("45617431", true, 0),
9292
),
93+
// Android Auto (Gearhead) — lift Car App Library API max for third-party apps.
94+
// Without this, AA falls back to baked-in default "DEFAULT:7, gearhead:8" which
95+
// blocks Spotify / YouTube Music (require minCarAppApiLevel=8).
96+
"com.google.android.projection.gearhead" to arrayOf(
97+
Flag("Watevra__host_max_api_level", encodeRepeatedString(listOf("DEFAULT:8")), 0),
98+
),
9399
"com.google.android.apps.translate" to arrayOf(
94100
// Enable Practice Tab
95101
Flag("SpeakEasy__enabled", true, 0),

play-services-core/src/main/kotlin/org/microg/gms/phenotype/extensions.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ fun encodeSupportedLanguageList(): ByteArray {
2121
}.toByteArray()
2222
}
2323

24+
fun encodeRepeatedString(entries: List<String>): ByteArray {
25+
val out = mutableListOf<Byte>()
26+
for (entry in entries) {
27+
val bytes = entry.toByteArray(Charsets.UTF_8)
28+
out.add(0x0A.toByte())
29+
var n = bytes.size
30+
while (n >= 0x80) {
31+
out.add(((n and 0x7F) or 0x80).toByte())
32+
n = n ushr 7
33+
}
34+
out.add(n.toByte())
35+
for (b in bytes) out.add(b)
36+
}
37+
return out.toByteArray()
38+
}
39+
2440
fun configurationsResult(configurations: Array<Configuration> = emptyArray()) = Configurations().apply {
2541
serverToken = "unknown"
2642
snapshotToken = "unknown"

0 commit comments

Comments
 (0)