Merge "Move getMmsConfig from SmsManager to MmsService."

This commit is contained in:
Amit Mahajan
2019-11-01 22:33:53 +00:00
committed by Gerrit Code Review

View File

@@ -33,7 +33,6 @@ import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.database.CursorWindow; import android.database.CursorWindow;
import android.net.Uri; import android.net.Uri;
import android.os.BaseBundle;
import android.os.Binder; import android.os.Binder;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@@ -2891,74 +2890,6 @@ public final class SmsManager {
} }
} }
/**
* Filters a bundle to only contain MMS config variables.
*
* This is for use with bundles returned by {@link CarrierConfigManager} which contain MMS
* config and unrelated config. It is assumed that all MMS_CONFIG_* keys are present in the
* supplied bundle.
*
* @param config a Bundle that contains MMS config variables and possibly more.
* @return a new Bundle that only contains the MMS_CONFIG_* keys defined above.
* @hide
*/
public static Bundle getMmsConfig(BaseBundle config) {
Bundle filtered = new Bundle();
filtered.putBoolean(MMS_CONFIG_APPEND_TRANSACTION_ID,
config.getBoolean(MMS_CONFIG_APPEND_TRANSACTION_ID));
filtered.putBoolean(MMS_CONFIG_MMS_ENABLED, config.getBoolean(MMS_CONFIG_MMS_ENABLED));
filtered.putBoolean(MMS_CONFIG_GROUP_MMS_ENABLED,
config.getBoolean(MMS_CONFIG_GROUP_MMS_ENABLED));
filtered.putBoolean(MMS_CONFIG_NOTIFY_WAP_MMSC_ENABLED,
config.getBoolean(MMS_CONFIG_NOTIFY_WAP_MMSC_ENABLED));
filtered.putBoolean(MMS_CONFIG_ALIAS_ENABLED, config.getBoolean(MMS_CONFIG_ALIAS_ENABLED));
filtered.putBoolean(MMS_CONFIG_ALLOW_ATTACH_AUDIO,
config.getBoolean(MMS_CONFIG_ALLOW_ATTACH_AUDIO));
filtered.putBoolean(MMS_CONFIG_MULTIPART_SMS_ENABLED,
config.getBoolean(MMS_CONFIG_MULTIPART_SMS_ENABLED));
filtered.putBoolean(MMS_CONFIG_SMS_DELIVERY_REPORT_ENABLED,
config.getBoolean(MMS_CONFIG_SMS_DELIVERY_REPORT_ENABLED));
filtered.putBoolean(MMS_CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION,
config.getBoolean(MMS_CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION));
filtered.putBoolean(MMS_CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES,
config.getBoolean(MMS_CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES));
filtered.putBoolean(MMS_CONFIG_MMS_READ_REPORT_ENABLED,
config.getBoolean(MMS_CONFIG_MMS_READ_REPORT_ENABLED));
filtered.putBoolean(MMS_CONFIG_MMS_DELIVERY_REPORT_ENABLED,
config.getBoolean(MMS_CONFIG_MMS_DELIVERY_REPORT_ENABLED));
filtered.putBoolean(MMS_CONFIG_CLOSE_CONNECTION,
config.getBoolean(MMS_CONFIG_CLOSE_CONNECTION));
filtered.putInt(MMS_CONFIG_MAX_MESSAGE_SIZE, config.getInt(MMS_CONFIG_MAX_MESSAGE_SIZE));
filtered.putInt(MMS_CONFIG_MAX_IMAGE_WIDTH, config.getInt(MMS_CONFIG_MAX_IMAGE_WIDTH));
filtered.putInt(MMS_CONFIG_MAX_IMAGE_HEIGHT, config.getInt(MMS_CONFIG_MAX_IMAGE_HEIGHT));
filtered.putInt(MMS_CONFIG_RECIPIENT_LIMIT, config.getInt(MMS_CONFIG_RECIPIENT_LIMIT));
filtered.putInt(MMS_CONFIG_ALIAS_MIN_CHARS, config.getInt(MMS_CONFIG_ALIAS_MIN_CHARS));
filtered.putInt(MMS_CONFIG_ALIAS_MAX_CHARS, config.getInt(MMS_CONFIG_ALIAS_MAX_CHARS));
filtered.putInt(MMS_CONFIG_SMS_TO_MMS_TEXT_THRESHOLD,
config.getInt(MMS_CONFIG_SMS_TO_MMS_TEXT_THRESHOLD));
filtered.putInt(MMS_CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD,
config.getInt(MMS_CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD));
filtered.putInt(MMS_CONFIG_MESSAGE_TEXT_MAX_SIZE,
config.getInt(MMS_CONFIG_MESSAGE_TEXT_MAX_SIZE));
filtered.putInt(MMS_CONFIG_SUBJECT_MAX_LENGTH,
config.getInt(MMS_CONFIG_SUBJECT_MAX_LENGTH));
filtered.putInt(MMS_CONFIG_HTTP_SOCKET_TIMEOUT,
config.getInt(MMS_CONFIG_HTTP_SOCKET_TIMEOUT));
filtered.putString(MMS_CONFIG_UA_PROF_TAG_NAME,
config.getString(MMS_CONFIG_UA_PROF_TAG_NAME));
filtered.putString(MMS_CONFIG_USER_AGENT, config.getString(MMS_CONFIG_USER_AGENT));
filtered.putString(MMS_CONFIG_UA_PROF_URL, config.getString(MMS_CONFIG_UA_PROF_URL));
filtered.putString(MMS_CONFIG_HTTP_PARAMS, config.getString(MMS_CONFIG_HTTP_PARAMS));
filtered.putString(MMS_CONFIG_EMAIL_GATEWAY_NUMBER,
config.getString(MMS_CONFIG_EMAIL_GATEWAY_NUMBER));
filtered.putString(MMS_CONFIG_NAI_SUFFIX, config.getString(MMS_CONFIG_NAI_SUFFIX));
filtered.putBoolean(MMS_CONFIG_SHOW_CELL_BROADCAST_APP_LINKS,
config.getBoolean(MMS_CONFIG_SHOW_CELL_BROADCAST_APP_LINKS));
filtered.putBoolean(MMS_CONFIG_SUPPORT_HTTP_CHARSET_HEADER,
config.getBoolean(MMS_CONFIG_SUPPORT_HTTP_CHARSET_HEADER));
return filtered;
}
/** @hide */ /** @hide */
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"SMS_CATEGORY_"}, @IntDef(prefix = {"SMS_CATEGORY_"},