fix(config): isAutoMode reads raw package mode
getPackageModeForUid collapses AUTO -> PATCH/GENERATE at the call site based on DeviceAttestationService.isTeeFunctional, so isAutoMode never observed Mode.AUTO and always returned false. That made the isAuto-gated dispatch arms in KeyMintSecurityLevelInterceptor and the entire raceTeePatch path unreachable. Iterate packageModes directly with the same priority order as getPackageModeForUid: first non-null mode wins. AUTO returns true, PATCH and GENERATE return false. Activates raceTeePatch for AUTO packages on the first generateKey per security level.
This commit is contained in:
@@ -93,7 +93,16 @@ object ConfigurationManager {
|
|||||||
|
|
||||||
fun shouldSkipUid(uid: Int): Boolean = getPackageModeForUid(uid) == null
|
fun shouldSkipUid(uid: Int): Boolean = getPackageModeForUid(uid) == null
|
||||||
|
|
||||||
fun isAutoMode(uid: Int): Boolean = getPackageModeForUid(uid) == Mode.AUTO
|
fun isAutoMode(uid: Int): Boolean {
|
||||||
|
for (pkg in getPackagesForUid(uid)) {
|
||||||
|
when (packageModes[pkg]) {
|
||||||
|
Mode.GENERATE, Mode.PATCH -> return false
|
||||||
|
Mode.AUTO -> return true
|
||||||
|
null -> continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
private fun getPackageModeForUid(uid: Int): Mode? {
|
private fun getPackageModeForUid(uid: Int): Mode? {
|
||||||
val packages = getPackagesForUid(uid)
|
val packages = getPackagesForUid(uid)
|
||||||
|
|||||||
Reference in New Issue
Block a user