Ignore invalid action for LegacyVociemailNotificationReceiver
Somehow a null action will be sent to the receiver.
Bug: 64934925
Test: LegacyVoicemailNotificationReceiveverTest
PiperOrigin-RevId: 167300542
Change-Id: Ifa001d102d265e1dad42806b48f0a1710d05b195
diff --git a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
index d681df2..4e43704 100644
--- a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
+++ b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
@@ -55,6 +55,12 @@
@Override
public void onReceive(Context context, Intent intent) {
+
+ if (!TelephonyManager.ACTION_SHOW_VOICEMAIL_NOTIFICATION.equals(intent.getAction())
+ && !VoicemailClient.ACTION_SHOW_LEGACY_VOICEMAIL.equals(intent.getAction())) {
+ return;
+ }
+
LogUtil.i(
"LegacyVoicemailNotificationReceiver.onReceive", "received legacy voicemail notification");
if (!BuildCompat.isAtLeastO()) {