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
This commit is contained in:
committed by
The Android Open Source Project
parent
a3ed3b62d1
commit
f8563f5108
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user