Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a48b51d authored by Sungmin Choi's avatar Sungmin Choi Committed by The Android Automerger
Browse files

wappush: Use valid index for pdu including garbages

For some operators, pdu has garbages. As a result, device does not receive
MMS or operator some requests.
To fix it, re-index pdu to use valid index for operators.

Bug: 10492745
Change-Id: Ic7262f7369403bd060d94c5da0e09f18c96ff3db
parent f25a1346
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -96,9 +96,26 @@ public class WapPushOverSms implements ServiceConnection {

        if ((pduType != WspTypeDecoder.PDU_TYPE_PUSH) &&
                (pduType != WspTypeDecoder.PDU_TYPE_CONFIRMED_PUSH)) {
            index = mContext.getResources().getInteger(
                    com.android.internal.R.integer.config_valid_wappush_index);
            if(index != -1) {
                transactionId = pdu[index++] & 0xff;
                pduType = pdu[index++] & 0xff;
                if (DBG)
                    Rlog.d(TAG, "index = " + index + " PDU Type = " + pduType +
                            " transactionID = " + transactionId);

                // recheck wap push pduType
                if ((pduType != WspTypeDecoder.PDU_TYPE_PUSH)
                        && (pduType != WspTypeDecoder.PDU_TYPE_CONFIRMED_PUSH)) {
                    if (DBG) Rlog.w(TAG, "Received non-PUSH WAP PDU. Type = " + pduType);
                    return Intents.RESULT_SMS_HANDLED;
                }
            } else {
                if (DBG) Rlog.w(TAG, "Received non-PUSH WAP PDU. Type = " + pduType);
                return Intents.RESULT_SMS_HANDLED;
            }
        }

        WspTypeDecoder pduDecoder = new WspTypeDecoder(pdu);