Skip to content

Commit

Permalink
fix: added limit parameter to the JNI wrapper for get_events
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jun 22, 2020
1 parent 9e796b4 commit 147a2d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aw-server/src/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub mod android {
extern crate jni;

use self::jni::objects::{JClass, JString};
use self::jni::sys::{jdouble, jstring};
use self::jni::sys::{jdouble, jint, jstring};
use self::jni::JNIEnv;
use super::*;
use aw_datastore::Datastore;
Expand Down Expand Up @@ -220,9 +220,11 @@ pub mod android {
env: JNIEnv,
_: JClass,
java_bucket_id: JString,
java_limit: jint,
) -> jstring {
let bucket_id = jstring_to_string(&env, java_bucket_id);
match openDatastore().get_events(&bucket_id, None, None, None) {
let limit = java_limit as u64;
match openDatastore().get_events(&bucket_id, None, None, Some(limit)) {
Ok(events) => string_to_jstring(&env, json!(events).to_string()),
Err(e) => create_error_object(
&env,
Expand Down

0 comments on commit 147a2d0

Please sign in to comment.