Ignore ACTION_VOICEMAIL_SMS_RECEIVED with unparsable SMS
With ag/1338663 ACTION_VOICEMAIL_SMS_RECEIVED will still be sent if the
message body matches the carrier regex but is not parsable.
Currently the client does not understand anything else and it is
unlikely to be sent by real servers so just ignore it.
Bug: 30954955
Change-Id: I31ecd9fb0cfb79a6ac99bd272752c7dc15890ab6
diff --git a/src/com/android/phone/vvm/omtp/sms/OmtpMessageReceiver.java b/src/com/android/phone/vvm/omtp/sms/OmtpMessageReceiver.java
index 0d49ebe..397caf8 100644
--- a/src/com/android/phone/vvm/omtp/sms/OmtpMessageReceiver.java
+++ b/src/com/android/phone/vvm/omtp/sms/OmtpMessageReceiver.java
@@ -81,6 +81,11 @@
.getString(VoicemailContract.EXTRA_VOICEMAIL_SMS_PREFIX);
Bundle data = intent.getExtras().getBundle(VoicemailContract.EXTRA_VOICEMAIL_SMS_FIELDS);
+ if (eventType == null || data == null) {
+ VvmLog.e(TAG, "Unparsable VVM SMS received, ignoring");
+ return;
+ }
+
if (eventType.equals(OmtpConstants.SYNC_SMS_PREFIX)) {
SyncMessage message = new SyncMessage(data);