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

Commit 1bd7ed31 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Pass correct parameters to API sendMultipartTextMessage" am: b29e727b

am: 817c9876

Change-Id: Ia01e6cd61b2332724e4bab731d620e4d597f2a1c
parents 1f90c988 817c9876
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -271,6 +271,17 @@ public final class SmsManager {
    private static String DIALOG_TYPE_KEY = "dialog_type";
    private static final int SMS_PICK = 2;

    /**
     * 3gpp2 SMS priority is not specified
     * @hide
     */
    public static final int SMS_MESSAGE_PRIORITY_NOT_SPECIFIED = -1;
    /**
     * 3gpp SMS period is not specified
     * @hide
     */
    public static final int SMS_MESSAGE_PERIOD_NOT_SPECIFIED = -1;

    /**
     * Send a text based SMS.
     *
@@ -461,11 +472,11 @@ public final class SmsManager {
        }

        if (priority < 0x00 || priority > 0x03) {
            throw new IllegalArgumentException("Invalid priority");
            priority = SMS_MESSAGE_PRIORITY_NOT_SPECIFIED;
        }

        if (validityPeriod < 0x05 || validityPeriod > 0x09b0a0) {
            throw new IllegalArgumentException("Invalid validity period");
            validityPeriod = SMS_MESSAGE_PERIOD_NOT_SPECIFIED;
        }

        try {
@@ -723,7 +734,8 @@ public final class SmsManager {
            ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents,
            int priority, boolean expectMore, int validityPeriod) {
        sendMultipartTextMessageInternal(destinationAddress, scAddress, parts, sentIntents,
                deliveryIntents, true /* persistMessage*/);
                deliveryIntents, true /* persistMessage*/, priority, expectMore,
                validityPeriod);
    }

    private void sendMultipartTextMessageInternal(
@@ -738,11 +750,11 @@ public final class SmsManager {
        }

        if (priority < 0x00 || priority > 0x03) {
            throw new IllegalArgumentException("Invalid priority");
           priority = SMS_MESSAGE_PRIORITY_NOT_SPECIFIED;
        }

        if (validityPeriod < 0x05 || validityPeriod > 0x09b0a0) {
            throw new IllegalArgumentException("Invalid validity period");
           validityPeriod = SMS_MESSAGE_PERIOD_NOT_SPECIFIED;
        }

        if (parts.size() > 1) {