From 03faff443c5ed4ecdf3f96958ef4fa0eb09474a2 Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Fri, 20 Nov 2015 15:58:29 -0500 Subject: [PATCH] Removed lazy class SmsTransportDetails Moved constants into SmsCharacterCalculator. Closes #4788 --- .../securesms/sms/SmsTransportDetails.java | 25 ------------------- .../util/SmsCharacterCalculator.java | 11 ++++---- 2 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 src/org/thoughtcrime/securesms/sms/SmsTransportDetails.java diff --git a/src/org/thoughtcrime/securesms/sms/SmsTransportDetails.java b/src/org/thoughtcrime/securesms/sms/SmsTransportDetails.java deleted file mode 100644 index bb0cb03158..0000000000 --- a/src/org/thoughtcrime/securesms/sms/SmsTransportDetails.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2011 Whisper Systems - * Copyright (C) 2014 Open Whisper Systems - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.thoughtcrime.securesms.sms; - -public class SmsTransportDetails { - - public static final int SMS_SIZE = 160; - public static final int MULTIPART_SMS_SIZE = 153; - -} diff --git a/src/org/thoughtcrime/securesms/util/SmsCharacterCalculator.java b/src/org/thoughtcrime/securesms/util/SmsCharacterCalculator.java index eb72926bf0..9198c7ce5e 100644 --- a/src/org/thoughtcrime/securesms/util/SmsCharacterCalculator.java +++ b/src/org/thoughtcrime/securesms/util/SmsCharacterCalculator.java @@ -16,18 +16,19 @@ */ package org.thoughtcrime.securesms.util; -import org.thoughtcrime.securesms.sms.SmsTransportDetails; - public class SmsCharacterCalculator extends CharacterCalculator { + public static final int SMS_SIZE = 160; + public static final int MULTIPART_SMS_SIZE = 153; + @Override public CharacterState calculateCharacters(int charactersSpent) { int maxMessageSize; - if (charactersSpent <= SmsTransportDetails.SMS_SIZE) { - maxMessageSize = SmsTransportDetails.SMS_SIZE; + if (charactersSpent <= SMS_SIZE) { + maxMessageSize = SMS_SIZE; } else { - maxMessageSize = SmsTransportDetails.MULTIPART_SMS_SIZE; + maxMessageSize = MULTIPART_SMS_SIZE; } int messagesSpent = charactersSpent / maxMessageSize;