]> sjero.net Git - linphone/commitdiff
Add JNI glue to get timestamp for logs
authorSylvain Berfini <sylvain.berfini@belledonne-communications.com>
Tue, 11 Dec 2012 16:00:04 +0000 (17:00 +0100)
committerSylvain Berfini <sylvain.berfini@belledonne-communications.com>
Tue, 11 Dec 2012 16:00:20 +0000 (17:00 +0100)
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCallLog.java
java/impl/org/linphone/core/LinphoneCallLogImpl.java

index d5835fe34c5560a3fdf5763070ff1a739407510b..63d94411ec0e8440e48f756b0c533e9c4c2402c9 100644 (file)
@@ -1294,6 +1294,11 @@ extern "C" jstring Java_org_linphone_core_LinphoneCallLogImpl_getStartDate(JNIEn
        jstring jvalue =env->NewStringUTF(((LinphoneCallLog*)ptr)->start_date);
        return jvalue;
 }
+extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getTimestamp(JNIEnv*  env
+                                                                                                                                               ,jobject  thiz
+                                                                                                                                               ,jlong ptr) {
+       return static_cast<long> (((LinphoneCallLog*)ptr)->start_date_time);
+}
 extern "C" jint Java_org_linphone_core_LinphoneCallLogImpl_getCallDuration(JNIEnv*  env
                                                                                                                                                ,jobject  thiz
                                                                                                                                                ,jlong ptr) {
index 821be24d0c90d43df05e823b1f2f2c7e55c84ddf..2e839234fd2828c9ce79a07848486bdaa611364b 100644 (file)
@@ -100,6 +100,11 @@ public interface LinphoneCallLog {
         */
        public String getStartDate();
        
+       /**
+        * @return a timestamp of the start date/time of the call in milliseconds since January 1st 1970
+        */
+       public long getTimestamp();
+       
        /**
         * @return the call duration, in seconds
         */
index 05468626ebc22a3f4cb80d282ae4b1baf2ea58ac..7582dbd46c254f60600dfcea02b9fa91ee44ee20 100644 (file)
@@ -30,6 +30,7 @@ class LinphoneCallLogImpl implements LinphoneCallLog {
        private native String getStartDate(long nativePtr);
        private native int getCallDuration(long nativePtr);
        private native int getCallId(long nativePtr);
+       private native long getTimestamp(long nativePtr);
        
        LinphoneCallLogImpl(long aNativePtr)  {
                nativePtr = aNativePtr;
@@ -64,4 +65,8 @@ class LinphoneCallLogImpl implements LinphoneCallLog {
        public int getCallId() {
                return getCallId(nativePtr);
        }
+       
+       public long getTimestamp() {
+               return getTimestamp(nativePtr);
+       }
 }