Check the version number instead of the version string

This commit is contained in:
masensio 2014-03-27 18:01:37 +01:00
parent 66bca2934d
commit 53a2789326
6 changed files with 2 additions and 13 deletions

@ -1 +1 @@
Subproject commit 8d820f42fb98af9ca69315b736730e260d5a6917
Subproject commit fc8191e26841dc25407dd74cb50738ff9a3157a6

View file

@ -104,7 +104,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
private static final String KEY_AUTH_MESSAGE_TEXT = "AUTH_MESSAGE_TEXT";
private static final String KEY_HOST_URL_TEXT = "HOST_URL_TEXT";
private static final String KEY_OC_VERSION = "OC_VERSION";
private static final String KEY_OC_VERSION_STRING = "OC_VERSION_STRING";
private static final String KEY_ACCOUNT = "ACCOUNT";
private static final String KEY_SERVER_VALID = "SERVER_VALID";
private static final String KEY_SERVER_CHECKED = "SERVER_CHECKED";
@ -250,8 +249,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
/// retrieve extras from intent
mAccount = getIntent().getExtras().getParcelable(EXTRA_ACCOUNT);
if (mAccount != null) {
String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);
String ocVersionString = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION_STRING);
String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);
if (ocVersion != null) {
mDiscoveredVersion = new OwnCloudVersion(ocVersion);
}
@ -286,7 +284,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
/// server data
String ocVersion = savedInstanceState.getString(KEY_OC_VERSION);
String ocVersionString = savedInstanceState.getString(KEY_OC_VERSION_STRING);
if (ocVersion != null) {
mDiscoveredVersion = new OwnCloudVersion(ocVersion);
}
@ -464,7 +461,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
/// server data
if (mDiscoveredVersion != null) {
outState.putString(KEY_OC_VERSION, mDiscoveredVersion.getVersion());
outState.putString(KEY_OC_VERSION_STRING, mDiscoveredVersion.getVersionString());
}
outState.putString(KEY_HOST_URL_TEXT, mHostBaseUrl);
@ -1370,7 +1366,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
}
/// 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());
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION_STRING, mDiscoveredVersion.getVersionString());
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL, mHostBaseUrl);
if (isSaml) {

View 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));
}

View 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);

View 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);

View 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;