Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 735c91f2 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed that the device crashes when receiving data sms

handleSmsReceivedIntent only handles SMS_DELIVER_ACTION.
When data SMS arrives, it crashes inside handleSmsReceivedIntent
due to log.wtf. Moved the handling function inside normal
SMS handling section.

The crash was newly introduced by ag/1646046.

Test: Telephony sanity tests
bug: 35841838
Change-Id: I8611c9242b7201bafa64018503361f1f8b48236f
parent 0f27c56b
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -1105,23 +1105,25 @@ public abstract class InboundSmsHandler extends StateMachine {
                    intent.putExtra("uri", uri.toString());
                }
            }
        } else {
            intent.setAction(Intents.DATA_SMS_RECEIVED_ACTION);
            Uri uri = Uri.parse("sms://localhost:" + destPort);
            intent.setData(uri);
            intent.setComponent(null);
        }

            // Handle app specific sms messages.
            AppSmsManager appManager = mPhone.getAppSmsManager();
            if (appManager.handleSmsReceivedIntent(intent)) {
                // The AppSmsManager handled this intent, we're done.
                dropSms(resultReceiver);
                return;
            }
        } else {
            intent.setAction(Intents.DATA_SMS_RECEIVED_ACTION);
            Uri uri = Uri.parse("sms://localhost:" + destPort);
            intent.setData(uri);
            intent.setComponent(null);
        }

        Bundle options = handleSmsWhitelisting(intent.getComponent());
        dispatchIntent(intent, android.Manifest.permission.RECEIVE_SMS,
                AppOpsManager.OP_RECEIVE_SMS, options, resultReceiver, UserHandle.SYSTEM);
    }
    }

    /**
     * Function to check if message should be dropped because same message has already been