Remove PhoneConstants.SIM_ID_1
It is not recommended to use PhoneConstants.SIM_ID_1 as it is @hide API.
Bug: 130142364
Test: Manually checked the basic behaviors.
Change-Id: I8bb4c54e4625594619d04b8806c9585574d9b06d
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index e0e98f0..c68dd83 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -367,7 +367,7 @@
mStkContext[slotId].mStkServiceState = STATE_NOT_EXIST;
//Check other StkService state.
//If all StkServices are not available, stop itself and uninstall apk.
- for (i = PhoneConstants.SIM_ID_1; i < mSimCount; i++) {
+ for (i = 0; i < mSimCount; i++) {
if (i != slotId
&& (mStkService[i] != null)
&& (mStkContext[i].mStkServiceState == STATE_UNKNOWN
@@ -630,7 +630,7 @@
case OP_BOOT_COMPLETED:
CatLog.d(LOG_TAG, " OP_BOOT_COMPLETED");
int i = 0;
- for (i = PhoneConstants.SIM_ID_1; i < mSimCount; i++) {
+ for (i = 0; i < mSimCount; i++) {
if (mStkContext[i].mMainCmd != null) {
break;
}
@@ -681,7 +681,7 @@
break;
case OP_LOCALE_CHANGED:
CatLog.d(LOG_TAG, "Locale Changed");
- for (int slot = PhoneConstants.SIM_ID_1; slot < mSimCount; slot++) {
+ for (int slot = 0; slot < mSimCount; slot++) {
checkForSetupEvent(LANGUAGE_SELECTION_EVENT, (Bundle) msg.obj, slot);
}
// rename all registered notification channels on locale change
@@ -703,7 +703,7 @@
handleStopTone(msg, slotId);
break;
case OP_USER_ACTIVITY:
- for (int slot = PhoneConstants.SIM_ID_1; slot < mSimCount; slot++) {
+ for (int slot = 0; slot < mSimCount; slot++) {
checkForSetupEvent(USER_ACTIVITY_EVENT, null, slot);
}
break;
@@ -1132,7 +1132,7 @@
mStkContext[slotId].mCurrentMenu = null;
mStkContext[slotId].mMainCmd = null;
//Check other setup menu state. If all setup menu are removed, uninstall apk.
- for (i = PhoneConstants.SIM_ID_1; i < mSimCount; i++) {
+ for (i = 0; i < mSimCount; i++) {
if (i != slotId && mStkContext[i].mSetupMenuState != STATE_NOT_EXIST) {
CatLog.d(LOG_TAG, "Not Uninstall App:" + i + ","
+ mStkContext[i].mSetupMenuState);
@@ -1736,7 +1736,7 @@
private synchronized void unregisterUserPresentReceiver(int slotId) {
if (mUserPresentReceiver != null) {
- for (int slot = PhoneConstants.SIM_ID_1; slot < mSimCount; slot++) {
+ for (int slot = 0; slot < mSimCount; slot++) {
if (slot != slotId) {
if (mStkContext[slot].mNotificationOnKeyguard) {
// The broadcast receiver is still necessary for other SIM card.
@@ -1781,7 +1781,7 @@
}
private void unregisterEvent(int event, int slotId) {
- for (int slot = PhoneConstants.SIM_ID_1; slot < mSimCount; slot++) {
+ for (int slot = 0; slot < mSimCount; slot++) {
if (slot != slotId) {
if (mStkContext[slot].mSetupEventListSettings != null) {
if (findEvent(event, mStkContext[slot].mSetupEventListSettings.eventList)) {
@@ -1893,7 +1893,7 @@
private void unregisterProcessObserver(AppInterface.CommandType command, int slotId) {
// Check if there is any pending command which still needs the process observer
// except for the current command and slot.
- for (int slot = PhoneConstants.SIM_ID_1; slot < mSimCount; slot++) {
+ for (int slot = 0; slot < mSimCount; slot++) {
if (command != AppInterface.CommandType.SET_UP_IDLE_MODE_TEXT || slot != slotId) {
if (mStkContext[slot].mIdleModeTextCmd != null
&& !mStkContext[slot].mIdleModeTextVisible) {