Merge pull request #713 from RomanHargrave/feature_sms-to-mms

Add text-via-MMS option
This commit is contained in:
Moez Bhatti
2017-05-30 17:14:09 -04:00
committed by GitHub
4 changed files with 14 additions and 3 deletions
@@ -80,6 +80,7 @@ public enum QKPreference {
// MMS
GROUP_MESSAGING("pref_key_compose_group", true),
AUTOMATIC_DATA("pref_key_auto_data", true),
TEXT_VIA_MMS("pref_key_texts_as_mms", false),
LONG_AS_MMS("", true),
LONG_AS_MMS_AFTER("", true),
MAX_MMS_SIZE("", true),
@@ -38,6 +38,7 @@ import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import android.preference.PreferenceManager;
import com.android.mms.dom.smil.parser.SmilXmlSerializer;
import com.android.mms.transaction.HttpUtils;
@@ -140,7 +141,7 @@ public class Transaction {
*/
public void sendNewMessage(Message message, long threadId) {
this.saveMessage = message.getSave();
boolean mmsShortCircuit = QKPreferences.getBoolean(QKPreference.TEXT_VIA_MMS);
// if message:
// 1) Has images attached
// or
@@ -152,7 +153,7 @@ public class Transaction {
// 2) group messaging is enabled
//
// then, send as MMS, else send as Voice or SMS
if (checkMMS(message)) {
if (checkMMS(message) || mmsShortCircuit) {
try { Looper.prepare(); } catch (Exception e) { }
RateController.init(context);
DownloadManager.init(context);
+2
View File
@@ -196,6 +196,8 @@
<string name="pref_auto_download_summary">Automatically download MMS messages when they become available</string>
<string name="pref_auto_data">Automatic data</string>
<string name="pref_auto_data_summary">Turn on data automatically when sending or receiving MMS</string>
<string name="pref_send_texts_as_mms">Send texts as MMS</string>
<string name="pref_send_texts_as_mms_summary">Send text messages via MMS instead of SMS</string>
<string name="pref_split">Split SMS</string>
<string name="pref_split_summary">Split long messages into separate messages</string>
<string name="pref_split_counter">Split counter</string>
+8 -1
View File
@@ -26,6 +26,13 @@
android:summary="@string/pref_auto_data_summary"
android:title="@string/pref_auto_data"
android:widgetLayout="@layout/view_switch" />
<CheckBoxPreference
android:defaultValue="false"
android:key="pref_key_texts_as_mms"
android:layout="@layout/list_item_preference"
android:summary="@string/pref_send_texts_as_mms_summary"
android:title="@string/pref_send_texts_as_mms"
android:widgetLayout="@layout/view_switch" />
<PreferenceCategory
android:layout="@layout/list_item_preference_category"
android:title="@string/pref_category_sending_mms">
@@ -77,4 +84,4 @@
android:layout="@layout/list_item_preference"
android:title="@string/pref_mms_port" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceScreen>