mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 02:36:12 -04:00
refactor(aap): Send InitExt unconditionally to all devices
Older devices silently ignore the 0x4D packet, so there is no need to gate it per model. Sending it unconditionally prevents silent feature degradation when new H2+ models are added without the flag. Remove needsInitExt from PodModel.Features.
This commit is contained in:
-1
@@ -349,7 +349,6 @@ class DefaultAapDeviceProfileNewSettingsTest : BaseAapSessionTest() {
|
||||
f.hasListeningModeCycle shouldBe true
|
||||
f.hasAllowOffOption shouldBe true
|
||||
f.hasEarDetectionToggle shouldBe true
|
||||
f.needsInitExt shouldBe true
|
||||
// Headphone — no stem/swipe/dual-pod/case features
|
||||
f.hasDualPods shouldBe false
|
||||
f.hasCase shouldBe false
|
||||
|
||||
+1
-11
@@ -57,19 +57,9 @@ class DefaultAapDeviceProfileTest : BaseAapSessionTest() {
|
||||
|
||||
@Nested
|
||||
inner class InitExtTests {
|
||||
@Test
|
||||
fun `returned for Pro 2`() { DefaultAapDeviceProfile(PodModel.AIRPODS_PRO2).encodeInitExt().shouldNotBeNull() }
|
||||
@Test fun `returned for Pro 3`() { DefaultAapDeviceProfile(PodModel.AIRPODS_PRO3).encodeInitExt().shouldNotBeNull() }
|
||||
@Test fun `returned for AP4 ANC`() { DefaultAapDeviceProfile(PodModel.AIRPODS_GEN4_ANC).encodeInitExt().shouldNotBeNull() }
|
||||
@Test
|
||||
fun `null for basic AirPods`() { DefaultAapDeviceProfile(PodModel.AIRPODS_GEN3).encodeInitExt().shouldBeNull() }
|
||||
@Test fun `null for Pro 1`() { DefaultAapDeviceProfile(PodModel.AIRPODS_PRO).encodeInitExt().shouldBeNull() }
|
||||
@Test fun `null for Max`() { DefaultAapDeviceProfile(PodModel.AIRPODS_MAX).encodeInitExt().shouldBeNull() }
|
||||
@Test fun `returned for Max 2`() { DefaultAapDeviceProfile(PodModel.AIRPODS_MAX2).encodeInitExt().shouldNotBeNull() }
|
||||
|
||||
@Test
|
||||
fun `has correct command byte`() {
|
||||
profile.encodeInitExt()!![4] shouldBe 0x4d.toByte()
|
||||
profile.encodeInitExt()[4] shouldBe 0x4d.toByte()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user