Remove SIM Tookit from the launcher screen if no main menu is available
SIM Toolkit has a logic to remove itself from the launcher screen once
it becomes unnecessary, but the condition is wrong. It is removed when
all the SIM cards go into ABSENT state in the current implementation,
but it must be executed when the number of active main menu becomes 0.
Bug: 159662728
Test: Manually confirmed all the possible SIM removal scenarios.
Change-Id: I8091bf6ea82df873335cce3477a6c759735ed79b
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index e86c138..c507171 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -727,12 +727,12 @@
== AppInterface.CommandType.PLAY_TONE.value()) {
terminateTone(slotId);
}
+ if (!uninstallIfUnnecessary()) {
+ addToMenuSystemOrUpdateLabel();
+ }
if (isAllOtherCardsAbsent(slotId)) {
CatLog.d(LOG_TAG, "All CARDs are ABSENT");
- StkAppInstaller.uninstall(StkAppService.this);
stopSelf();
- } else {
- addToMenuSystemOrUpdateLabel();
}
} else {
IccRefreshResponse state = new IccRefreshResponse();