Automatic grid view is only enabled if server supports remote thumbnails and ALL...
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AccountUtils.java
index 9afa819..b535fc9 100644 (file)
@@ -23,6 +23,7 @@ package com.owncloud.android.authentication;
 import java.util.Locale;\r
 \r
 import com.owncloud.android.MainApp;\r
+import com.owncloud.android.lib.common.OwnCloudAccount;\r
 import com.owncloud.android.lib.common.accounts.AccountTypeUtils;\r
 import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;\r
 import com.owncloud.android.lib.common.utils.Log_OC;\r
@@ -267,4 +268,20 @@ public class AccountUtils {
         return url;\r
     }\r
 \r
+    /**\r
+     * Access the version of the OC server corresponding to an account SAVED IN THE ACCOUNTMANAGER\r
+     *\r
+     * @param   account     ownCloud account\r
+     * @return              Version of the OC server corresponding to account, according to the data saved\r
+     *                      in the system AccountManager\r
+     */\r
+    public static OwnCloudVersion getServerVersion(Account account) {\r
+        if (account != null) {\r
+            AccountManager accountMgr = AccountManager.get(MainApp.getAppContext());\r
+            String serverVersionStr = accountMgr.getUserData(account, Constants.KEY_OC_VERSION);\r
+            return new OwnCloudVersion(serverVersionStr);\r
+        }\r
+        return null;\r
+    }\r
+\r
 }\r