msm8974-common: libril: The index value shall be -1 if there is no relevant application

The index value for GSM/CDMA/IMS application shall be -1 if there is no
relevant application according to the comment written for CardStatus
structure in radio/types.hal, so it shall be initialized to -1.

Bug: 63967442
Test: Confirm that the index values are correctly initialized.

Change-Id: I692e9049145d0f0c3c57879c25d0697879c76b39
This commit is contained in:
Ryuto Sawada 2017-07-21 23:18:50 +09:00 committed by Kevin F. Haggerty
parent 0902dcd5a7
commit 1dbd1b2145
No known key found for this signature in database
GPG Key ID: 6D95512933112729

2
ril/libril/ril_service.cpp Normal file → Executable file
View File

@ -3025,7 +3025,7 @@ int radio::getIccCardStatusResponse(int slotId,
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
CardStatus cardStatus = {};
CardStatus cardStatus = {CardState::ABSENT, PinState::UNKNOWN, -1, -1, -1, {}};
RIL_CardStatus_v6 *p_cur = ((RIL_CardStatus_v6 *) response);
if (response == NULL || responseLen != sizeof(RIL_CardStatus_v6)
|| p_cur->gsm_umts_subscription_app_index >= p_cur->num_applications