summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2012-07-23 14:42:33 -0700
committerJake Hamby <jhamby@google.com>2012-07-25 13:52:22 -0700
commit34661b1e9381d56b168777e3f18f6f9f2ad305c1 (patch)
treefc014690bbe72742cdd1015b6e8f1da40ead1789 /src
parent08bf1a57eb310c99b9994ef23b944441ae33aa2b (diff)
downloadframeworks_opt_telephony-34661b1e9381d56b168777e3f18f6f9f2ad305c1.zip
frameworks_opt_telephony-34661b1e9381d56b168777e3f18f6f9f2ad305c1.tar.gz
frameworks_opt_telephony-34661b1e9381d56b168777e3f18f6f9f2ad305c1.tar.bz2
Fix detection of CDMA cell broadcast messages.
The bIsServicePresent field of an incoming CDMA SMS RIL message is not a reliable way to distinguish broadcast from point-to-point messages on some RILs. Change CDMA SmsMessage.getMessageType() to return MESSAGE_TYPE_BROADCAST when the service category is not 0, and MESSAGE_TYPE_POINT_TO_POINT when the service category is 0. Bug: 6853691 Change-Id: I0d44a8ce0bb295da5125271db90652570d655bc1
Diffstat (limited to 'src')
-rw-r--r--src/java/com/android/internal/telephony/cdma/SmsMessage.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/com/android/internal/telephony/cdma/SmsMessage.java b/src/java/com/android/internal/telephony/cdma/SmsMessage.java
index 6254a50..fc61bae 100644
--- a/src/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/src/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -468,7 +468,13 @@ public class SmsMessage extends SmsMessageBase {
* {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#MESSAGE_TYPE_ACKNOWLEDGE},
*/
/* package */ int getMessageType() {
- return mEnvelope.messageType;
+ // NOTE: mEnvelope.messageType is not set correctly for cell broadcasts with some RILs.
+ // Use the service category parameter to detect CMAS and other cell broadcast messages.
+ if (mEnvelope.serviceCategory != 0) {
+ return SmsEnvelope.MESSAGE_TYPE_BROADCAST;
+ } else {
+ return SmsEnvelope.MESSAGE_TYPE_POINT_TO_POINT;
+ }
}
/**