Messaging: Fix modifiers

We either have too few or too many

Change-Id: I09a9a38b859c68526fcbcdbc7862afe1d693f6c0
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 37d6d70835
commit 21cb2b6289
78 changed files with 528 additions and 464 deletions
@@ -34,30 +34,30 @@ public interface CarrierConfigValuesLoader {
// Configuration keys and default values
/** Boolean value: if MMS is enabled */
public static final String CONFIG_ENABLED_MMS = "enabledMMS";
public static final boolean CONFIG_ENABLED_MMS_DEFAULT = true;
String CONFIG_ENABLED_MMS = "enabledMMS";
boolean CONFIG_ENABLED_MMS_DEFAULT = true;
/**
* Boolean value: if transaction ID should be appended to
* the download URL of a single segment WAP push message
*/
public static final String CONFIG_ENABLED_TRANS_ID = "enabledTransID";
public static final boolean CONFIG_ENABLED_TRANS_ID_DEFAULT = false;
String CONFIG_ENABLED_TRANS_ID = "enabledTransID";
boolean CONFIG_ENABLED_TRANS_ID_DEFAULT = false;
/**
* Boolean value: if acknowledge or notify response to a download
* should be sent to the WAP push message's download URL
*/
public static final String CONFIG_ENABLED_NOTIFY_WAP_MMSC = "enabledNotifyWapMMSC";
public static final boolean CONFIG_ENABLED_NOTIFY_WAP_MMSC_DEFAULT = false;
String CONFIG_ENABLED_NOTIFY_WAP_MMSC = "enabledNotifyWapMMSC";
boolean CONFIG_ENABLED_NOTIFY_WAP_MMSC_DEFAULT = false;
/**
* Boolean value: if phone number alias can be used
*/
public static final String CONFIG_ALIAS_ENABLED = "aliasEnabled";
public static final boolean CONFIG_ALIAS_ENABLED_DEFAULT = false;
String CONFIG_ALIAS_ENABLED = "aliasEnabled";
boolean CONFIG_ALIAS_ENABLED_DEFAULT = false;
/**
* Boolean value: if audio is allowed in attachment
*/
public static final String CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
public static final boolean CONFIG_ALLOW_ATTACH_AUDIO_DEFAULT = true;
String CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
boolean CONFIG_ALLOW_ATTACH_AUDIO_DEFAULT = true;
/**
* Boolean value: if true, long sms messages are always sent as multi-part sms
* messages, with no checked limit on the number of segments. If false, then
@@ -66,144 +66,144 @@ public interface CarrierConfigValuesLoader {
* independent SMS messages (dependent on CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES flag).
* This feature exists for carriers that don't support multi-part sms.
*/
public static final String CONFIG_ENABLE_MULTIPART_SMS = "enableMultipartSMS";
public static final boolean CONFIG_ENABLE_MULTIPART_SMS_DEFAULT = true;
String CONFIG_ENABLE_MULTIPART_SMS = "enableMultipartSMS";
boolean CONFIG_ENABLE_MULTIPART_SMS_DEFAULT = true;
/**
* Boolean value: if SMS delivery report is supported
*/
public static final String CONFIG_ENABLE_SMS_DELIVERY_REPORTS = "enableSMSDeliveryReports";
public static final boolean CONFIG_ENABLE_SMS_DELIVERY_REPORTS_DEFAULT = true;
String CONFIG_ENABLE_SMS_DELIVERY_REPORTS = "enableSMSDeliveryReports";
boolean CONFIG_ENABLE_SMS_DELIVERY_REPORTS_DEFAULT = true;
/**
* Boolean value: if group MMS is supported
*/
public static final String CONFIG_ENABLE_GROUP_MMS = "enableGroupMms";
public static final boolean CONFIG_ENABLE_GROUP_MMS_DEFAULT = true;
String CONFIG_ENABLE_GROUP_MMS = "enableGroupMms";
boolean CONFIG_ENABLE_GROUP_MMS_DEFAULT = true;
/**
* Boolean value: if the content_disposition field of an MMS part should be parsed
* Check wap-230-wsp-20010705-a.pdf, chapter 8.4.2.21. Most carriers support it except some.
*/
public static final String CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION =
String CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION =
"supportMmsContentDisposition";
public static final boolean CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION_DEFAULT = true;
boolean CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION_DEFAULT = true;
/**
* Boolean value: if the sms app should support a link to the system settings
* where amber alerts are configured.
*/
public static final String CONFIG_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
public static final boolean CONFIG_CELL_BROADCAST_APP_LINKS_DEFAULT = true;
String CONFIG_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
boolean CONFIG_CELL_BROADCAST_APP_LINKS_DEFAULT = true;
/**
* Boolean value: if multipart SMS should be sent as separate SMS messages
*/
public static final String CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES =
String CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES =
"sendMultipartSmsAsSeparateMessages";
public static final boolean CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_DEFAULT = false;
boolean CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_DEFAULT = false;
/**
* Boolean value: if MMS read report is supported
*/
public static final String CONFIG_ENABLE_MMS_READ_REPORTS = "enableMMSReadReports";
public static final boolean CONFIG_ENABLE_MMS_READ_REPORTS_DEFAULT = false;
String CONFIG_ENABLE_MMS_READ_REPORTS = "enableMMSReadReports";
boolean CONFIG_ENABLE_MMS_READ_REPORTS_DEFAULT = false;
/**
* Boolean value: if MMS delivery report is supported
*/
public static final String CONFIG_ENABLE_MMS_DELIVERY_REPORTS = "enableMMSDeliveryReports";
public static final boolean CONFIG_ENABLE_MMS_DELIVERY_REPORTS_DEFAULT = false;
String CONFIG_ENABLE_MMS_DELIVERY_REPORTS = "enableMMSDeliveryReports";
boolean CONFIG_ENABLE_MMS_DELIVERY_REPORTS_DEFAULT = false;
/**
* Boolean value: if "charset" value is supported in the "Content-Type" HTTP header
*/
public static final String CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
public static final boolean CONFIG_SUPPORT_HTTP_CHARSET_HEADER_DEFAULT = false;
String CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
boolean CONFIG_SUPPORT_HTTP_CHARSET_HEADER_DEFAULT = false;
/**
* Integer value: maximal MMS message size in bytes
*/
public static final String CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
public static final int CONFIG_MAX_MESSAGE_SIZE_DEFAULT = 300 * 1024;
String CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
int CONFIG_MAX_MESSAGE_SIZE_DEFAULT = 300 * 1024;
/**
* Integer value: maximal MMS image height in pixels
*/
public static final String CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
public static final int CONFIG_MAX_IMAGE_HEIGHT_DEFAULT = 480;
String CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
int CONFIG_MAX_IMAGE_HEIGHT_DEFAULT = 480;
/**
* Integer value: maximal MMS image width in pixels
*/
public static final String CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
public static final int CONFIG_MAX_IMAGE_WIDTH_DEFAULT = 640;
String CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
int CONFIG_MAX_IMAGE_WIDTH_DEFAULT = 640;
/**
* Integer value: limit on recipient list of an MMS message
*/
public static final String CONFIG_RECIPIENT_LIMIT = "recipientLimit";
public static final int CONFIG_RECIPIENT_LIMIT_DEFAULT = Integer.MAX_VALUE;
String CONFIG_RECIPIENT_LIMIT = "recipientLimit";
int CONFIG_RECIPIENT_LIMIT_DEFAULT = Integer.MAX_VALUE;
/**
* Integer value: HTTP socket timeout in milliseconds for MMS
*/
public static final String CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
public static final int CONFIG_HTTP_SOCKET_TIMEOUT_DEFAULT = 60 * 1000;
String CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
int CONFIG_HTTP_SOCKET_TIMEOUT_DEFAULT = 60 * 1000;
/**
* Integer value: minimal number of characters of an alias
*/
public static final String CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
public static final int CONFIG_ALIAS_MIN_CHARS_DEFAULT = 2;
String CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
int CONFIG_ALIAS_MIN_CHARS_DEFAULT = 2;
/**
* Integer value: maximal number of characters of an alias
*/
public static final String CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
public static final int CONFIG_ALIAS_MAX_CHARS_DEFAULT = 48;
String CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
int CONFIG_ALIAS_MAX_CHARS_DEFAULT = 48;
/**
* Integer value: the threshold of number of SMS parts when an multipart SMS will be
* converted into an MMS, e.g. if this is "4", when an multipart SMS message has 5
* parts, then it will be sent as MMS message instead. "-1" indicates no such conversion
* can happen.
*/
public static final String CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
public static final int CONFIG_SMS_TO_MMS_TEXT_THRESHOLD_DEFAULT = -1;
String CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
int CONFIG_SMS_TO_MMS_TEXT_THRESHOLD_DEFAULT = -1;
/**
* Integer value: the threshold of SMS length when it will be converted into an MMS.
* "-1" indicates no such conversion can happen.
*/
public static final String CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD =
String CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD =
"smsToMmsTextLengthThreshold";
public static final int CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_DEFAULT = -1;
int CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_DEFAULT = -1;
/**
* Integer value: maximal length in bytes of SMS message
*/
public static final String CONFIG_MAX_MESSAGE_TEXT_SIZE = "maxMessageTextSize";
public static final int CONFIG_MAX_MESSAGE_TEXT_SIZE_DEFAULT = -1;
String CONFIG_MAX_MESSAGE_TEXT_SIZE = "maxMessageTextSize";
int CONFIG_MAX_MESSAGE_TEXT_SIZE_DEFAULT = -1;
/**
* Integer value: maximum number of characters allowed for mms subject
*/
public static final String CONFIG_MAX_SUBJECT_LENGTH = "maxSubjectLength";
public static final int CONFIG_MAX_SUBJECT_LENGTH_DEFAULT = 40;
String CONFIG_MAX_SUBJECT_LENGTH = "maxSubjectLength";
int CONFIG_MAX_SUBJECT_LENGTH_DEFAULT = 40;
/**
* String value: name for the user agent profile HTTP header
*/
public static final String CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
public static final String CONFIG_UA_PROF_TAG_NAME_DEFAULT = "x-wap-profile";
String CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
String CONFIG_UA_PROF_TAG_NAME_DEFAULT = "x-wap-profile";
/**
* String value: additional HTTP headers for MMS HTTP requests.
* The format is
* header_1:header_value_1|header_2:header_value_2|...
* Each value can contain macros.
*/
public static final String CONFIG_HTTP_PARAMS = "httpParams";
public static final String CONFIG_HTTP_PARAMS_DEFAULT = null;
String CONFIG_HTTP_PARAMS = "httpParams";
String CONFIG_HTTP_PARAMS_DEFAULT = null;
/**
* String value: number of email gateway
*/
public static final String CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
public static final String CONFIG_EMAIL_GATEWAY_NUMBER_DEFAULT = null;
String CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
String CONFIG_EMAIL_GATEWAY_NUMBER_DEFAULT = null;
/**
* String value: suffix for the NAI HTTP header value, e.g. ":pcs"
* (NAI is used as authentication in HTTP headers for some carriers)
*/
public static final String CONFIG_NAI_SUFFIX = "naiSuffix";
public static final String CONFIG_NAI_SUFFIX_DEFAULT = null;
String CONFIG_NAI_SUFFIX = "naiSuffix";
String CONFIG_NAI_SUFFIX_DEFAULT = null;
/**
* String value: Url for user agent profile
*/
public static final String CONFIG_UA_PROF_URL = "uaProfUrl";
public static final String CONFIG_UA_PROF_URL_DEFAULT = null;
String CONFIG_UA_PROF_URL = "uaProfUrl";
String CONFIG_UA_PROF_URL_DEFAULT = null;
/**
* String value: user agent
*/
public static final String CONFIG_USER_AGENT = "userAgent";
public static final String CONFIG_USER_AGENT_DEFAULT = null;
String CONFIG_USER_AGENT = "userAgent";
String CONFIG_USER_AGENT_DEFAULT = null;
}
@@ -31,7 +31,7 @@ class DefaultUserAgentInfoLoader implements UserAgentInfoLoader {
private static final String DEFAULT_UA_PROF_URL =
"http://www.gstatic.com/android/sms/mms_ua_profile.xml";
private Context mContext;
private final Context mContext;
private boolean mLoaded;
private String mUserAgent;
+1 -1
View File
@@ -37,7 +37,7 @@ public class MmsManager {
private static volatile boolean sForceLegacyMms = false;
// Cached computed overrides for carrier configuration values
private static SparseArray<Bundle> sConfigOverridesMap = new SparseArray<>();
private static final SparseArray<Bundle> sConfigOverridesMap = new SparseArray<>();
/**
* Set the flag about whether to force to use legacy system APIs instead of system MMS API
+1 -1
View File
@@ -239,7 +239,7 @@ public class MmsService extends Service {
// Request execution thread pools. One thread pool for sending and one for downloading.
// The size of the thread pool controls the parallelism of request execution.
// See {@link setThreadPoolSize}
private ExecutorService[] mExecutors = new ExecutorService[2];
private final ExecutorService[] mExecutors = new ExecutorService[2];
// Active request count
private int mActiveRequestCount;
@@ -22,8 +22,8 @@ package android.support.v7.mms;
*/
public interface UserAgentInfoLoader {
// Carrier configuration keys for passing as config overrides into system MMS service
public static final String CONFIG_USER_AGENT = "userAgent";
public static final String CONFIG_UA_PROF_URL = "uaProfUrl";
String CONFIG_USER_AGENT = "userAgent";
String CONFIG_UA_PROF_URL = "uaProfUrl";
/**
* Get UserAgent value
+1 -1
View File
@@ -35,7 +35,7 @@ public class Base64 {
static final int BASELENGTH = 255;
// Create arrays to hold the base64 characters
private static byte[] base64Alphabet = new byte[BASELENGTH];
private static final byte[] base64Alphabet = new byte[BASELENGTH];
// Populating the character arrays
static {
@@ -21,7 +21,7 @@ package android.support.v7.mms.pdu;
import java.io.ByteArrayOutputStream;
public class QuotedPrintable {
private static byte ESCAPE_CHAR = '=';
private static final byte ESCAPE_CHAR = '=';
/**
* Decodes an array quoted-printable characters into an array of original bytes.
@@ -37,7 +37,7 @@ public class QuotedPrintable {
* @return array of original bytes,
* null if quoted-printable decoding is unsuccessful.
*/
public static final byte[] decodeQuotedPrintable(byte[] bytes) {
public static byte[] decodeQuotedPrintable(byte[] bytes) {
if (bytes == null) {
return null;
}