• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.appcompat.mms;
18 
19 import android.os.Bundle;
20 
21 /**
22  * Loader for carrier dependent configuration values
23  */
24 public interface CarrierConfigValuesLoader {
25     /**
26      * Get the carrier config values in a bundle
27      *
28      * @param subId the associated subscription ID for the carrier configuration
29      * @return a bundle of all the values
30      */
get(int subId)31     Bundle get(int subId);
32 
33     // Configuration keys and default values
34 
35     /** Boolean value: if MMS is enabled */
36     public static final String CONFIG_ENABLED_MMS = "enabledMMS";
37     public static final boolean CONFIG_ENABLED_MMS_DEFAULT = true;
38     /**
39      * Boolean value: if transaction ID should be appended to
40      * the download URL of a single segment WAP push message
41      */
42     public static final String CONFIG_ENABLED_TRANS_ID = "enabledTransID";
43     public static final boolean CONFIG_ENABLED_TRANS_ID_DEFAULT = false;
44     /**
45      * Boolean value: if acknowledge or notify response to a download
46      * should be sent to the WAP push message's download URL
47      */
48     public static final String CONFIG_ENABLED_NOTIFY_WAP_MMSC = "enabledNotifyWapMMSC";
49     public static final boolean CONFIG_ENABLED_NOTIFY_WAP_MMSC_DEFAULT = false;
50     /**
51      * Boolean value: if phone number alias can be used
52      */
53     public static final String CONFIG_ALIAS_ENABLED = "aliasEnabled";
54     public static final boolean CONFIG_ALIAS_ENABLED_DEFAULT = false;
55     /**
56      * Boolean value: if audio is allowed in attachment
57      */
58     public static final String CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
59     public static final boolean CONFIG_ALLOW_ATTACH_AUDIO_DEFAULT = true;
60     /**
61      * Boolean value: if true, long sms messages are always sent as multi-part sms
62      * messages, with no checked limit on the number of segments. If false, then
63      * as soon as the user types a message longer than a single segment (i.e. 140 chars),
64      * the message will turn into and be sent as an mms message or separate,
65      * independent SMS messages (dependent on CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES flag).
66      * This feature exists for carriers that don't support multi-part sms.
67      */
68     public static final String CONFIG_ENABLE_MULTIPART_SMS = "enableMultipartSMS";
69     public static final boolean CONFIG_ENABLE_MULTIPART_SMS_DEFAULT = true;
70     /**
71      * Boolean value: if SMS delivery report is supported
72      */
73     public static final String CONFIG_ENABLE_SMS_DELIVERY_REPORTS = "enableSMSDeliveryReports";
74     public static final boolean CONFIG_ENABLE_SMS_DELIVERY_REPORTS_DEFAULT = true;
75     /**
76      * Boolean value: if group MMS is supported
77      */
78     public static final String CONFIG_ENABLE_GROUP_MMS = "enableGroupMms";
79     public static final boolean CONFIG_ENABLE_GROUP_MMS_DEFAULT = true;
80     /**
81      * Boolean value: if the content_disposition field of an MMS part should be parsed
82      * Check wap-230-wsp-20010705-a.pdf, chapter 8.4.2.21. Most carriers support it except some.
83      */
84     public static final String CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION =
85             "supportMmsContentDisposition";
86     public static final boolean CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION_DEFAULT = true;
87     /**
88      * Boolean value: if the sms app should support a link to the system settings
89      * where amber alerts are configured.
90      */
91     public static final String CONFIG_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
92     public static final boolean CONFIG_CELL_BROADCAST_APP_LINKS_DEFAULT = true;
93     /**
94      * Boolean value: if multipart SMS should be sent as separate SMS messages
95      */
96     public static final String CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES =
97             "sendMultipartSmsAsSeparateMessages";
98     public static final boolean CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_DEFAULT = false;
99     /**
100      * Boolean value: if MMS read report is supported
101      */
102     public static final String CONFIG_ENABLE_MMS_READ_REPORTS = "enableMMSReadReports";
103     public static final boolean CONFIG_ENABLE_MMS_READ_REPORTS_DEFAULT = false;
104     /**
105      * Boolean value: if MMS delivery report is supported
106      */
107     public static final String CONFIG_ENABLE_MMS_DELIVERY_REPORTS = "enableMMSDeliveryReports";
108     public static final boolean CONFIG_ENABLE_MMS_DELIVERY_REPORTS_DEFAULT = false;
109     /**
110      * Boolean value: if "charset" value is supported in the "Content-Type" HTTP header
111      */
112     public static final String CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
113     public static final boolean CONFIG_SUPPORT_HTTP_CHARSET_HEADER_DEFAULT = false;
114     /**
115      * Integer value: maximal MMS message size in bytes
116      */
117     public static final String CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
118     public static final int CONFIG_MAX_MESSAGE_SIZE_DEFAULT = 300 * 1024;
119     /**
120      * Integer value: maximal MMS image height in pixels
121      */
122     public static final String CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
123     public static final int CONFIG_MAX_IMAGE_HEIGHT_DEFAULT = 480;
124     /**
125      * Integer value: maximal MMS image width in pixels
126      */
127     public static final String CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
128     public static final int CONFIG_MAX_IMAGE_WIDTH_DEFAULT = 640;
129     /**
130      * Integer value: limit on recipient list of an MMS message
131      */
132     public static final String CONFIG_RECIPIENT_LIMIT = "recipientLimit";
133     public static final int CONFIG_RECIPIENT_LIMIT_DEFAULT = Integer.MAX_VALUE;
134     /**
135      * Integer value: HTTP socket timeout in milliseconds for MMS
136      */
137     public static final String CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
138     public static final int CONFIG_HTTP_SOCKET_TIMEOUT_DEFAULT = 60 * 1000;
139     /**
140      * Integer value: minimal number of characters of an alias
141      */
142     public static final String CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
143     public static final int CONFIG_ALIAS_MIN_CHARS_DEFAULT = 2;
144     /**
145      * Integer value: maximal number of characters of an alias
146      */
147     public static final String CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
148     public static final int CONFIG_ALIAS_MAX_CHARS_DEFAULT = 48;
149     /**
150      * Integer value: the threshold of number of SMS parts when an multipart SMS will be
151      * converted into an MMS, e.g. if this is "4", when an multipart SMS message has 5
152      * parts, then it will be sent as MMS message instead. "-1" indicates no such conversion
153      * can happen.
154      */
155     public static final String CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
156     public static final int CONFIG_SMS_TO_MMS_TEXT_THRESHOLD_DEFAULT = -1;
157     /**
158      * Integer value: the threshold of SMS length when it will be converted into an MMS.
159      * "-1" indicates no such conversion can happen.
160      */
161     public static final String CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD =
162             "smsToMmsTextLengthThreshold";
163     public static final int CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_DEFAULT = -1;
164     /**
165      * Integer value: maximal length in bytes of SMS message
166      */
167     public static final String CONFIG_MAX_MESSAGE_TEXT_SIZE = "maxMessageTextSize";
168     public static final int CONFIG_MAX_MESSAGE_TEXT_SIZE_DEFAULT = -1;
169     /**
170      * Integer value: maximum number of characters allowed for mms subject
171      */
172     public static final String CONFIG_MAX_SUBJECT_LENGTH = "maxSubjectLength";
173     public static final int CONFIG_MAX_SUBJECT_LENGTH_DEFAULT = 40;
174     /**
175      * String value: name for the user agent profile HTTP header
176      */
177     public static final String CONFIG_UA_PROF_TAG_NAME = "mUaProfTagName";
178     public static final String CONFIG_UA_PROF_TAG_NAME_DEFAULT = "x-wap-profile";
179     /**
180      * String value: additional HTTP headers for MMS HTTP requests.
181      * The format is
182      * header_1:header_value_1|header_2:header_value_2|...
183      * Each value can contain macros.
184      */
185     public static final String CONFIG_HTTP_PARAMS = "httpParams";
186     public static final String CONFIG_HTTP_PARAMS_DEFAULT = null;
187     /**
188      * String value: number of email gateway
189      */
190     public static final String CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
191     public static final String CONFIG_EMAIL_GATEWAY_NUMBER_DEFAULT = null;
192     /**
193      * String value: suffix for the NAI HTTP header value, e.g. ":pcs"
194      * (NAI is used as authentication in HTTP headers for some carriers)
195      */
196     public static final String CONFIG_NAI_SUFFIX = "naiSuffix";
197     public static final String CONFIG_NAI_SUFFIX_DEFAULT = null;
198 }
199