summaryrefslogtreecommitdiffstats
path: root/telephony/java/android
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2010-08-13 15:19:11 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-13 15:19:11 -0700
commit31202b1a40e7daccf69e284492494f9ff739f324 (patch)
tree5526b212286c58713061cfd9d5e5c7548d8444a6 /telephony/java/android
parentd22a1e896cbc7e86d57be9923d749b017b3cde79 (diff)
parent3f442ece257d416b48f7803a4cc263f0215faa0d (diff)
downloadframeworks_base-31202b1a40e7daccf69e284492494f9ff739f324.zip
frameworks_base-31202b1a40e7daccf69e284492494f9ff739f324.tar.gz
frameworks_base-31202b1a40e7daccf69e284492494f9ff739f324.tar.bz2
am 3f442ece: Merge "Fix character count bug and Javadoc typos in SMS (with test cases)" into gingerbread
Merge commit '3f442ece257d416b48f7803a4cc263f0215faa0d' into gingerbread-plus-aosp * commit '3f442ece257d416b48f7803a4cc263f0215faa0d': Fix character count bug and Javadoc typos in SMS (with test cases)
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/telephony/gsm/SmsMessage.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/telephony/java/android/telephony/gsm/SmsMessage.java b/telephony/java/android/telephony/gsm/SmsMessage.java
index 37ef912..0c63c37 100644
--- a/telephony/java/android/telephony/gsm/SmsMessage.java
+++ b/telephony/java/android/telephony/gsm/SmsMessage.java
@@ -304,9 +304,9 @@ public class SmsMessage {
int septets = GsmAlphabet.countGsmSeptets(messageBody, !use7bitOnly);
ret[1] = septets;
if (septets > MAX_USER_DATA_SEPTETS) {
- ret[0] = (septets / MAX_USER_DATA_SEPTETS_WITH_HEADER) + 1;
- ret[2] = MAX_USER_DATA_SEPTETS_WITH_HEADER
- - (septets % MAX_USER_DATA_SEPTETS_WITH_HEADER);
+ ret[0] = (septets + (MAX_USER_DATA_SEPTETS_WITH_HEADER - 1)) /
+ MAX_USER_DATA_SEPTETS_WITH_HEADER;
+ ret[2] = (ret[0] * MAX_USER_DATA_SEPTETS_WITH_HEADER) - septets;
} else {
ret[0] = 1;
ret[2] = MAX_USER_DATA_SEPTETS - septets;
@@ -318,9 +318,9 @@ public class SmsMessage {
ret[1] = messageBody.length();
if (octets > MAX_USER_DATA_BYTES) {
// 6 is the size of the user data header
- ret[0] = (octets / MAX_USER_DATA_BYTES_WITH_HEADER) + 1;
- ret[2] = (MAX_USER_DATA_BYTES_WITH_HEADER
- - (octets % MAX_USER_DATA_BYTES_WITH_HEADER))/2;
+ ret[0] = (octets + (MAX_USER_DATA_BYTES_WITH_HEADER - 1)) /
+ MAX_USER_DATA_BYTES_WITH_HEADER;
+ ret[2] = ((ret[0] * MAX_USER_DATA_BYTES_WITH_HEADER) - octets) / 2;
} else {
ret[0] = 1;
ret[2] = (MAX_USER_DATA_BYTES - octets)/2;