Looking at the definition of the reply to RIL_REQUEST_GET_SIM_STATUS in http://androidxref.com/4.4.2_r1/xref/hardware/ril/include/telephony/ril.h
I see that if RIL_CardStatus_v6::gsm_umts_subscription_app_index value in the parcel is -1, it *should* mean that there is no GSM/UMTS application in the SIM card. However, this looks broken in many implementations (I get, for instance, index 8 for "cdma_subscription_app_index" with one phone, although "num_applications" is just one. The phone is not CDMA, so I guess the card is from a GSM operator and really has a SIM/USIM application. Maybe the right approach here is to not use the indexes in RIL_CardStatus_v6 and look directly at the array RIL_CardStatus_v6::applications, as each of them has an application type. @Ratchanan, would it be possible to obtain the full hex traces from you phone? To get them please do as root in the phone: # stop ofono # OFONO_RIL_TRACE="" OFONO_RIL_HEX_TRACE="" OFONO_RIL_DEVICE=ril ofonod -n -d -P stktest,provision,sap,udev,dun,smart,hfp >& /tmp/ofono.txt let it run for a few seconds and please attach the resulting file to the bug. -- You received this bug notification because you are a member of Ubuntu Phonedations bugs, which is subscribed to ofono in Ubuntu. https://bugs.launchpad.net/bugs/1427788 Title: rilmodem: Do not always use sim's app in status->gsm_umts_index Status in ofono package in Ubuntu: In Progress Bug description: In driver/rilmodem/sim.c, function sim_status_cb, there is a line that set variable search_index to status->gsm_utms_index. The code then checks if the card_state returned by the GET_SIM_STATUS reply is PRESENT and search_index is less than num_apps. If both are true, search_index is used to index the returned reply_sim_app array ( which leads to undefined behavior if the index is negative ) and then passed to configure_active_app(). The code should check search index, and if negative and num_apps >=1, set search_index to 0. ofono version 1.12.bzr6888+15.04.20150224 in Ubuntu 15.04 Device: LG L90 Dual (I'm doing a port.) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ofono/+bug/1427788/+subscriptions -- Mailing list: https://launchpad.net/~ubuntu-phonedations-bugs Post to : ubuntu-phonedations-bugs@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phonedations-bugs More help : https://help.launchpad.net/ListHelp