mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-20 11:43:00 +00:00
Enhanced MMS configuration prompts and processing.
1) Added a new message status to MmsDatabase to signify a pending MMS download which requires APN settings. 2) Added a database method to query MMS messages based on status. 3) Added login to SendReceiveService for processing of MMS pending APN information. 4) Moved all APN/MMS settings into ApnPreferencesActivity and transformed PromptApnActivity into a simple informational activity. 5) Added logic to check for APN settings on send and receive of all MMS (media, group, email) and direct user to PromptApnActivity then ApnPreferencesActivity if necessary. 6) Vocab/grammar adjustments.
This commit is contained in:

committed by
Moxie Marlinspike

parent
f3fdde6040
commit
2c2a03e5e2
@@ -49,11 +49,14 @@ public class MmsCommunication {
|
||||
{
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
if (preferences.getBoolean(ApplicationPreferencesActivity.USE_LOCAL_MMS_APNS_PREF, false)) {
|
||||
if (preferences.getBoolean(ApplicationPreferencesActivity.ENABLE_MANUAL_MMS_PREF, false)) {
|
||||
String mmsc = preferences.getString(ApplicationPreferencesActivity.MMSC_HOST_PREF, null);
|
||||
|
||||
if (mmsc == null || !mmsc.startsWith("http"))
|
||||
throw new ApnUnavailableException("Malformed locally configured MMSC: " + mmsc);
|
||||
if (mmsc == null)
|
||||
throw new ApnUnavailableException("Malformed locally configured MMSC.");
|
||||
|
||||
if (!mmsc.startsWith("http"))
|
||||
mmsc = "http://" + mmsc;
|
||||
|
||||
String proxy = preferences.getString(ApplicationPreferencesActivity.MMSC_PROXY_HOST_PREF, null);
|
||||
String port = preferences.getString(ApplicationPreferencesActivity.MMSC_PROXY_PORT_PREF, null);
|
||||
@@ -69,7 +72,7 @@ public class MmsCommunication {
|
||||
{
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
if (preferences.getBoolean(ApplicationPreferencesActivity.USE_LOCAL_MMS_APNS_PREF, false)) {
|
||||
if (preferences.getBoolean(ApplicationPreferencesActivity.ENABLE_MANUAL_MMS_PREF, false)) {
|
||||
return getLocallyConfiguredMmsConnectionParameters(context);
|
||||
} else {
|
||||
MmsConnectionParameters params = ApnDefaults.getMmsConnectionParameters(context);
|
||||
|
@@ -64,18 +64,20 @@ public class MmsDownloadHelper extends MmsCommunication {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isMmsConnectionParametersAvailable(Context context, String apn, boolean proxyIfPossible) {
|
||||
try {
|
||||
getMmsConnectionParameters(context, apn, proxyIfPossible);
|
||||
return true;
|
||||
} catch (ApnUnavailableException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static RetrieveConf retrieveMms(Context context, String url, String apn,
|
||||
boolean usingMmsRadio, boolean proxyIfPossible)
|
||||
throws IOException
|
||||
throws IOException, ApnUnavailableException
|
||||
{
|
||||
MmsConnectionParameters connectionParameters;
|
||||
|
||||
try {
|
||||
connectionParameters = getMmsConnectionParameters(context, apn, proxyIfPossible);
|
||||
} catch (ApnUnavailableException aue) {
|
||||
Log.w("MmsDownloadHelper", aue);
|
||||
connectionParameters = new MmsConnectionParameters(null, null, null);
|
||||
}
|
||||
MmsConnectionParameters connectionParameters = getMmsConnectionParameters(context, apn, proxyIfPossible);
|
||||
|
||||
checkRouteToHost(context, connectionParameters, url, usingMmsRadio);
|
||||
|
||||
|
Reference in New Issue
Block a user