From b6027186c0861890481cead1f5e0f17a6308be7f Mon Sep 17 00:00:00 2001 From: darken Date: Sun, 7 Sep 2025 11:55:00 +0200 Subject: [PATCH] Distinguish between UNKNOWN and missing profile This commit modifies the `AppleFactory` to correctly handle `PodDevice.Model.UNKNOWN`. Previously, if a device's model was `UNKNOWN`, it wouldn't match any profile and `isIRKMatch` would be false. This change ensures that `isIRKMatch` reflects the actual IRK match status, regardless of whether a specific profile is found. Devices with an `UNKNOWN` model can now match profiles that are also marked as `UNKNOWN`, allowing for generic profile matching when the specific model isn't identified. --- .../main/java/eu/darken/capod/pods/core/apple/AppleFactory.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/pods/core/apple/AppleFactory.kt b/app/src/main/java/eu/darken/capod/pods/core/apple/AppleFactory.kt index 60c40cce..d3ec4af2 100644 --- a/app/src/main/java/eu/darken/capod/pods/core/apple/AppleFactory.kt +++ b/app/src/main/java/eu/darken/capod/pods/core/apple/AppleFactory.kt @@ -98,7 +98,7 @@ class AppleFactory @Inject constructor( meta = ApplePods.AppleMeta(), ) profile = profiles - .filter { it.model == tempDevice.model } + .filter { it.model == PodDevice.Model.UNKNOWN || it.model == tempDevice.model } .filter { it.minimumSignalQuality <= tempDevice.signalQuality } .firstOrNull() } @@ -107,7 +107,7 @@ class AppleFactory @Inject constructor( scanResult = scanResult, payload = payload, meta = ApplePods.AppleMeta( - isIRKMatch = profile != null, + isIRKMatch = isIrkMatch, profile = profile, ), )