Add new API to provide the SDK version

This commit is contained in:
pedroGitt 2016-10-27 18:47:14 +02:00
parent 1f1cbf2b3e
commit 724d9ea20b
2 changed files with 12 additions and 3 deletions

View file

@ -62,9 +62,11 @@ public class OlmAccountTest {
// load native lib // load native lib
mOlmManager = new OlmManager(); mOlmManager = new OlmManager();
String version = mOlmManager.getOlmLibVersion(); String olmLibVersion = mOlmManager.getOlmLibVersion();
assertNotNull(version); assertNotNull(olmLibVersion);
Log.d(LOG_TAG, "## setUpClass(): lib version="+version); String olmSdkVersion = mOlmManager.getSdkOlmVersion();
assertNotNull(olmLibVersion);
Log.d(LOG_TAG, "## setUpClass(): Versions - Android Olm SDK = "+olmSdkVersion+" Olm lib ="+olmLibVersion);
} }
@AfterClass @AfterClass

View file

@ -24,6 +24,7 @@ import android.util.Log;
*/ */
public class OlmManager { public class OlmManager {
private static final String LOG_TAG = "OlmManager"; private static final String LOG_TAG = "OlmManager";
private static final String SDK_OLM_VERSION = "V0.1.0_1";
static { static {
try { try {
@ -33,6 +34,12 @@ public class OlmManager {
} }
} }
public String getSdkOlmVersion() {
//Date currentDate = Calendar.getInstance().getTime();
//String retVal = new SimpleDateFormat("yyyyMMdd_HH:mm:ss").format(currentDate);
return SDK_OLM_VERSION;
}
/** /**
* Get the OLM lib version. * Get the OLM lib version.
* @return the lib version as a string * @return the lib version as a string