lpa: treat any AT+CCHO error as non-eUICC in is_euicc (#37979)

This commit is contained in:
Trey Moen
2026-05-07 14:31:58 -07:00
committed by GitHub
parent 6420e8d92a
commit b7725c5cbb
+3 -4
View File
@@ -774,13 +774,12 @@ class TiciLPA(LPABase):
raise LPAError(f"EnableProfile failed: {PROFILE_ERROR_CODES.get(code, 'unknown')} (0x{code:02X})")
def is_euicc(self) -> bool:
# +CCHO:<n> -> eUICC; bare ERROR -> applet absent, non-eUICC; +CME ERROR -> applet
# exists but bus busy or modem in transient state, still eUICC.
# +CCHO:<n> -> ISD-R applet present, eUICC. Any error -> non-eUICC.
with self._acquire_lock():
try:
lines = self._client.query(f'AT+CCHO="{ISDR_AID}"')
except RuntimeError as e:
return "+CME ERROR" in str(e)
except RuntimeError:
return False
for line in lines:
if line.startswith("+CCHO:") and (ch := line.split(":", 1)[1].strip()):
try: