private static long getSiminfoIdBySimSlotId(
     int slotId, List<EncapsulatedSimInfoManager> simInfoList) {
   for (EncapsulatedSimInfoManager siminfo : simInfoList) {
     if (siminfo.getSlot() == slotId) {
       return siminfo.getSlot();
     }
   }
   return UNDEFINED_SLOT_ID;
 }
 private static void handleSimHotSwap(Activity activity, int slotId) {
   List<EncapsulatedSimInfoManager> temp =
       EncapsulatedSimInfoManager.getInsertedSimInfoList(activity);
   MmsLog.d(LOG_TAG, "slot id = " + slotId);
   if (getSiminfoIdBySimSlotId(slotId, temp) == UNDEFINED_SLOT_ID) {
     activity.finish();
   }
 }