From 6f80c367c2579fc6829fc68bed9b5c8d220709b6 Mon Sep 17 00:00:00 2001 From: twyen Date: Mon, 19 Mar 2018 13:51:04 -0700 Subject: Check null for getPhoneAccount() in VoicemailChannelUtils A phone account can be removed after calling getCallCapablePhoneAccounts(), so subsequent getPhoneAccount() can be null. Bug: 75598828 Test: In a follow up CL, where all instance of these will be fixed. PiperOrigin-RevId: 189635573 Change-Id: I897db6e8e7706bc8afe6f25d89fd2ca4405900df --- java/com/android/dialer/notification/VoicemailChannelUtils.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'java/com/android/dialer/notification') diff --git a/java/com/android/dialer/notification/VoicemailChannelUtils.java b/java/com/android/dialer/notification/VoicemailChannelUtils.java index 374619ade..ddc0f773c 100644 --- a/java/com/android/dialer/notification/VoicemailChannelUtils.java +++ b/java/com/android/dialer/notification/VoicemailChannelUtils.java @@ -180,6 +180,9 @@ import java.util.Set; @NonNull Context context, @NonNull PhoneAccountHandle handle) { PhoneAccount phoneAccount = context.getSystemService(TelecomManager.class).getPhoneAccount(handle); + if (phoneAccount == null) { + return; + } NotificationChannel channel = newChannel(context, getChannelIdForAccount(handle), phoneAccount.getLabel()); migrateVoicemailSoundSettings(context, channel, handle); -- cgit v1.2.3