From c31017dab2e32d57fa28c241e43f4f3744c84d31 Mon Sep 17 00:00:00 2001 From: "jaesick.shin" Date: Tue, 11 Oct 2016 12:44:47 +0900 Subject: [PATCH] Bug fix about invalid parsing and modify sconscript. 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/13067 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/notification/SConscript | 3 +++ .../src/main/jni/provider/JniNotificationProvider.cpp | 4 ++-- .../java/com/sec/notiproviderexample/MainActivity.java | 7 ------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/service/notification/SConscript b/service/notification/SConscript index c4390a010..0a45f613f 100755 --- a/service/notification/SConscript +++ b/service/notification/SConscript @@ -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']) diff --git a/service/notification/android/notification-service/src/main/jni/provider/JniNotificationProvider.cpp b/service/notification/android/notification-service/src/main/jni/provider/JniNotificationProvider.cpp index bfe78dbe4..bbe009391 100755 --- a/service/notification/android/notification-service/src/main/jni/provider/JniNotificationProvider.cpp +++ b/service/notification/android/notification-service/src/main/jni/provider/JniNotificationProvider.cpp @@ -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 diff --git a/service/notification/examples/android/NotiProviderExample/app/src/main/java/com/sec/notiproviderexample/MainActivity.java b/service/notification/examples/android/NotiProviderExample/app/src/main/java/com/sec/notiproviderexample/MainActivity.java index 481f74e63..5d033fc00 100755 --- a/service/notification/examples/android/NotiProviderExample/app/src/main/java/com/sec/notiproviderexample/MainActivity.java +++ b/service/notification/examples/android/NotiProviderExample/app/src/main/java/com/sec/notiproviderexample/MainActivity.java @@ -262,13 +262,6 @@ public class MainActivity extends Activity { Log.i(TAG, "#" + notiId + " notified .."); TvLog.append("Send Notitication(Msg ID: " + notiId + ")\n"); notiId++; - org.iotivity.service.ns.common.Message notiMessage = new org.iotivity.service.ns.common.Message(title,body,"provider"); - notiMessage.setTTL(10); - notiMessage.setTime(DateFormat.getDateTimeInstance().format(new Date())); - notiMessage.setTopic(topic); - MediaContents media = new MediaContents("Video"); - notiMessage.setMediaContents(media); - mProviderSample.SendMessage(notiMessage); } break; -- 2.34.1