summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorTakaoka G. Tadashi <takaoka@google.com>2009-12-02 20:48:07 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-02 20:48:07 -0800
commitcc602381656b13dfc20e51ef1dc4302364ea82dc (patch)
tree40b78b0d10d69ea4e94256ae37434596a8591df6 /telephony
parentbdb9b3042ad019bede603fe2fa0aed8ba5217876 (diff)
parent949851525a1aebca0d7d6b9a3465d5e572c8c621 (diff)
downloadframeworks_base-cc602381656b13dfc20e51ef1dc4302364ea82dc.zip
frameworks_base-cc602381656b13dfc20e51ef1dc4302364ea82dc.tar.gz
frameworks_base-cc602381656b13dfc20e51ef1dc4302364ea82dc.tar.bz2
am 94985152: am d5b325aa: Add WSP header to WAP_PUSH_RECEIVED intent in addition to data Import CL 146651 from //branches/cupcake_dcm
Merge commit '949851525a1aebca0d7d6b9a3465d5e572c8c621' * commit '949851525a1aebca0d7d6b9a3465d5e572c8c621': Add WSP header to WAP_PUSH_RECEIVED intent in addition to data
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/WapPushOverSms.java34
1 files changed, 23 insertions, 11 deletions
diff --git a/telephony/java/com/android/internal/telephony/WapPushOverSms.java b/telephony/java/com/android/internal/telephony/WapPushOverSms.java
index 4deb29c..a636a4b 100644
--- a/telephony/java/com/android/internal/telephony/WapPushOverSms.java
+++ b/telephony/java/com/android/internal/telephony/WapPushOverSms.java
@@ -161,28 +161,31 @@ public class WapPushOverSms {
}
index += pduDecoder.getDecodedDataLength();
- int dataIndex = headerStartIndex + headerLength;
boolean dispatchedByApplication = false;
switch (binaryContentType) {
case WspTypeDecoder.CONTENT_TYPE_B_PUSH_CO:
- dispatchWapPdu_PushCO(pdu, transactionId, pduType);
+ dispatchWapPdu_PushCO(pdu, transactionId, pduType, headerStartIndex, headerLength);
dispatchedByApplication = true;
break;
case WspTypeDecoder.CONTENT_TYPE_B_MMS:
- dispatchWapPdu_MMS(pdu, transactionId, pduType, dataIndex);
+ dispatchWapPdu_MMS(pdu, transactionId, pduType, headerStartIndex, headerLength);
dispatchedByApplication = true;
break;
default:
break;
}
if (dispatchedByApplication == false) {
- dispatchWapPdu_default(pdu, transactionId, pduType, mimeType, dataIndex);
+ dispatchWapPdu_default(pdu, transactionId, pduType, mimeType,
+ headerStartIndex, headerLength);
}
return Activity.RESULT_OK;
}
- private void dispatchWapPdu_default(
- byte[] pdu, int transactionId, int pduType, String mimeType, int dataIndex) {
+ private void dispatchWapPdu_default(byte[] pdu, int transactionId, int pduType,
+ String mimeType, int headerStartIndex, int headerLength) {
+ byte[] header = new byte[headerLength];
+ System.arraycopy(pdu, headerStartIndex, header, 0, header.length);
+ int dataIndex = headerStartIndex + headerLength;
byte[] data;
data = new byte[pdu.length - dataIndex];
@@ -192,31 +195,40 @@ public class WapPushOverSms {
intent.setType(mimeType);
intent.putExtra("transactionId", transactionId);
intent.putExtra("pduType", pduType);
+ intent.putExtra("header", header);
intent.putExtra("data", data);
mSmsDispatcher.dispatch(intent, "android.permission.RECEIVE_WAP_PUSH");
}
- private void dispatchWapPdu_PushCO(byte[] pdu, int transactionId, int pduType) {
+ private void dispatchWapPdu_PushCO(byte[] pdu, int transactionId, int pduType,
+ int headerStartIndex, int headerLength) {
+ byte[] header = new byte[headerLength];
+ System.arraycopy(pdu, headerStartIndex, header, 0, header.length);
+
Intent intent = new Intent(Intents.WAP_PUSH_RECEIVED_ACTION);
intent.setType(WspTypeDecoder.CONTENT_MIME_TYPE_B_PUSH_CO);
intent.putExtra("transactionId", transactionId);
intent.putExtra("pduType", pduType);
+ intent.putExtra("header", header);
intent.putExtra("data", pdu);
mSmsDispatcher.dispatch(intent, "android.permission.RECEIVE_WAP_PUSH");
}
- private void dispatchWapPdu_MMS(byte[] pdu, int transactionId, int pduType, int dataIndex) {
- byte[] data;
-
- data = new byte[pdu.length - dataIndex];
+ private void dispatchWapPdu_MMS(byte[] pdu, int transactionId, int pduType,
+ int headerStartIndex, int headerLength) {
+ byte[] header = new byte[headerLength];
+ System.arraycopy(pdu, headerStartIndex, header, 0, header.length);
+ int dataIndex = headerStartIndex + headerLength;
+ byte[] data = new byte[pdu.length - dataIndex];
System.arraycopy(pdu, dataIndex, data, 0, data.length);
Intent intent = new Intent(Intents.WAP_PUSH_RECEIVED_ACTION);
intent.setType(WspTypeDecoder.CONTENT_MIME_TYPE_B_MMS);
intent.putExtra("transactionId", transactionId);
intent.putExtra("pduType", pduType);
+ intent.putExtra("header", header);
intent.putExtra("data", data);
mSmsDispatcher.dispatch(intent, "android.permission.RECEIVE_MMS");