Browse Source

EuiccChannelManagerService: Stop throwing exceptions for USB channels when switching

Peter Cai 1 year ago
parent
commit
a87f154653

+ 2 - 1
app-common/src/main/java/im/angry/openeuicc/service/EuiccChannelManagerService.kt

@@ -476,8 +476,9 @@ class EuiccChannelManagerService : LifecycleService(), OpenEuiccContextMarker {
                     throw RuntimeException("Could not switch profile")
                     throw RuntimeException("Could not switch profile")
                 }
                 }
 
 
-                if (!refreshed) {
+                if (!refreshed && slotId != EuiccChannelManager.USB_CHANNEL_ID) {
                     // We may have switched the profile, but we could not refresh. Tell the caller about this
                     // We may have switched the profile, but we could not refresh. Tell the caller about this
+                    // but only if we are talking to a modem and not a USB reader
                     throw SwitchingProfilesRefreshException()
                     throw SwitchingProfilesRefreshException()
                 }
                 }