From 732da9293ac39bd0f14ed61367b7e76a76df2793 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 30 Jul 2009 09:59:31 -0700 Subject: [PATCH] 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. --- .../android/provider/ContactsContract.java | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 01189fe8cf434..3a05c14a8170f 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 { *
  • custom:<a string>
  • * */ + 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); - } } /**