#include "base/android/jni_generator/jni_generator_helper.h"
+#include "base/android/jni_int_wrapper.h"
+
// Step 1: forward declarations.
namespace {
const char kInnerStructAClassPath[] =
}
static base::subtle::AtomicWord g_SampleForTests_javaMethod = 0;
-static jint Java_SampleForTests_javaMethod(JNIEnv* env, jobject obj, jint foo,
- jint bar) {
+static jint Java_SampleForTests_javaMethod(JNIEnv* env, jobject obj,
+ JniIntWrapper foo,
+ JniIntWrapper bar) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
g_SampleForTests_clazz, 0);
jint ret =
env->CallIntMethod(obj,
- method_id, foo, bar);
+ method_id, as_jint(foo), as_jint(bar));
jni_generator::CheckException(env);
return ret;
}
static base::subtle::AtomicWord g_InnerStructA_create = 0;
static base::android::ScopedJavaLocalRef<jobject>
Java_InnerStructA_create(JNIEnv* env, jlong l,
- jint i,
+ JniIntWrapper i,
jstring s) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, g_InnerStructA_clazz,
jobject ret =
env->CallStaticObjectMethod(g_InnerStructA_clazz,
- method_id, l, i, s);
+ method_id, l, as_jint(i), s);
jni_generator::CheckException(env);
return base::android::ScopedJavaLocalRef<jobject>(env, ret);
}