summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Chin <sarahchin@google.com>2020-01-15 16:41:52 -0800
committerSarah Chin <sarahchin@google.com>2020-01-16 20:28:08 +0000
commit9bcf79ca832c7da84d76e6f89f185c617d271e4d (patch)
tree9d15a91a6ba4ef9a103e594fd01895abbe33ce03
parent27f7525a1396b830b85f5e2467e7e0c8fb9e1651 (diff)
downloadMms-9bcf79ca832c7da84d76e6f89f185c617d271e4d.tar.gz
Inline SmsManager constantsandroid-r-preview-1
Test: m MmsServiceRoboTests && atest MmsServiceRoboTests Bug: 147773425 Change-Id: Id042208d986515a90f0ae9aa6295ab90e78ee561
-rw-r--r--src/com/android/mms/service/MmsHttpClient.java2
-rw-r--r--src/com/android/mms/service/MmsService.java21
2 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/mms/service/MmsHttpClient.java b/src/com/android/mms/service/MmsHttpClient.java
index a7d47c4..5cec66f 100644
--- a/src/com/android/mms/service/MmsHttpClient.java
+++ b/src/com/android/mms/service/MmsHttpClient.java
@@ -168,7 +168,7 @@ public class MmsHttpClient {
// Some carriers require that the HTTP connection's socket is closed
// after an MMS request/response is complete. In these cases keep alive
// is disabled. See https://tools.ietf.org/html/rfc7230#section-6.6
- if (mmsConfig.getBoolean(SmsManager.MMS_CONFIG_CLOSE_CONNECTION, false)) {
+ if (mmsConfig.getBoolean(CarrierConfigManager.KEY_MMS_CLOSE_CONNECTION_BOOL, false)) {
LogUtil.i(requestId, "HTTP: Connection close after request");
connection.setRequestProperty(HEADER_CONNECTION, HEADER_CONNECTION_CLOSE);
}
diff --git a/src/com/android/mms/service/MmsService.java b/src/com/android/mms/service/MmsService.java
index 20e74d5..858cb4a 100644
--- a/src/com/android/mms/service/MmsService.java
+++ b/src/com/android/mms/service/MmsService.java
@@ -91,6 +91,15 @@ public class MmsService extends Service implements MmsRequest.RequestManager {
// The default number of threads allowed to run MMS requests in each queue
public static final int THREAD_POOL_SIZE = 4;
+ /** Represents the received SMS message for importing. */
+ public static final int SMS_TYPE_INCOMING = 0;
+ /** Represents the sent SMS message for importing. */
+ public static final int SMS_TYPE_OUTGOING = 1;
+ /** Message status property: whether the message has been seen. */
+ public static final String MESSAGE_STATUS_SEEN = "seen";
+ /** Message status property: whether the message has been read. */
+ public static final String MESSAGE_STATUS_READ = "read";
+
// Pending requests that are waiting for the SIM to be available
// If a different SIM is currently used by previous requests, the following
// requests will stay in this queue until that SIM finishes its current requests in
@@ -560,11 +569,11 @@ public class MmsService extends Service implements MmsRequest.RequestManager {
boolean seen, boolean read, String creator) {
Uri insertUri = null;
switch (type) {
- case SmsManager.SMS_TYPE_INCOMING:
+ case SMS_TYPE_INCOMING:
insertUri = Telephony.Sms.Inbox.CONTENT_URI;
break;
- case SmsManager.SMS_TYPE_OUTGOING:
+ case SMS_TYPE_OUTGOING:
insertUri = Telephony.Sms.Sent.CONTENT_URI;
break;
}
@@ -684,14 +693,14 @@ public class MmsService extends Service implements MmsRequest.RequestManager {
return false;
}
final ContentValues values = new ContentValues();
- if (statusValues.containsKey(SmsManager.MESSAGE_STATUS_READ)) {
- final Integer val = statusValues.getAsInteger(SmsManager.MESSAGE_STATUS_READ);
+ if (statusValues.containsKey(MESSAGE_STATUS_READ)) {
+ final Integer val = statusValues.getAsInteger(MESSAGE_STATUS_READ);
if (val != null) {
// MMS uses the same column name
values.put(Telephony.Sms.READ, val);
}
- } else if (statusValues.containsKey(SmsManager.MESSAGE_STATUS_SEEN)) {
- final Integer val = statusValues.getAsInteger(SmsManager.MESSAGE_STATUS_SEEN);
+ } else if (statusValues.containsKey(MESSAGE_STATUS_SEEN)) {
+ final Integer val = statusValues.getAsInteger(MESSAGE_STATUS_SEEN);
if (val != null) {
// MMS uses the same column name
values.put(Telephony.Sms.SEEN, val);