summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2010-10-01 18:04:22 -0700
committerAndroid Code Review <code-review@android.com>2010-10-01 18:04:22 -0700
commit7888486d1c930301535069bd90bb0bf3525b2bb5 (patch)
treee8d25357fca71e1b3bef8e9f562adf90c0bfa9ab /telephony
parentd531c9ebe18f0b554d29d3c3b8e4a00f84dae97a (diff)
parent7d16427653e047e4901988e7ee04d637e65253b7 (diff)
downloadframeworks_base-7888486d1c930301535069bd90bb0bf3525b2bb5.zip
frameworks_base-7888486d1c930301535069bd90bb0bf3525b2bb5.tar.gz
frameworks_base-7888486d1c930301535069bd90bb0bf3525b2bb5.tar.bz2
Merge "Add subaddress to SMS fingerprint calculation."
Diffstat (limited to 'telephony')
-rw-r--r--[-rwxr-xr-x]telephony/java/com/android/internal/telephony/cdma/SmsMessage.java28
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/sms/CdmaSmsSubaddress.java27
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java12
3 files changed, 58 insertions, 9 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index b50502c..f869dbd 100755..100644
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -29,6 +29,7 @@ import com.android.internal.telephony.SmsMessageBase;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.cdma.sms.BearerData;
import com.android.internal.telephony.cdma.sms.CdmaSmsAddress;
+import com.android.internal.telephony.cdma.sms.CdmaSmsSubaddress;
import com.android.internal.telephony.cdma.sms.SmsEnvelope;
import com.android.internal.telephony.cdma.sms.UserData;
import com.android.internal.util.HexDump;
@@ -138,6 +139,7 @@ public class SmsMessage extends SmsMessageBase {
SmsMessage msg = new SmsMessage();
SmsEnvelope env = new SmsEnvelope();
CdmaSmsAddress addr = new CdmaSmsAddress();
+ CdmaSmsSubaddress subaddr = new CdmaSmsSubaddress();
byte[] data;
byte count;
int countInt;
@@ -180,15 +182,24 @@ public class SmsMessage extends SmsMessageBase {
addr.origBytes = data;
- // ignore subaddress
- p.readInt(); //p_cur->sSubAddress.subaddressType
- p.readInt(); //p_cur->sSubAddress.odd
- count = p.readByte(); //p_cur->sSubAddress.number_of_digits
- //p_cur->sSubAddress.digits[digitCount] :
- for (int index=0; index < count; index++) {
- p.readByte();
+ subaddr.type = p.readInt(); // p_cur->sSubAddress.subaddressType
+ subaddr.odd = p.readByte(); // p_cur->sSubAddress.odd
+ count = p.readByte(); // p_cur->sSubAddress.number_of_digits
+
+ if (count < 0) {
+ count = 0;
}
+ // p_cur->sSubAddress.digits[digitCount] :
+
+ data = new byte[count];
+
+ for (int index = 0; index < count; ++index) {
+ data[index] = p.readByte();
+ }
+
+ subaddr.origBytes = data;
+
/* currently not supported by the modem-lib:
env.bearerReply
env.replySeqNo
@@ -210,6 +221,7 @@ public class SmsMessage extends SmsMessageBase {
// link the the filled objects to the SMS
env.origAddress = addr;
+ env.origSubaddress = subaddr;
msg.originatingAddress = addr;
msg.mEnvelope = env;
@@ -818,6 +830,8 @@ public class SmsMessage extends SmsMessageBase {
output.write(mEnvelope.teleService);
output.write(mEnvelope.origAddress.origBytes, 0, mEnvelope.origAddress.origBytes.length);
output.write(mEnvelope.bearerData, 0, mEnvelope.bearerData.length);
+ output.write(mEnvelope.origSubaddress.origBytes, 0,
+ mEnvelope.origSubaddress.origBytes.length);
return output.toByteArray();
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/CdmaSmsSubaddress.java b/telephony/java/com/android/internal/telephony/cdma/sms/CdmaSmsSubaddress.java
new file mode 100644
index 0000000..f9cebf5
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/CdmaSmsSubaddress.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project. All rights reserved.
+ * Copyright (C) 2010 Code Aurora Forum. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.telephony.cdma.sms;
+
+public class CdmaSmsSubaddress {
+ public int type;
+
+ public byte odd;
+
+ public byte[] origBytes;
+}
+
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java b/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
index 0dcacc1..4f00163 100644
--- a/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
@@ -17,6 +17,8 @@
package com.android.internal.telephony.cdma.sms;
+import com.android.internal.telephony.cdma.sms.CdmaSmsSubaddress;
+
public final class SmsEnvelope{
/**
* Message Types
@@ -74,17 +76,23 @@ public final class SmsEnvelope{
/**
* The origination address identifies the originator of the SMS message.
- * (See 3GPP2 C.S0015-B, v2, 3.4.3.4)
+ * (See 3GPP2 C.S0015-B, v2, 3.4.3.3)
*/
public CdmaSmsAddress origAddress;
/**
* The destination address identifies the target of the SMS message.
- * (See 3GPP2 C.S0015-B, v2, 3.4.3.4)
+ * (See 3GPP2 C.S0015-B, v2, 3.4.3.3)
*/
public CdmaSmsAddress destAddress;
/**
+ * The origination subaddress identifies the originator of the SMS message.
+ * (See 3GPP2 C.S0015-B, v2, 3.4.3.4)
+ */
+ public CdmaSmsSubaddress origSubaddress;
+
+ /**
* The 6-bit bearer reply parameter is used to request the return of a
* SMS Acknowledge Message.
* (See 3GPP2 C.S0015-B, v2, 3.4.3.5)