​[Bug] Foreground task crashes with RuntimeException when switching profile on physical slot (ESTK) #331

Open
opened 2026-04-19 18:05:56 +02:00 by pes · 2 comments

1. Environment

  • Device / Model: OnePlus CPH2653
  • OS Version: SDK 36 (Android 16 / OxygenOS 16)
  • App Version: v1.6.2-2-gda34c32-priv
  • Hardware: ESTK physical eSIM card (inserted in physical slot 2, recognized as slotId=1)

2. Description

In the Android 16 environment, the app successfully establishes an OMAPI logical channel and reads the profile list from the card. However, when attempting to send a profile switch (Enable/Disable) command, the foreground service encounters an unrecoverable exception and crashes. The app fails to catch or gracefully handle the underlying rejection of the write operation.

3. Steps to Reproduce

  1. Insert the ESTK card into physical slot 1 (SIM 2 slot).
  2. Launch the app. The app successfully executes onGetEuiccProfileInfoList slotId=1 in the background, and the UI displays the read profile list normally.
  3. Tap to open the operations menu (PopupWindow).
  4. Tap to trigger a Profile switch operation.
  5. After the system logs LPAUtils: Latest notification is 0 before operation, the app crashes immediately.

4. Crash Log

After clicking switch, the EuiccChannelManagerService directly throws a RuntimeException:

04-19 23:59:00.587  6582 15790 D LPAUtils: Latest notification is 0 before operation
04-19 23:59:00.848  6582  6582 E EuiccChannelManagerService: Foreground task encountered an error
04-19 23:59:00.848  6582  6582 E EuiccChannelManagerService: java.lang.RuntimeException: Could not switch profile
04-19 23:59:00.848  6582  6582 E EuiccChannelManagerService: 	at im.angry.openeuicc.service.EuiccChannelManagerService$launchProfileSwitchTask$1.invokeSuspend(EuiccChannelManagerService.kt:521)
04-19 23:59:00.848  6582  6582 E EuiccChannelManagerService: 	at im.angry.openeuicc.service.EuiccChannelManagerService$launchProfileSwitchTask$1.invoke(Unknown Source:8)
04-19 23:59:00.848  6582  6582 E EuiccChannelManagerService: 	at im.angry.openeuicc.service.EuiccChannelManagerService$launchForegroundTask$2$1.invokeSuspend(EuiccChannelManagerService.kt:296)

### 1. Environment * **Device / Model:** OnePlus CPH2653 * **OS Version:** SDK 36 (Android 16 / OxygenOS 16) * **App Version:** v1.6.2-2-gda34c32-priv * **Hardware:** ESTK physical eSIM card (inserted in physical slot 2, recognized as slotId=1) ### 2. Description In the Android 16 environment, the app successfully establishes an OMAPI logical channel and reads the profile list from the card. However, when attempting to send a profile switch (Enable/Disable) command, the foreground service encounters an unrecoverable exception and crashes. The app fails to catch or gracefully handle the underlying rejection of the write operation. ### 3. Steps to Reproduce 1. Insert the ESTK card into physical slot 1 (SIM 2 slot). 2. Launch the app. The app successfully executes onGetEuiccProfileInfoList slotId=1 in the background, and the UI displays the read profile list normally. 3. Tap to open the operations menu (PopupWindow). 4. Tap to trigger a Profile switch operation. 5. After the system logs LPAUtils: Latest notification is 0 before operation, the app crashes immediately. ### 4. Crash Log After clicking switch, the EuiccChannelManagerService directly throws a RuntimeException: ```text 04-19 23:59:00.587 6582 15790 D LPAUtils: Latest notification is 0 before operation 04-19 23:59:00.848 6582 6582 E EuiccChannelManagerService: Foreground task encountered an error 04-19 23:59:00.848 6582 6582 E EuiccChannelManagerService: java.lang.RuntimeException: Could not switch profile 04-19 23:59:00.848 6582 6582 E EuiccChannelManagerService: at im.angry.openeuicc.service.EuiccChannelManagerService$launchProfileSwitchTask$1.invokeSuspend(EuiccChannelManagerService.kt:521) 04-19 23:59:00.848 6582 6582 E EuiccChannelManagerService: at im.angry.openeuicc.service.EuiccChannelManagerService$launchProfileSwitchTask$1.invoke(Unknown Source:8) 04-19 23:59:00.848 6582 6582 E EuiccChannelManagerService: at im.angry.openeuicc.service.EuiccChannelManagerService$launchForegroundTask$2$1.invokeSuspend(EuiccChannelManagerService.kt:296) ```
Owner

Please enable "verbose logging" in settings, reproduce this crash, and then upload that logs. We unfortunately CANNOT fix anything without verbose logging turned on.

Please enable "verbose logging" in settings, reproduce this crash, and then upload _that_ logs. We unfortunately CANNOT fix anything without verbose logging turned on.
Author

@PeterCxy wrote in #331 (comment):

Please enable "verbose logging" in settings, reproduce this crash, and then upload that logs. We unfortunately CANNOT fix anything without verbose logging turned on.

@PeterCxy wrote in https://gitea.angry.im/PeterCxy/OpenEUICC/issues/331#issuecomment-2251: > Please enable "verbose logging" in settings, reproduce this crash, and then upload that logs. We unfortunately CANNOT fix anything without verbose logging turned on.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PeterCxy/OpenEUICC#331
No description provided.