X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/0b567b9713475d19fe586799a2e068f072c25da0..1a3a1502485968a77640c08ae6f6b1bc06de1164:/src/com/owncloud/android/authentication/AccountUtils.java diff --git a/src/com/owncloud/android/authentication/AccountUtils.java b/src/com/owncloud/android/authentication/AccountUtils.java index 9afa819c..b535fc90 100644 --- a/src/com/owncloud/android/authentication/AccountUtils.java +++ b/src/com/owncloud/android/authentication/AccountUtils.java @@ -23,6 +23,7 @@ package com.owncloud.android.authentication; import java.util.Locale; import com.owncloud.android.MainApp; +import com.owncloud.android.lib.common.OwnCloudAccount; import com.owncloud.android.lib.common.accounts.AccountTypeUtils; import com.owncloud.android.lib.common.accounts.AccountUtils.Constants; import com.owncloud.android.lib.common.utils.Log_OC; @@ -267,4 +268,20 @@ public class AccountUtils { return url; } + /** + * Access the version of the OC server corresponding to an account SAVED IN THE ACCOUNTMANAGER + * + * @param account ownCloud account + * @return Version of the OC server corresponding to account, according to the data saved + * in the system AccountManager + */ + public static OwnCloudVersion getServerVersion(Account account) { + if (account != null) { + AccountManager accountMgr = AccountManager.get(MainApp.getAppContext()); + String serverVersionStr = accountMgr.getUserData(account, Constants.KEY_OC_VERSION); + return new OwnCloudVersion(serverVersionStr); + } + return null; + } + }