Enforce valid APF versions (0, 2, 3, 4, 6000, 6100)

This commit adds a check to enforce that reported APF versions are
either 0 (indicating no support) or one of the officially valid
versions: 2, 3, 4, 6000 or 6100. This ensures consistency and prevents
issues arising from device using unsupported APF versions.

Test: TH
Flag: EXEMPT bugfix
Change-Id: Icdefa89fae590ec78146df4cbd2c683b5d8258f7
This commit is contained in:
Yuyang Huang 2025-05-12 22:21:58 +09:00
commit 6807d2dd39

View file

@ -405,6 +405,8 @@ class ApfIntegrationTest {
)
@Test
fun testApfCapabilities() {
// If APF is supported, the version must be valid.
assertThat(caps.apfVersionSupported).isAnyOf(0, 2, 3, 4, 6000, 6100)
// APF became mandatory in Android 14 VSR.
val vsrApiLevel = getVsrApiLevel()
assume().that(vsrApiLevel).isAtLeast(34)