From eb2052ba057f4e0de58adea6c69eba9062e096b6 Mon Sep 17 00:00:00 2001 From: pedroGitt Date: Tue, 25 Oct 2016 18:16:19 +0200 Subject: Update due to renaming in olm_account.cpp (maxOneTimeKeysJni() & generateOneTimeKeysJni()) Fix removeOneTimeKeysForSession() default return code --- .../olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'java/android/OlmLibSdk/olm-sdk/src/main') diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java index 2381585..116d435 100644 --- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java +++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java @@ -282,7 +282,10 @@ public class OlmAccount implements Serializable { * Return the largest number of "one time keys" this account can store. * @return the max number of "one time keys", -1 otherwise */ - public native long maxOneTimeKeys(); + public long maxOneTimeKeys() { + return maxOneTimeKeysJni(); + } + private native long maxOneTimeKeysJni(); /** * Generate a number of new one time keys.
If total number of keys stored @@ -291,7 +294,10 @@ public class OlmAccount implements Serializable { * @param aNumberOfKeys number of keys to generate * @return 0 if operation succeed, -1 otherwise */ - public native int generateOneTimeKeys(int aNumberOfKeys); + public int generateOneTimeKeys(int aNumberOfKeys) { + return generateOneTimeKeysJni(aNumberOfKeys); + } + private native int generateOneTimeKeysJni(int aNumberOfKeys); /** * Return the "one time keys" in a JSON array.
@@ -341,7 +347,7 @@ public class OlmAccount implements Serializable { * @return 0 if operation succeed, 1 if no matching keys in the sessions to be removed, -1 if operation failed */ public int removeOneTimeKeysForSession(OlmSession aSession) { - int retCode = 0; + int retCode = -1; if(null != aSession) { retCode = removeOneTimeKeysForSessionJni(aSession.getOlmSessionId()); -- cgit v1.2.3