Strip out more unused logic from Settings

This commit is contained in:
Moez Bhatti
2018-01-13 18:51:36 -05:00
parent 29d06af0e5
commit 7ea2ee6310
9 changed files with 15 additions and 85 deletions
@@ -35,7 +35,6 @@ public class Settings {
private String userAgent;
private String uaProfUrl;
private String uaProfTagName;
private boolean group;
// SMS options
private boolean deliveryReports;
@@ -68,7 +67,6 @@ public class Settings {
this.userAgent = s.getAgent();
this.uaProfUrl = s.getUserProfileUrl();
this.uaProfTagName = s.getUaProfTagName();
this.group = s.getGroup();
this.deliveryReports = s.getDeliveryReports();
this.split = s.getSplit();
this.splitCounter = s.getSplitCounter();
@@ -104,7 +102,6 @@ public class Settings {
this.userAgent = "";
this.uaProfUrl = "";
this.uaProfTagName = "";
this.group = group;
this.deliveryReports = deliveryReports;
this.split = split;
this.splitCounter = splitCounter;
@@ -165,15 +162,6 @@ public class Settings {
*/
public void setUaProfTagName(String tagName) { this.uaProfTagName = tagName; }
/**
* Sets group MMS messages
*
* @param group is a boolean specifying whether or not to send messages with multiple recipients as a group MMS message
*/
public void setGroup(boolean group) {
this.group = group;
}
/**
* Sets whether to receive delivery reports from SMS messages
*
@@ -296,13 +284,6 @@ public class Settings {
*/
public String getUaProfTagName() { return this.uaProfTagName; }
/**
* @return whether or not to send Group MMS or multiple SMS/Voice messages
*/
public boolean getGroup() {
return this.group;
}
/**
* @return whether or not to request delivery reports on SMS messages
*/
@@ -488,7 +488,7 @@ public class Transaction {
if (saveMessage) {
try {
PduPersister persister = PduPersister.getPduPersister(context);
info.location = persister.persist(sendRequest, Uri.parse("content://mms/outbox"), true, settings.getGroup(), null);
info.location = persister.persist(sendRequest, Uri.parse("content://mms/outbox"), true, true, null);
} catch (Exception e) {
Log.v("sending_mms_library", "error saving mms message");
Log.e(TAG, "exception thrown", e);
@@ -527,7 +527,7 @@ public class Transaction {
SendReq sendReq = buildPdu(context, addresses, subject, parts);
PduPersister persister = PduPersister.getPduPersister(context);
Uri messageUri = persister.persist(sendReq, Uri.parse("content://mms/outbox"),
true, settings.getGroup(), null);
true, true, null);
Intent intent;
if (explicitSentMmsReceiver == null) {
@@ -565,7 +565,7 @@ public class Transaction {
}
Bundle configOverrides = new Bundle();
configOverrides.putBoolean(SmsManager.MMS_CONFIG_GROUP_MMS_ENABLED, settings.getGroup());
configOverrides.putBoolean(SmsManager.MMS_CONFIG_GROUP_MMS_ENABLED, true);
String httpParams = MmsConfig.getHttpParams();
if (!TextUtils.isEmpty(httpParams)) {
configOverrides.putString(SmsManager.MMS_CONFIG_HTTP_PARAMS, httpParams);
@@ -828,7 +828,7 @@ public class Transaction {
return message.getImages().length != 0 ||
(message.getParts().size() != 0) ||
(settings.getSendLongAsMms() && Utils.getNumPages(settings, message.getText()) > settings.getSendLongAsMmsAfter()) ||
(message.getAddresses().length > 1 && settings.getGroup()) ||
(message.getAddresses().length > 1) ||
message.getSubject() != null;
}
@@ -359,7 +359,6 @@ public class Utils {
sendSettings.setAgent(sharedPrefs.getString("mms_agent", ""));
sendSettings.setUserProfileUrl(sharedPrefs.getString("mms_user_agent_profile_url", ""));
sendSettings.setUaProfTagName(sharedPrefs.getString("mms_user_agent_tag_name", ""));
sendSettings.setGroup(sharedPrefs.getBoolean("group_message", true));
sendSettings.setDeliveryReports(sharedPrefs.getBoolean("delivery_reports", false));
sendSettings.setSplit(sharedPrefs.getBoolean("split_sms", false));
sendSettings.setSplitCounter(sharedPrefs.getBoolean("split_counter", false));