Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/jni/JniSubscription.cpp

Issue 29405564: Issue 5121 - Use Acceptable Ads API in libadblockplus (Closed)
Patch Set: Created April 7, 2017, 7:03 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android/jni/JniSubscription.cpp
diff --git a/libadblockplus-android/jni/JniSubscription.cpp b/libadblockplus-android/jni/JniSubscription.cpp
index bab56d37b2860e4e11ae58a047fcb2a4395ec14b..a77b4030ce17efcab9a125ce609bf78bd6108228 100644
--- a/libadblockplus-android/jni/JniSubscription.cpp
+++ b/libadblockplus-android/jni/JniSubscription.cpp
@@ -81,6 +81,15 @@ static jboolean JNICALL JniOperatorEquals(JNIEnv* env, jclass clazz, jlong ptr,
CATCH_THROW_AND_RETURN(env, JNI_FALSE)
}
+static jboolean JNICALL JniIsAcceptableAds(JNIEnv* env, jclass clazz, jlong ptr)
+{
+ try
+ {
+ return (GetSubscriptionPtr(ptr)->IsAA() ? JNI_TRUE : JNI_FALSE);
+ }
+ CATCH_THROW_AND_RETURN(env, JNI_FALSE)
+}
+
static JNINativeMethod methods[] =
{
{ (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed },
@@ -88,7 +97,8 @@ static JNINativeMethod methods[] =
{ (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList },
{ (char*)"updateFilters", (char*)"(J)V", (void*)JniUpdateFilters },
{ (char*)"isUpdating", (char*)"(J)Z", (void*)JniIsUpdating },
- { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals }
+ { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals },
+ { (char*)"isAcceptableAds", (char*)"(J)Z", (void*)JniIsAcceptableAds },
};
extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_Subscription_registerNatives(JNIEnv *env, jclass clazz)

Powered by Google App Engine
This is Rietveld