Add null check for received intent.

Test: TH
Bug: 195590965
Merged-In: Ic4f0f525c8e9f703eded2a0fd32fbfee1b2359c9
Change-Id: Ic4f0f525c8e9f703eded2a0fd32fbfee1b2359c9
diff --git a/src/java/com/android/internal/telephony/InboundSmsHandler.java b/src/java/com/android/internal/telephony/InboundSmsHandler.java
index c937ee1..c56ed45 100644
--- a/src/java/com/android/internal/telephony/InboundSmsHandler.java
+++ b/src/java/com/android/internal/telephony/InboundSmsHandler.java
@@ -28,6 +28,7 @@
 import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA;
 
 import android.annotation.IntDef;
+import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.app.Activity;
 import android.app.AppOpsManager;
@@ -1704,10 +1705,15 @@
 
         @Override
         public void onReceive(Context context, Intent intent) {
+            if (intent == null) {
+                logeWithLocalLog("onReceive: received null intent, faking " + mWaitingForIntent,
+                        mInboundSmsTracker.getMessageId());
+                return;
+            }
             handleAction(intent, true);
         }
 
-        private synchronized void handleAction(Intent intent, boolean onReceive) {
+        private synchronized void handleAction(@NonNull Intent intent, boolean onReceive) {
             String action = intent.getAction();
             if (mWaitingForIntent == null || !mWaitingForIntent.getAction().equals(action)) {
                 logeWithLocalLog("handleAction: Received " + action + " when expecting "