diff options
| author | 2018-08-21 22:27:27 +0000 | |
|---|---|---|
| committer | 2018-08-21 22:27:27 +0000 | |
| commit | b29e727b32ec93f3471a4adab4a67079c9fb4ad4 (patch) | |
| tree | 8d78ec87a936c63056e80eee576a965af8b1a7d8 | |
| parent | 6d891937a38220b0c712a1927f969e74bea3a0f3 (diff) | |
| parent | 353bed11558dcd3ad55f89f2bd4139054fa0f63f (diff) | |
Merge "Pass correct parameters to API sendMultipartTextMessage"
| -rw-r--r-- | telephony/java/android/telephony/SmsManager.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 38bc64036de0..6cec9771a27d 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -272,6 +272,17 @@ public final class SmsManager { 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. * * <p class="note"><strong>Note:</strong> Using this method requires that your app has the @@ -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) { |