Skip to content

Commit f364fcc

Browse files
Jake HambyAndroid (Google) Code Review
authored andcommitted
Merge "Fix detection of CDMA cell broadcast messages." into jb-dev
2 parents 7ba0178 + 15c257e commit f364fcc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

telephony/java/com/android/internal/telephony/cdma/SmsMessage.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,13 @@ public static TextEncodingDetails calculateLength(CharSequence messageBody,
468468
* {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#MESSAGE_TYPE_ACKNOWLEDGE},
469469
*/
470470
/* package */ int getMessageType() {
471-
return mEnvelope.messageType;
471+
// NOTE: mEnvelope.messageType is not set correctly for cell broadcasts with some RILs.
472+
// Use the service category parameter to detect CMAS and other cell broadcast messages.
473+
if (mEnvelope.serviceCategory != 0) {
474+
return SmsEnvelope.MESSAGE_TYPE_BROADCAST;
475+
} else {
476+
return SmsEnvelope.MESSAGE_TYPE_POINT_TO_POINT;
477+
}
472478
}
473479

474480
/**

0 commit comments

Comments
 (0)