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:
rhodey
2013-09-16 00:55:01 -07:00
committed by Moxie Marlinspike
parent f3fdde6040
commit 2c2a03e5e2
37 changed files with 573 additions and 439 deletions

View File

@@ -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);

View File

@@ -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);