handle NPE for findAppRequestInfoSmsIntentLocked

If this NPE happens on a binder thread (when onFilterComplete() is
called), it leaves the InboundSmsHandler state machine in a bad state as
the binder thread crashes and SMS_DELIVER intent is never broadcast. The
call flow is CarrierServicesSmsFilterCallback.onFilterComplete() ->
InboundSmsHandler.dispatchSmsDeliveryIntent() ->
AppSmsManager.handleSmsReceivedIntent() ->
AppSmsManager.findAppRequestInfoSmsIntentLocked()

Bug: 63797078
Bug: 65599291
Test: Manual
Change-Id: I06181f7ce30585d091f5ecedce8107cfc75d9dd2
(cherry picked from commit 226f2f36139db0d9e29d1855e96993fc9f4653da)
(cherry picked from commit c6363866ca843d6f209ec84ecb0bc09a31ef742f)
diff --git a/src/java/com/android/internal/telephony/AppSmsManager.java b/src/java/com/android/internal/telephony/AppSmsManager.java
index f2a783f..11e7f10 100644
--- a/src/java/com/android/internal/telephony/AppSmsManager.java
+++ b/src/java/com/android/internal/telephony/AppSmsManager.java
@@ -129,7 +129,7 @@
         }
         StringBuilder fullMessageBuilder = new StringBuilder();
         for (SmsMessage message : messages) {
-            if (message.getMessageBody() == null) {
+            if (message == null || message.getMessageBody() == null) {
                 continue;
             }
             fullMessageBuilder.append(message.getMessageBody());