From 8369df095a73a77b3715f8ae7ba06089cebca4ce Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Wed, 3 May 2017 10:27:13 -0700 Subject: This change reflects the Dialer V10 RC00 branch. RC00 is based on: branch: dialer-android_release_branch/153304843.1 synced to: 153304843 following the instructions at go/dialer-aosp-release. In this release: * Removes final apache sources. * Uses native lite compilation. More drops will follow with subsequent release candidates until we reach our final v10 release, in cadence with our prebuilt drops. Test: TreeHugger, on device Change-Id: Ic9684057230f9b579c777820c746cd21bf45ec0f --- .../android/voicemail/impl/fetch/FetchVoicemailReceiver.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'java/com/android/voicemail/impl/fetch') diff --git a/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java b/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java index b0285672e..0348a60c5 100644 --- a/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java +++ b/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java @@ -120,6 +120,16 @@ public class FetchVoicemailReceiver extends BroadcastReceiver { new PhoneAccountHandle( ComponentName.unflattenFromString(cursor.getString(PHONE_ACCOUNT_COMPONENT_NAME)), cursor.getString(PHONE_ACCOUNT_ID)); + TelephonyManager telephonyManager = + context + .getSystemService(TelephonyManager.class) + .createForPhoneAccountHandle(mPhoneAccount); + if (telephonyManager == null) { + // can happen when trying to fetch voicemails from a SIM that is no longer on the + // device + VvmLog.e(TAG, "account no longer valid, cannot retrieve message"); + return; + } if (!VvmAccountManager.isAccountActivated(context, mPhoneAccount)) { mPhoneAccount = getAccountFromMarshmallowAccount(context, mPhoneAccount); if (mPhoneAccount == null) { -- cgit v1.2.3