Loading android-smsmms/src/main/java/com/klinker/android/send_message/MmsReceivedReceiver.java +12 −8 Original line number Diff line number Diff line Loading @@ -19,8 +19,10 @@ package com.klinker.android.send_message; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.AsyncTask; import android.preference.PreferenceManager; import android.provider.Telephony; import android.telephony.SmsManager; import com.android.mms.service_alt.DownloadRequest; Loading Loading @@ -65,13 +67,15 @@ public class MmsReceivedReceiver extends BroadcastReceiver { private static final ExecutorService RECEIVE_NOTIFICATION_EXECUTOR = Executors.newSingleThreadExecutor(); public MmscInformation getMmscInfoForReceptionAck() { // Override this and provide the MMSC to send the ACK to. // some carriers will download duplicate MMS messages without this ACK. When using the // system sending method, apparently Google does not do this for us. Not sure why. // You might have to have users manually enter their APN settings if you cannot get them // from the system somehow. public MmscInformation getMmscInfoForReceptionAck(Context context) { SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); String mmsc_url = sharedPrefs.getString("mmsc_url", ""); String mmsc_proxy = sharedPrefs.getString("mms_proxy", ""); String mmsc_port = sharedPrefs.getString("mms_port", ""); if (!mmsc_url.isEmpty() && !mmsc_proxy.isEmpty() && !mmsc_port.isEmpty()) { return new MmscInformation(mmsc_url, mmsc_proxy, Integer.parseInt(mmsc_port)); } return null; } Loading Loading @@ -326,7 +330,7 @@ public class MmsReceivedReceiver extends BroadcastReceiver { return null; } if (getMmscInfoForReceptionAck() == null) { if (getMmscInfoForReceptionAck(context) == null) { Timber.v("No MMSC information set, so no notification tasks will be able to complete"); return null; } Loading @@ -341,7 +345,7 @@ public class MmsReceivedReceiver extends BroadcastReceiver { try { final NotificationInd ind = getNotificationInd(context, intent); final MmscInformation mmsc = getMmscInfoForReceptionAck(); final MmscInformation mmsc = getMmscInfoForReceptionAck(context); final TransactionSettings transactionSettings = new TransactionSettings(mmsc.mmscUrl, mmsc.mmsProxy, mmsc.proxyPort); final List<CommonAsyncTask> responseTasks = new ArrayList<>(); Loading Loading
android-smsmms/src/main/java/com/klinker/android/send_message/MmsReceivedReceiver.java +12 −8 Original line number Diff line number Diff line Loading @@ -19,8 +19,10 @@ package com.klinker.android.send_message; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.AsyncTask; import android.preference.PreferenceManager; import android.provider.Telephony; import android.telephony.SmsManager; import com.android.mms.service_alt.DownloadRequest; Loading Loading @@ -65,13 +67,15 @@ public class MmsReceivedReceiver extends BroadcastReceiver { private static final ExecutorService RECEIVE_NOTIFICATION_EXECUTOR = Executors.newSingleThreadExecutor(); public MmscInformation getMmscInfoForReceptionAck() { // Override this and provide the MMSC to send the ACK to. // some carriers will download duplicate MMS messages without this ACK. When using the // system sending method, apparently Google does not do this for us. Not sure why. // You might have to have users manually enter their APN settings if you cannot get them // from the system somehow. public MmscInformation getMmscInfoForReceptionAck(Context context) { SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); String mmsc_url = sharedPrefs.getString("mmsc_url", ""); String mmsc_proxy = sharedPrefs.getString("mms_proxy", ""); String mmsc_port = sharedPrefs.getString("mms_port", ""); if (!mmsc_url.isEmpty() && !mmsc_proxy.isEmpty() && !mmsc_port.isEmpty()) { return new MmscInformation(mmsc_url, mmsc_proxy, Integer.parseInt(mmsc_port)); } return null; } Loading Loading @@ -326,7 +330,7 @@ public class MmsReceivedReceiver extends BroadcastReceiver { return null; } if (getMmscInfoForReceptionAck() == null) { if (getMmscInfoForReceptionAck(context) == null) { Timber.v("No MMSC information set, so no notification tasks will be able to complete"); return null; } Loading @@ -341,7 +345,7 @@ public class MmsReceivedReceiver extends BroadcastReceiver { try { final NotificationInd ind = getNotificationInd(context, intent); final MmscInformation mmsc = getMmscInfoForReceptionAck(); final MmscInformation mmsc = getMmscInfoForReceptionAck(context); final TransactionSettings transactionSettings = new TransactionSettings(mmsc.mmscUrl, mmsc.mmsProxy, mmsc.proxyPort); final List<CommonAsyncTask> responseTasks = new ArrayList<>(); Loading