Stop StkAppService when no CatService is available
StkAppService does not stop itself when phone starts with no SIM card if
it is dual SIM model. That is because the initial state of CatService
(mStkService) is STATE_UNKNOWN. The state of the service must not be
checked if CatService does not exist.
Bug: 31979523
Test: Confirmed StkAppService is correctly stopped with no SIM card.
Change-Id: I22275cedbb77fb9abd259845c73b5f14dfff5fdb
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index c2c8874..c8c8e38 100755
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -313,6 +313,7 @@
//If all StkServices are not available, stop itself and uninstall apk.
for (i = PhoneConstants.SIM_ID_1; i < mSimCount; i++) {
if (i != slotId
+ && (mStkService[i] != null)
&& (mStkContext[i].mStkServiceState == STATE_UNKNOWN
|| mStkContext[i].mStkServiceState == STATE_EXIST)) {
break;