Check the version number instead of the version string
authormasensio <masensio@solidgear.es>
Thu, 27 Mar 2014 17:01:37 +0000 (18:01 +0100)
committermasensio <masensio@solidgear.es>
Thu, 27 Mar 2014 17:01:37 +0000 (18:01 +0100)
owncloud-android-library
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/files/FileOperationsHelper.java
src/com/owncloud/android/files/services/FileUploader.java
src/com/owncloud/android/operations/UpdateOCVersionOperation.java
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index 8d820f4..fc8191e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8d820f42fb98af9ca69315b736730e260d5a6917
+Subproject commit fc8191e26841dc25407dd74cb50738ff9a3157a6
index 4fab95d..8cbe7ad 100644 (file)
@@ -104,7 +104,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     private static final String KEY_AUTH_MESSAGE_TEXT = "AUTH_MESSAGE_TEXT";\r
     private static final String KEY_HOST_URL_TEXT = "HOST_URL_TEXT";\r
     private static final String KEY_OC_VERSION = "OC_VERSION";\r
-    private static final String KEY_OC_VERSION_STRING = "OC_VERSION_STRING";\r
     private static final String KEY_ACCOUNT = "ACCOUNT";\r
     private static final String KEY_SERVER_VALID = "SERVER_VALID";\r
     private static final String KEY_SERVER_CHECKED = "SERVER_CHECKED";\r
@@ -250,8 +249,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             /// retrieve extras from intent\r
             mAccount = getIntent().getExtras().getParcelable(EXTRA_ACCOUNT);\r
             if (mAccount != null) {
-                String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);\r
-                String ocVersionString = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION_STRING);
+                String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);
                 if (ocVersion != null) {\r
                     mDiscoveredVersion = new OwnCloudVersion(ocVersion);\r
                 }\r
@@ -286,7 +284,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
 \r
             /// server data\r
             String ocVersion = savedInstanceState.getString(KEY_OC_VERSION);\r
-            String ocVersionString = savedInstanceState.getString(KEY_OC_VERSION_STRING);\r
             if (ocVersion != null) {\r
                 mDiscoveredVersion = new OwnCloudVersion(ocVersion);\r
             }\r
@@ -464,7 +461,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         /// server data\r
         if (mDiscoveredVersion != null) {\r
             outState.putString(KEY_OC_VERSION, mDiscoveredVersion.getVersion());\r
-            outState.putString(KEY_OC_VERSION_STRING, mDiscoveredVersion.getVersionString());\r
         }\r
         outState.putString(KEY_HOST_URL_TEXT, mHostBaseUrl);\r
 \r
@@ -1370,7 +1366,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             }\r
             /// add user data to the new account; TODO probably can be done in the last parameter addAccountExplicitly, or in KEY_USERDATA
             mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION,         mDiscoveredVersion.getVersion());\r
-            mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION_STRING,  mDiscoveredVersion.getVersionString());\r
             mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL,   mHostBaseUrl);\r
 
             if (isSaml) {\r
index f47ab51..5d50007 100644 (file)
@@ -139,7 +139,6 @@ public class FileOperationsHelper {
             AccountManager accountManager = AccountManager.get(callerActivity);
 
             String version = accountManager.getUserData(callerActivity.getAccount(), Constants.KEY_OC_VERSION);
-            String versionString = accountManager.getUserData(callerActivity.getAccount(), Constants.KEY_OC_VERSION_STRING);
             return (new OwnCloudVersion(version)).isSharedSupported();
             //return Boolean.parseBoolean(accountManager.getUserData(callerActivity.getAccount(), OwnCloudAccount.Constants.KEY_SUPPORTS_SHARE_API));
         }
index ca3297f..9d2b4fa 100644 (file)
@@ -253,7 +253,6 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
 
         AccountManager aMgr = AccountManager.get(this);
         String version = aMgr.getUserData(account, Constants.KEY_OC_VERSION);
-        String versionString = aMgr.getUserData(account, Constants.KEY_OC_VERSION_STRING);
         OwnCloudVersion ocv = new OwnCloudVersion(version);
         
         boolean chunked = FileUploader.chunkedUploadIsSupported(ocv);
index d9d071f..ddcd52c 100644 (file)
@@ -78,11 +78,9 @@ public class UpdateOCVersionOperation extends RemoteOperation {
                     if (json != null && json.getString("version") != null) {
 
                         String version = json.getString("version");
-                        String versionstring = json.getString("versionstring");
                         mOwnCloudVersion = new OwnCloudVersion(version);
                         if (mOwnCloudVersion.isVersionValid()) {
                             accountMngr.setUserData(mAccount, Constants.KEY_OC_VERSION, mOwnCloudVersion.getVersion());
-                            accountMngr.setUserData(mAccount, Constants.KEY_OC_VERSION_STRING, mOwnCloudVersion.getVersionString());
                             Log_OC.d(TAG, "Got new OC version " + mOwnCloudVersion.toString());
 
                             result = new RemoteOperationResult(ResultCode.OK);
index d0c6069..867e4cf 100644 (file)
@@ -19,8 +19,6 @@
 package com.owncloud.android.ui.activity;
 
 import java.io.File;
-import java.io.InvalidClassException;
-
 import android.accounts.Account;
 import android.app.AlertDialog;
 import android.app.Dialog;