diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-08-20 09:42:31 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-08-20 09:42:31 -0700 |
commit | 79dbf5616c72262355bb66bf1a2f70da5ceea015 (patch) | |
tree | 5d269e5cd63e03825977ca4885922f3c3a57865a /src | |
parent | 4a558a7b6494361fb0b3ac5ebb4f40f8e778ac5f (diff) | |
parent | 342f21b85d51d4216192a4e8b9fe6d6706b9bb3e (diff) | |
download | frameworks_opt_telephony-79dbf5616c72262355bb66bf1a2f70da5ceea015.zip frameworks_opt_telephony-79dbf5616c72262355bb66bf1a2f70da5ceea015.tar.gz frameworks_opt_telephony-79dbf5616c72262355bb66bf1a2f70da5ceea015.tar.bz2 |
am 342f21b8: am a462a18c: Merge "Telephony: Fix SmsManager to throw IllegalArgumentException"
* commit '342f21b85d51d4216192a4e8b9fe6d6706b9bb3e':
Telephony: Fix SmsManager to throw IllegalArgumentException
Diffstat (limited to 'src')
-rw-r--r-- | src/java/android/telephony/SmsManager.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/java/android/telephony/SmsManager.java b/src/java/android/telephony/SmsManager.java index 44bdaeb..deffebc 100644 --- a/src/java/android/telephony/SmsManager.java +++ b/src/java/android/telephony/SmsManager.java @@ -98,8 +98,13 @@ public final class SmsManager { * @param text the original message. Must not be null. * @return an <code>ArrayList</code> of strings that, in order, * comprise the original message + * + * @throws IllegalArgumentException if text is null */ public ArrayList<String> divideMessage(String text) { + if (null == text) { + throw new IllegalArgumentException("text is null"); + } return SmsMessage.fragmentText(text); } @@ -242,11 +247,15 @@ public final class SmsManager { * STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT) * @return true for success * + * @throws IllegalArgumentException if pdu is NULL * {@hide} */ public boolean copyMessageToIcc(byte[] smsc, byte[] pdu, int status) { boolean success = false; + if (null == pdu) { + throw new IllegalArgumentException("pdu is NULL"); + } try { ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms")); if (iccISms != null) { @@ -414,11 +423,15 @@ public final class SmsManager { * @return true if successful, false otherwise * @see #disableCellBroadcastRange(int, int) * + * @throws IllegalArgumentException if endMessageId < startMessageId * {@hide} */ public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) { boolean success = false; + if (endMessageId < startMessageId) { + throw new IllegalArgumentException("endMessageId < startMessageId"); + } try { ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms")); if (iccISms != null) { @@ -445,11 +458,15 @@ public final class SmsManager { * * @see #enableCellBroadcastRange(int, int) * + * @throws IllegalArgumentException if endMessageId < startMessageId * {@hide} */ public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) { boolean success = false; + if (endMessageId < startMessageId) { + throw new IllegalArgumentException("endMessageId < startMessageId"); + } try { ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms")); if (iccISms != null) { |