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

Commit addd3f7d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed that the device crashes when receiving data sms"

parents bfd82189 735c91f2
Loading
Loading
Loading
Loading
+12 −10
Original line number Original line Diff line number Diff line
@@ -1105,23 +1105,25 @@ public abstract class InboundSmsHandler extends StateMachine {
                    intent.putExtra("uri", uri.toString());
                    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.
            // Handle app specific sms messages.
            AppSmsManager appManager = mPhone.getAppSmsManager();
            AppSmsManager appManager = mPhone.getAppSmsManager();
            if (appManager.handleSmsReceivedIntent(intent)) {
            if (appManager.handleSmsReceivedIntent(intent)) {
                // The AppSmsManager handled this intent, we're done.
                // The AppSmsManager handled this intent, we're done.
                dropSms(resultReceiver);
                dropSms(resultReceiver);
                return;
            }
        } else {
        } 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());
        Bundle options = handleSmsWhitelisting(intent.getComponent());
        dispatchIntent(intent, android.Manifest.permission.RECEIVE_SMS,
        dispatchIntent(intent, android.Manifest.permission.RECEIVE_SMS,
                AppOpsManager.OP_RECEIVE_SMS, options, resultReceiver, UserHandle.SYSTEM);
                AppOpsManager.OP_RECEIVE_SMS, options, resultReceiver, UserHandle.SYSTEM);
    }
    }
    }


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