aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/src
diff options
context:
space:
mode:
authorylecollen <ylecollen@amdocs.com>2017-01-09 16:39:54 +0100
committerylecollen <ylecollen@amdocs.com>2017-01-09 16:39:54 +0100
commit29339bc00a52391d78d7f9b723880ce5577d8981 (patch)
treefe16209b2576ed9f1f6d1bafce49ab43507fe10b /java/android/OlmLibSdk/olm-sdk/src
parenta14bf30c43d87e6316fd984a6be76de0c9a9ba7a (diff)
Update getSdkOlmVersion to provide the git commit
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/src')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java2
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java13
2 files changed, 11 insertions, 4 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
index 699d966..d474f12 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
@@ -65,7 +65,7 @@ public class OlmAccountTest {
String olmLibVersion = mOlmManager.getOlmLibVersion();
assertNotNull(olmLibVersion);
- String olmSdkVersion = mOlmManager.getSdkOlmVersion();
+ String olmSdkVersion = mOlmManager.getSdkOlmVersion(getInstrumentation().getContext());
assertNotNull(olmLibVersion);
Log.d(LOG_TAG, "## setUpClass(): Versions - Android Olm SDK = "+olmSdkVersion+" Olm lib ="+olmLibVersion);
}
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java
index 2efb0c2..c1e6031 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java
@@ -17,6 +17,7 @@
package org.matrix.olm;
+import android.content.Context;
import android.util.Log;
/**
@@ -25,7 +26,6 @@ import android.util.Log;
*/
public class OlmManager {
private static final String LOG_TAG = "OlmManager";
- private static final String SDK_OLM_VERSION = "V0.1.0_1";
/**
* Constructor.
@@ -41,8 +41,15 @@ public class OlmManager {
}
}
- public String getSdkOlmVersion() {
- return SDK_OLM_VERSION;
+ /**
+ * Provide the android library version
+ * @param context the context
+ * @return the library version
+ */
+ public String getSdkOlmVersion(Context context) {
+ String gitVersion = context.getResources().getString(R.string.git_olm_revision);
+ String date = context.getResources().getString(R.string.git_olm_revision_date);
+ return gitVersion + "-" + date;
}
/**