summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLixin Yue <L.X.YUE@motorola.com>2009-09-09 16:27:21 +0800
committerJaikumar Ganesh <jaikumar@google.com>2009-09-10 10:13:14 -0700
commit2d3f9c559366ede6aefe9bcff554ef9c4eac21dd (patch)
tree2f47a930101ea9d45748d33e1ae6bc3e50ad53b8
parent466dbbfd4595d714127a4bc92dd9235807b88be6 (diff)
downloadframeworks_base-2d3f9c559366ede6aefe9bcff554ef9c4eac21dd.zip
frameworks_base-2d3f9c559366ede6aefe9bcff554ef9c4eac21dd.tar.gz
frameworks_base-2d3f9c559366ede6aefe9bcff554ef9c4eac21dd.tar.bz2
Add timestamp support for call history vcard
-rw-r--r--core/java/android/syncml/pim/vcard/ContactStruct.java30
-rw-r--r--core/java/android/syncml/pim/vcard/VCardComposer.java4
2 files changed, 34 insertions, 0 deletions
diff --git a/core/java/android/syncml/pim/vcard/ContactStruct.java b/core/java/android/syncml/pim/vcard/ContactStruct.java
index 687c1b4..9782111 100644
--- a/core/java/android/syncml/pim/vcard/ContactStruct.java
+++ b/core/java/android/syncml/pim/vcard/ContactStruct.java
@@ -22,7 +22,9 @@ import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.net.Uri;
+import android.provider.CallLog;
import android.provider.Contacts;
+import android.provider.CallLog.Calls;
import android.provider.Contacts.ContactMethods;
import android.provider.Contacts.Extensions;
import android.provider.Contacts.GroupMembership;
@@ -88,6 +90,8 @@ public class ContactStruct {
/** Only for GET. Use addExtension() to PUT */
public Map<String, List<String>> extensionMap;
+ public String timeStamp;
+
// Use organizationList instead when handling ORG.
@Deprecated
public String company;
@@ -148,6 +152,32 @@ public class ContactStruct {
}
/**
+ * Add call history time stamp and call type.
+ * @param type call type
+ * @param timeStamp timeStamp
+ */
+ public void addCallHistoryTimeStamp(int type, String date) {
+ // Extension for call history as defined in
+ // in the Specification for Ic Mobile Communcation - ver 1.1,
+ // Oct 2000. This is used to send the details of the call
+ // history - missed, incoming, outgoing along with date and time
+ // to the requesting device (For example, transferring phone book
+ // when connected over bluetooth)
+ // X-IRMC-CALL-DATETIME;MISSED:20050320T100000
+ String strCallType;
+ if (type == Calls.INCOMING_TYPE) {
+ strCallType = "INCOMING";
+ } else if (type == Calls.OUTGOING_TYPE) {
+ strCallType = "OUTGOING";
+ } else if (type == Calls.MISSED_TYPE) {
+ strCallType = "MISSED";
+ } else {
+ strCallType = "";
+ }
+ timeStamp = "X-IRMC-CALL-DATETIME;" + strCallType + ":" + date;
+ }
+
+ /**
* Add a contactmethod info to contactmethodList.
* @param kind integer value defined in Contacts.java
* (e.g. Contacts.KIND_EMAIL)
diff --git a/core/java/android/syncml/pim/vcard/VCardComposer.java b/core/java/android/syncml/pim/vcard/VCardComposer.java
index 9823015..a5dd053 100644
--- a/core/java/android/syncml/pim/vcard/VCardComposer.java
+++ b/core/java/android/syncml/pim/vcard/VCardComposer.java
@@ -149,6 +149,10 @@ public class VCardComposer {
appendContactMethodStr(struct.contactmethodList, vcardversion);
}
+ if (!isNull(struct.timeStamp)) {
+ mResult.append(struct.timeStamp).append(mNewline);
+ }
+
mResult.append("END:VCARD").append(mNewline);
return mResult.toString();
}