| Index: jni/Utils.h |
| diff --git a/jni/Utils.h b/jni/Utils.h |
| index 852457cdd95095e57e8232fe2b40ae316814c636..d77f37bb5f0fe0dbfd98a6641b73cc4f2d22eef6 100644 |
| --- a/jni/Utils.h |
| +++ b/jni/Utils.h |
| @@ -162,6 +162,18 @@ inline jobject NewJniSubscription(JNIEnv* env, const AdblockPlus::SubscriptionPt |
| return env->NewObject(clazz, method, JniPtrToLong(new AdblockPlus::SubscriptionPtr(subscription))); |
| } |
| +inline jobject NewJniNotification(JNIEnv* env, const AdblockPlus::NotificationPtr& notification) |
| +{ |
| + if (!notification.get()) |
| + { |
| + return 0; |
| + } |
| + |
| + jclass clazz = env->FindClass(PKG("Notification")); |
| + jmethodID method = env->GetMethodID(clazz, "<init>", "(J)V"); |
| + return env->NewObject(clazz, method, JniPtrToLong(new AdblockPlus::NotificationPtr(notification))); |
| +} |
| + |
| #define CATCH_AND_THROW(jEnv) \ |
| catch (const std::exception& except) \ |
| { \ |