From f352f34e17401a5ab27d14aab2d939b3a12004df Mon Sep 17 00:00:00 2001 From: twyen Date: Wed, 21 Jun 2017 13:50:47 -0700 Subject: Fix assert when OmtpMessageSender received an invalid VVM config b/62666193 is one of the top crashers, the assert that the VVM config is valid has failed. This is likely caused by the PhoneAccountHandle being invalid. While the PhoneAccountHandle must be valid when the broadcast is made, the SIM might have been removed and invalidated the PhoneAccountHandle when the broadcast is still in flight. In this CL the validity is checked first. PiperOrigin-RevId: 159737846 Change-Id: Iae5a65978879fd1bfdf726008e8b6463499c99e8 --- java/com/android/voicemail/impl/sms/OmtpMessageReceiver.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'java/com/android/voicemail') diff --git a/java/com/android/voicemail/impl/sms/OmtpMessageReceiver.java b/java/com/android/voicemail/impl/sms/OmtpMessageReceiver.java index ef0bf10e9..1cf37370c 100644 --- a/java/com/android/voicemail/impl/sms/OmtpMessageReceiver.java +++ b/java/com/android/voicemail/impl/sms/OmtpMessageReceiver.java @@ -71,6 +71,10 @@ public class OmtpMessageReceiver extends BroadcastReceiver { } OmtpVvmCarrierConfigHelper helper = new OmtpVvmCarrierConfigHelper(mContext, phone); + if (!helper.isValid()) { + VvmLog.e(TAG, "vvm config no longer valid"); + return; + } if (!VisualVoicemailSettingsUtil.isEnabled(mContext, phone)) { if (helper.isLegacyModeEnabled()) { LegacyModeSmsHandler.handle(context, sms); -- cgit v1.2.3