aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk
diff options
context:
space:
mode:
authorpedroGitt <pedro.contreiras@amdocs.com>2016-10-25 18:16:19 +0200
committerpedroGitt <pedro.contreiras@amdocs.com>2016-10-25 18:16:19 +0200
commiteb2052ba057f4e0de58adea6c69eba9062e096b6 (patch)
tree9d8edda87cd9fd4fc570fa0a5a24e0576723cb9c /java/android/OlmLibSdk
parenta6401c72e6c382b906850d8975331df25439db00 (diff)
Update due to renaming in olm_account.cpp (maxOneTimeKeysJni() & generateOneTimeKeysJni())
Fix removeOneTimeKeysForSession() default return code
Diffstat (limited to 'java/android/OlmLibSdk')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java12
1 files changed, 9 insertions, 3 deletions
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.<br> 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.<br>
@@ -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());