From d58a70865ce09b0705c2959931bb50acfb38eaf2 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 12 Jun 2026 02:22:47 +0200 Subject: [PATCH] saip: add ProfileElementHeader.mandatory_service_present() probe Change-Id: I5a28a50c767bd2dd0e5a7954e3633743a0155856 --- pySim/esim/saip/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index ec59c50..996753b 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -1517,8 +1517,11 @@ class ProfileElementHeader(ProfileElement): def mandatory_service_add(self, service_name): self.decoded['eUICC-Mandatory-services'][service_name] = None + def mandatory_service_present(self, service_name): + return service_name in self.decoded['eUICC-Mandatory-services'].keys() + def mandatory_service_remove(self, service_name): - if service_name in self.decoded['eUICC-Mandatory-services'].keys(): + if self.mandatory_service_present(service_name): del self.decoded['eUICC-Mandatory-services'][service_name] else: raise ValueError("service not in eUICC-Mandatory-services list, cannot remove")