summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2009-07-30 09:59:31 -0700
committerJeff Sharkey <jsharkey@android.com>2009-08-01 16:08:40 -0700
commit732da9293ac39bd0f14ed61367b7e76a76df2793 (patch)
tree8287e2f6fac71b355f40be9bdcef1f802dd9a0c3 /core
parentb3ac9318efde5de9938fea8b55b1f84addb80d4f (diff)
downloadframeworks_base-732da9293ac39bd0f14ed61367b7e76a76df2793.zip
frameworks_base-732da9293ac39bd0f14ed61367b7e76a76df2793.tar.gz
frameworks_base-732da9293ac39bd0f14ed61367b7e76a76df2793.tar.bz2
Separated IM protocol into two fields, similar to TYPE.
In previous releases, we had combined well-known protocols and custom protocols into a single field. This was because of previous database constraints, which no longer exist because of our new Data table approach.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/provider/ContactsContract.java28
1 files changed, 3 insertions, 25 deletions
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 01189fe..3a05c14 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -1009,6 +1009,8 @@ public final class ContactsContract {
public static final String PROTOCOL = "data5";
+ public static final String CUSTOM_PROTOCOL = "data6";
+
/**
* The predefined IM protocol types. The protocol can either be non-present, one
* of these types, or a free-form string. These cases are encoded in the PROTOCOL
@@ -1019,6 +1021,7 @@ public final class ContactsContract {
* <li>custom:&lt;a string&gt;</li>
* </ul>
*/
+ public static final int PROTOCOL_CUSTOM = -1;
public static final int PROTOCOL_AIM = 0;
public static final int PROTOCOL_MSN = 1;
public static final int PROTOCOL_YAHOO = 2;
@@ -1027,31 +1030,6 @@ public final class ContactsContract {
public static final int PROTOCOL_GOOGLE_TALK = 5;
public static final int PROTOCOL_ICQ = 6;
public static final int PROTOCOL_JABBER = 7;
-
- public static String encodePredefinedImProtocol(int protocol) {
- return "pre:" + protocol;
- }
-
- public static String encodeCustomImProtocol(String protocolString) {
- return "custom:" + protocolString;
- }
-
- public static Object decodeImProtocol(String encodedString) {
- if (encodedString == null) {
- return null;
- }
-
- if (encodedString.startsWith("pre:")) {
- return Integer.parseInt(encodedString.substring(4));
- }
-
- if (encodedString.startsWith("custom:")) {
- return encodedString.substring(7);
- }
-
- throw new IllegalArgumentException(
- "the value is not a valid encoded protocol, " + encodedString);
- }
}
/**