summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nagaraja <nlnu@google.com> 2019-07-09 14:54:33 +0530
committer Nagaraja <nlnu@google.com> 2019-07-22 11:30:26 +0530
commita15ee4d12b0de8ae6f12214bfce257b4f911cbb7 (patch)
tree7ad0a29d3ea5b8ef7994e28088f9ffde38c9aa91
parent929cb5fc7f02f2fc7604a66e1cb34d7916a3438b (diff)
Added Part & Addr Constants.
This constants is added to avoid usage of hard-coded strings. Test: None, added constants only. Bug: 124791757 Change-Id: Ib95b44b642b9a6bb5d2d741509fe13f23fdb27b3
-rwxr-xr-xapi/current.txt2
-rw-r--r--telephony/java/android/provider/Telephony.java36
2 files changed, 37 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt
index 09f4355fae56..f195df9af566 100755
--- a/api/current.txt
+++ b/api/current.txt
@@ -37379,6 +37379,7 @@ package android.provider {
}
public static final class Telephony.Mms.Addr implements android.provider.BaseColumns {
+ method @NonNull public static android.net.Uri getAddrUriForMessage(@NonNull String);
field public static final String ADDRESS = "address";
field public static final String CHARSET = "charset";
field public static final String CONTACT_ID = "contact_id";
@@ -37407,6 +37408,7 @@ package android.provider {
}
public static final class Telephony.Mms.Part implements android.provider.BaseColumns {
+ method @NonNull public static android.net.Uri getPartUriForMessage(@NonNull String);
field public static final String CHARSET = "chset";
field public static final String CONTENT_DISPOSITION = "cd";
field public static final String CONTENT_ID = "cid";
diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java
index 094f8c2eb053..deb82aa6a5b3 100644
--- a/telephony/java/android/provider/Telephony.java
+++ b/telephony/java/android/provider/Telephony.java
@@ -2954,6 +2954,20 @@ public final class Telephony {
* <P>Type: INTEGER</P>
*/
public static final String CHARSET = "charset";
+
+ /**
+ * Generates a Addr {@link Uri} for message, used to perform Addr table operation
+ * for mms.
+ *
+ * @param messageId the messageId used to generate Addr {@link Uri} dynamically
+ * @return the addrUri used to perform Addr table operation for mms
+ */
+ @NonNull
+ public static Uri getAddrUriForMessage(@NonNull String messageId) {
+ Uri addrUri = Mms.CONTENT_URI.buildUpon()
+ .appendPath(String.valueOf(messageId)).appendPath("addr").build();
+ return addrUri;
+ }
}
/**
@@ -2972,11 +2986,16 @@ public final class Telephony {
}
/**
+ * The name of part table.
+ */
+ private static final String TABLE_PART = "part";
+
+ /**
* The {@code content://} style URL for this table. Can be appended with a part ID to
* address individual parts.
*/
@NonNull
- public static final Uri CONTENT_URI = Uri.withAppendedPath(Mms.CONTENT_URI, "part");
+ public static final Uri CONTENT_URI = Uri.withAppendedPath(Mms.CONTENT_URI, TABLE_PART);
/**
* The identifier of the message which this part belongs to.
@@ -3055,6 +3074,21 @@ public final class Telephony {
* <P>Type: TEXT</P>
*/
public static final String TEXT = "text";
+
+ /**
+ * Generates a Part {@link Uri} for message, used to perform Part table operation
+ * for mms.
+ *
+ * @param messageId the messageId used to generate Part {@link Uri} dynamically
+ * @return the partUri used to perform Part table operation for mms
+ */
+ @NonNull
+ public static Uri getPartUriForMessage(@NonNull String messageId) {
+ Uri partUri = Mms.CONTENT_URI.buildUpon()
+ .appendPath(String.valueOf(messageId)).appendPath(
+ TABLE_PART).build();
+ return partUri;
+ }
}
/**