Bug fix about invalid parsing and modify sconscript.
authorjaesick.shin <jaesick.shin@samsung.com>
Tue, 11 Oct 2016 03:44:47 +0000 (12:44 +0900)
committerUze Choi <uzchoi@samsung.com>
Wed, 12 Oct 2016 10:14:38 +0000 (10:14 +0000)
this patch include,
1. Bug fix about invalid parsing in jni side
   and send notification was changed to once call.
2. Modify sconscript for android 6.0 devices

Change-Id: I9ae6d68ebf24d944e896db54949f86de62fc0f6e
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13069
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/SConscript
service/notification/android/notification-service/src/main/jni/provider/JniNotificationProvider.cpp
service/notification/examples/android/NotiProviderExample/app/src/main/java/com/sec/notiproviderexample/MainActivity.java

index c4390a0..0a45f61 100755 (executable)
@@ -70,6 +70,9 @@ if target_os == 'linux':
 if target_os == 'android':
        notification_env.AppendUnique(CCFLAGS = ['-frtti', '-fexceptions'])
        notification_env.AppendUnique(LIBS = ['gnustl_shared','log'])
+       notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider.so'])
+       notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer.so'])
+       
 
        if not env.get('RELEASE'):
                notification_env.AppendUnique(LIBS = ['log'])
index bfe78db..bbe0093 100755 (executable)
@@ -124,9 +124,9 @@ OIC::Service::NSMessage *getNativeMessage(JNIEnv *env, jobject jMsg)
         LOGE("Error: jfieldID for message ttl is null");
         return nullptr;
     }
-    jlong jttl = (jlong) env->GetObjectField( jMsg, fid_ttl);
-    uint64_t  ttl = jttl;
 
+    jlong jttl = (jlong) env->GetLongField( jMsg, fid_ttl);
+    uint64_t  ttl = jttl;
     LOGD("Message ID: %lld\n", ttl);
 
     // Message Title
index 481f74e..5d033fc 100755 (executable)
@@ -262,13 +262,6 @@ public class MainActivity extends Activity {
                     Log.i(TAG, "#" + notiId + " notified ..");\r
                     TvLog.append("Send Notitication(Msg ID: " + notiId + ")\n");\r
                     notiId++;\r
-                    org.iotivity.service.ns.common.Message notiMessage = new org.iotivity.service.ns.common.Message(title,body,"provider");\r
-                    notiMessage.setTTL(10);\r
-                    notiMessage.setTime(DateFormat.getDateTimeInstance().format(new Date()));\r
-                    notiMessage.setTopic(topic);\r
-                    MediaContents media = new MediaContents("Video");\r
-                    notiMessage.setMediaContents(media);\r
-                    mProviderSample.SendMessage(notiMessage);\r
                 }\r
                 break;\r
 \r