Loading src/java/com/android/internal/telephony/InboundSmsHandler.java +3 −2 Original line number Diff line number Diff line Loading @@ -793,6 +793,7 @@ public abstract class InboundSmsHandler extends StateMachine { byte[][] pdus; int destPort = tracker.getDestPort(); boolean block = false; String address = tracker.getAddress(); // Do not process when the message count is invalid. if (messageCount <= 0) { Loading @@ -810,7 +811,6 @@ public abstract class InboundSmsHandler extends StateMachine { Cursor cursor = null; try { // used by several query selection arguments String address = tracker.getAddress(); String refNumber = Integer.toString(tracker.getReferenceNumber()); String count = Integer.toString(tracker.getMessageCount()); Loading Loading @@ -917,7 +917,8 @@ public abstract class InboundSmsHandler extends StateMachine { } output.write(pdu, 0, pdu.length); } int result = mWapPush.dispatchWapPdu(output.toByteArray(), resultReceiver, this); int result = mWapPush.dispatchWapPdu(output.toByteArray(), resultReceiver, this, address); if (DBG) log("dispatchWapPdu() returned " + result); // result is Activity.RESULT_OK if an ordered broadcast was sent if (result == Activity.RESULT_OK) { Loading src/java/com/android/internal/telephony/WapPushOverSms.java +22 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import android.provider.Telephony.Sms.Intents; import android.telephony.Rlog; import android.telephony.SmsManager; import android.telephony.SubscriptionManager; import android.text.TextUtils; import android.util.Log; import com.android.internal.telephony.uicc.IccUtils; Loading Loading @@ -325,6 +326,21 @@ public class WapPushOverSms implements ServiceConnection { * to applications */ public int dispatchWapPdu(byte[] pdu, BroadcastReceiver receiver, InboundSmsHandler handler) { return dispatchWapPdu(pdu, receiver, handler, null); } /** * Dispatches inbound messages that are in the WAP PDU format. See * wap-230-wsp-20010705-a section 8 for details on the WAP PDU format. * * @param pdu The WAP PDU, made up of one or more SMS PDUs * @param address The originating address * @return a result code from {@link android.provider.Telephony.Sms.Intents}, or * {@link Activity#RESULT_OK} if the message has been broadcast * to applications */ public int dispatchWapPdu(byte[] pdu, BroadcastReceiver receiver, InboundSmsHandler handler, String address) { DecodedResult result = decodeWapPdu(pdu, handler); if (result.statusCode != Activity.RESULT_OK) { return result.statusCode; Loading Loading @@ -360,6 +376,9 @@ public class WapPushOverSms implements ServiceConnection { intent.putExtra("data", result.intentData); intent.putExtra("contentTypeParameters", result.contentTypeParameters); SubscriptionManager.putPhoneIdAndSubIdExtra(intent, result.phoneId); if (!TextUtils.isEmpty(address)) { intent.putExtra("address", address); } int procRet = wapPushMan.processMessage( result.wapAppId, result.contentType, intent); Loading Loading @@ -391,6 +410,9 @@ public class WapPushOverSms implements ServiceConnection { intent.putExtra("data", result.intentData); intent.putExtra("contentTypeParameters", result.contentTypeParameters); SubscriptionManager.putPhoneIdAndSubIdExtra(intent, result.phoneId); if (!TextUtils.isEmpty(address)) { intent.putExtra("address", address); } // Direct the intent to only the default MMS app. If we can't find a default MMS app // then sent it to all broadcast receivers. Loading tests/telephonytests/src/com/android/internal/telephony/WapPushOverSmsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public class WapPushOverSmsTest extends TelephonyTest { (byte) 0xFF }; mWapPushOverSmsUT.dispatchWapPdu(pdu, null, mInboundSmsHandler); mWapPushOverSmsUT.dispatchWapPdu(pdu, null, mInboundSmsHandler, "123456"); ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class); verify(mInboundSmsHandler).dispatchIntent(intentArgumentCaptor.capture(), Loading @@ -97,6 +97,7 @@ public class WapPushOverSmsTest extends TelephonyTest { assertEquals(Telephony.Sms.Intents.WAP_PUSH_DELIVER_ACTION, intent.getAction()); assertEquals(0xFF, intent.getIntExtra("transactionId", 0)); assertEquals(0x06, intent.getIntExtra("pduType", 0)); assertEquals("123456", intent.getStringExtra("address")); byte[] header = intent.getByteArrayExtra("header"); assertEquals(2, header.length); Loading Loading
src/java/com/android/internal/telephony/InboundSmsHandler.java +3 −2 Original line number Diff line number Diff line Loading @@ -793,6 +793,7 @@ public abstract class InboundSmsHandler extends StateMachine { byte[][] pdus; int destPort = tracker.getDestPort(); boolean block = false; String address = tracker.getAddress(); // Do not process when the message count is invalid. if (messageCount <= 0) { Loading @@ -810,7 +811,6 @@ public abstract class InboundSmsHandler extends StateMachine { Cursor cursor = null; try { // used by several query selection arguments String address = tracker.getAddress(); String refNumber = Integer.toString(tracker.getReferenceNumber()); String count = Integer.toString(tracker.getMessageCount()); Loading Loading @@ -917,7 +917,8 @@ public abstract class InboundSmsHandler extends StateMachine { } output.write(pdu, 0, pdu.length); } int result = mWapPush.dispatchWapPdu(output.toByteArray(), resultReceiver, this); int result = mWapPush.dispatchWapPdu(output.toByteArray(), resultReceiver, this, address); if (DBG) log("dispatchWapPdu() returned " + result); // result is Activity.RESULT_OK if an ordered broadcast was sent if (result == Activity.RESULT_OK) { Loading
src/java/com/android/internal/telephony/WapPushOverSms.java +22 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import android.provider.Telephony.Sms.Intents; import android.telephony.Rlog; import android.telephony.SmsManager; import android.telephony.SubscriptionManager; import android.text.TextUtils; import android.util.Log; import com.android.internal.telephony.uicc.IccUtils; Loading Loading @@ -325,6 +326,21 @@ public class WapPushOverSms implements ServiceConnection { * to applications */ public int dispatchWapPdu(byte[] pdu, BroadcastReceiver receiver, InboundSmsHandler handler) { return dispatchWapPdu(pdu, receiver, handler, null); } /** * Dispatches inbound messages that are in the WAP PDU format. See * wap-230-wsp-20010705-a section 8 for details on the WAP PDU format. * * @param pdu The WAP PDU, made up of one or more SMS PDUs * @param address The originating address * @return a result code from {@link android.provider.Telephony.Sms.Intents}, or * {@link Activity#RESULT_OK} if the message has been broadcast * to applications */ public int dispatchWapPdu(byte[] pdu, BroadcastReceiver receiver, InboundSmsHandler handler, String address) { DecodedResult result = decodeWapPdu(pdu, handler); if (result.statusCode != Activity.RESULT_OK) { return result.statusCode; Loading Loading @@ -360,6 +376,9 @@ public class WapPushOverSms implements ServiceConnection { intent.putExtra("data", result.intentData); intent.putExtra("contentTypeParameters", result.contentTypeParameters); SubscriptionManager.putPhoneIdAndSubIdExtra(intent, result.phoneId); if (!TextUtils.isEmpty(address)) { intent.putExtra("address", address); } int procRet = wapPushMan.processMessage( result.wapAppId, result.contentType, intent); Loading Loading @@ -391,6 +410,9 @@ public class WapPushOverSms implements ServiceConnection { intent.putExtra("data", result.intentData); intent.putExtra("contentTypeParameters", result.contentTypeParameters); SubscriptionManager.putPhoneIdAndSubIdExtra(intent, result.phoneId); if (!TextUtils.isEmpty(address)) { intent.putExtra("address", address); } // Direct the intent to only the default MMS app. If we can't find a default MMS app // then sent it to all broadcast receivers. Loading
tests/telephonytests/src/com/android/internal/telephony/WapPushOverSmsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public class WapPushOverSmsTest extends TelephonyTest { (byte) 0xFF }; mWapPushOverSmsUT.dispatchWapPdu(pdu, null, mInboundSmsHandler); mWapPushOverSmsUT.dispatchWapPdu(pdu, null, mInboundSmsHandler, "123456"); ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class); verify(mInboundSmsHandler).dispatchIntent(intentArgumentCaptor.capture(), Loading @@ -97,6 +97,7 @@ public class WapPushOverSmsTest extends TelephonyTest { assertEquals(Telephony.Sms.Intents.WAP_PUSH_DELIVER_ACTION, intent.getAction()); assertEquals(0xFF, intent.getIntExtra("transactionId", 0)); assertEquals(0x06, intent.getIntExtra("pduType", 0)); assertEquals("123456", intent.getStringExtra("address")); byte[] header = intent.getByteArrayExtra("header"); assertEquals(2, header.length); Loading